LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices

Reply
 
Search this Thread
Old 10-30-2004, 03:11 PM   #1
ParticleHunter
Member
 
Registered: Apr 2004
Location: Malaga, Spain
Distribution: LFS
Posts: 129

Rep: Reputation: 15
Angry odd problem with GCC pass 1... :scratch:


I encountered this problem:

make[4]: Leaving directory `/mnt/lfs/sources/gcc-build/gcc'
./xgcc -B./ -B/tools/x86_64-unknown-linux-gnu/bin/ -isystem /tools/x86_64-unknown-linux-gnu/include -isystem /tools/x86_64-unknown-linux-gnu/sys-include -L/mnt/lfs/sources/gcc-build/gcc/../ld -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -shared -nodefaultlibs -Wl,--soname=libgcc_s.so.1 -Wl,--version-script=libgcc/32/libgcc.map -o 32/libgcc_s.so.1 -m32 libgcc/32/_muldi3.o libgcc/32/_negdi2.o libgcc/32/_lshrdi3.o libgcc/32/_ashldi3.o libgcc/32/_ashrdi3.o libgcc/32/_cmpdi2.o libgcc/32/_ucmpdi2.o libgcc/32/_floatdidf.o libgcc/32/_floatdisf.o libgcc/32/_fixunsdfsi.o libgcc/32/_fixunssfsi.o libgcc/32/_fixunsdfdi.o libgcc/32/_fixdfdi.o libgcc/32/_fixunssfdi.o libgcc/32/_fixsfdi.o libgcc/32/_fixxfdi.o libgcc/32/_fixunsxfdi.o libgcc/32/_floatdixf.o libgcc/32/_fixunsxfsi.o libgcc/32/_fixtfdi.o libgcc/32/_fixunstfdi.o libgcc/32/_floatditf.o libgcc/32/_clear_cache.o libgcc/32/_enable_execute_stack.o libgcc/32/_trampoline.o libgcc/32/__main.o libgcc/32/_absvsi2.o libgcc/32/_absvdi2.o libgcc/32/_addvsi3.o libgcc/32/_addvdi3.o libgcc/32/_subvsi3.o libgcc/32/_subvdi3.o libgcc/32/_mulvsi3.o libgcc/32/_mulvdi3.o libgcc/32/_negvsi2.o libgcc/32/_negvdi2.o libgcc/32/_ctors.o libgcc/32/_ffssi2.o libgcc/32/_ffsdi2.o libgcc/32/_clz.o libgcc/32/_clzsi2.o libgcc/32/_clzdi2.o libgcc/32/_ctzsi2.o libgcc/32/_ctzdi2.o libgcc/32/_popcount_tab.o libgcc/32/_popcountsi2.o libgcc/32/_popcountdi2.o libgcc/32/_paritysi2.o libgcc/32/_paritydi2.o libgcc/32/_divdi3.o libgcc/32/_moddi3.o libgcc/32/_udivdi3.o libgcc/32/_umoddi3.o libgcc/32/_udiv_w_sdiv.o libgcc/32/_udivmoddi4.o libgcc/32/unwind-dw2.o libgcc/32/unwind-dw2-fde-glibc.o libgcc/32/unwind-sjlj.o libgcc/32/gthr-gnat.o libgcc/32/unwind-c.o -lc && rm -f libgcc_s_32.so && ln -s 32/libgcc_s.so.1 libgcc_s_32.so
/tools/x86_64-unknown-linux-gnu/bin/ld: crti.o: No such file: No such file or directory
collect2: ld returned 1 exit status
make[3]: *** [32/libgcc_s_32.so] Error 1
make[3]: Leaving directory `/mnt/lfs/sources/gcc-build/gcc'
make[2]: *** [stmp-multilib] Error 2
make[2]: Leaving directory `/mnt/lfs/sources/gcc-build/gcc'
make[1]: *** [stage1_build] Error 2
make[1]: Leaving directory `/mnt/lfs/sources/gcc-build/gcc'
make: *** [bootstrap] Error 2


no matter I try binutils 2.15 or 2.15.92.0.2, or the full gcc tarball or just the core tarball...
same annoying problem...

host system is Fedora Core 2 x86-64, and my machine is the one I mention in my signature...

Can anyone help me on how to get rid ot this annoying error?

Thanks in Advance,

Julio
 
Old 10-31-2004, 09:31 AM   #2
rickseiden
LQ Newbie
 
Registered: Oct 2004
Posts: 22

Rep: Reputation: 15
Me too

I get a similar error:

make[2]: Entering directory `/mnt/lfs/sources/gcc-build/gcc'
stage1/xgcc -Bstage1/ -B/tools/i686-pc-linux-gnu/bin/ -c -g -O2 -DIN_GCC -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wtraditiona dantic -Wno-long-long -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -I. -I../.. 3.3.3/gcc -I../../gcc-3.3.3/gcc/. -I../../gcc-3.3.3/gcc/config -I../../gcc- /gcc/../include ../../gcc-3.3.3/gcc/gengenrtl.c -o gengenrtl.o
stage1/xgcc -Bstage1/ -B/tools/i686-pc-linux-gnu/bin/ -g -O2 -DIN_GCC - ll -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wtraditional - tic -Wno-long-long -DHAVE_CONFIG_H -DGENERATOR_FILE -static -o gengenrtl
gengenrtl.o ../libiberty/libiberty.a
/usr/bin/ld: cannot find -lc
collect2: ld returned 1 exit status
make[2]: *** [gengenrtl] Error 1
make[2]: Leaving directory `/mnt/lfs/sources/gcc-build/gcc'
make[1]: *** [stage2_build] Error 2
make[1]: Leaving directory `/mnt/lfs/sources/gcc-build/gcc'
make: *** [bootstrap] Error 2


I've posted it to the mailing list, but that was just today....
 
Old 10-31-2004, 12:16 PM   #3
ParticleHunter
Member
 
Registered: Apr 2004
Location: Malaga, Spain
Distribution: LFS
Posts: 129

Original Poster
Rep: Reputation: 15
I discovered that if I make the libraries statically linked using --disable-shared in the gcc configure script, it completes the bootstraping, but as the book says, if you go that way, you don't get the lgcc_eh.so (or similar, don't remember now), so there's no logic in my action... just testing, but for now... no results...

maybe the error could be using FC2 64bit, maybe I'll try to make my 64bit pure system using my FC2 32bit as a host and passing the -m64 optimization flag... I'll try it tonight

wish me luck

Julio
 
Old 11-01-2004, 08:05 PM   #4
rickseiden
LQ Newbie
 
Registered: Oct 2004
Posts: 22

Rep: Reputation: 15
Re: Me too

Quote:
Originally posted by rickseiden
I get a similar error:

make[2]: Entering directory `/mnt/lfs/sources/gcc-build/gcc'
stage1/xgcc -Bstage1/ -B/tools/i686-pc-linux-gnu/bin/ -c -g -O2 -DIN_GCC -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wtraditiona dantic -Wno-long-long -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -I. -I../.. 3.3.3/gcc -I../../gcc-3.3.3/gcc/. -I../../gcc-3.3.3/gcc/config -I../../gcc- /gcc/../include ../../gcc-3.3.3/gcc/gengenrtl.c -o gengenrtl.o
stage1/xgcc -Bstage1/ -B/tools/i686-pc-linux-gnu/bin/ -g -O2 -DIN_GCC - ll -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wtraditional - tic -Wno-long-long -DHAVE_CONFIG_H -DGENERATOR_FILE -static -o gengenrtl
gengenrtl.o ../libiberty/libiberty.a
/usr/bin/ld: cannot find -lc
collect2: ld returned 1 exit status
make[2]: *** [gengenrtl] Error 1
make[2]: Leaving directory `/mnt/lfs/sources/gcc-build/gcc'
make[1]: *** [stage2_build] Error 2
make[1]: Leaving directory `/mnt/lfs/sources/gcc-build/gcc'
make: *** [bootstrap] Error 2


I've posted it to the mailing list, but that was just today....
Well, the mailing list came through. Turns out I needed to install glibc-static to get things going. Used packagedrake to make it work.
 
Old 11-02-2004, 06:49 AM   #5
ParticleHunter
Member
 
Registered: Apr 2004
Location: Malaga, Spain
Distribution: LFS
Posts: 129

Original Poster
Rep: Reputation: 15
glibc static? how?
 
Old 11-02-2004, 03:14 PM   #6
rickseiden
LQ Newbie
 
Registered: Oct 2004
Posts: 22

Rep: Reputation: 15
Glibc-Static

I'm using Mandrake as my host, so I was able to run packagedrake and enter glibc-static, do a search, check a box, put in a cd, and that did it.
 
Old 11-03-2004, 06:07 AM   #7
ParticleHunter
Member
 
Registered: Apr 2004
Location: Malaga, Spain
Distribution: LFS
Posts: 129

Original Poster
Rep: Reputation: 15
humm... as my host is FC2, i'll have to find a workaround to solve the problem...

I've been looking the glibc manual pages for compiling and configuring... seems I'll have to put a few more lines to the configure script, but it's strange, as the LFS book doesn't recommend any optimization flags, and the glibc manual does the opposite... it's useful to give optimization flags...

myabe i'll try to make all with cpu optimizations and code level optimizations, along with no backwards kernel compatibility by adding directly the kernel 2.6.9 compare option and disabling profile or modifying what add-ons are put into glibc... maybe this way I'll be able to get rid of the problem...

I'll try and... let's see if that works

Julio
 
Old 11-03-2004, 06:36 AM   #8
rickseiden
LQ Newbie
 
Registered: Oct 2004
Posts: 22

Rep: Reputation: 15
WAIT

Quote:
Originally posted by ParticleHunter
humm... as my host is FC2, i'll have to find a workaround to solve the problem...
I can't say this for sure, BUT, FC2 is based off RedHat, and RedHat started the whole RPM movement (doesn't it stand for Redhad Package Manager or something like that?). That means that FC2 should have some sort of package management tool that will allow you to do the same thing I did. packageDrake just works off RPMs, after all.

Good luck otherwise
Rick
 
Old 11-03-2004, 12:21 PM   #9
ParticleHunter
Member
 
Registered: Apr 2004
Location: Malaga, Spain
Distribution: LFS
Posts: 129

Original Poster
Rep: Reputation: 15
surely there must be some sort of a static glibc package (not sure, I haven't dived into the DVD), but I don't get the point on doing that...

I mean, you're supposed to compile all the packages by yourself and it's suppposed the host influence on your build, given the fact that you follow the steps of the book (I'm using 'supposedly' up-to-date SVN version with modifications for me to be able to obtain the stablest configuration given the unstable nature of the SVN version ), it's minimal, although not zero, but it's nonsense for me (at least with my current level of understanding on the linux packages) to have my host have static libraries for me to be able to compile a 'brand-new-and-fresh' glibc, it's supposed to be independent, so I don't fully understand your move...

Anyway, as I stated in my previous reply, I'll try to modify glibc settings to eliminate all possible 'hot' points in compilation and being able to have just what I want, as I don't want 32-bit compatibility, just plain 64-bit performance levels, so what I want to do is to... let's say... 'isolate' all chances of making 32bit code, no dependencies, no dynamic code, my intention on this is to compile (after seeing all horrible errors on compiling the 'cute' way) all my system packages statically, at least the basic packages (not having, in example, NSS static, as the glibc manual clearly says if you do so, you defeat the purpose of NSS)

the funny thing in all of this is I'm not completely sure about what I'm talking about, I mean... maybe there isn't the error but it's worth the try... what can I lose on the way? binutils compiles for me in less than 3 minutes (2.34 at my best ) so i have nothing to lose in making my LFS system from scratch time after time, results are what I look for

Julio
 
Old 11-09-2004, 02:20 AM   #10
ravyn
LQ Newbie
 
Registered: Nov 2004
Posts: 1

Rep: Reputation: 0
it *is* possible to build a 64-bit only version of LFS - but it's a pain in the ass.

here's what i did (host system: dual opteron 244/suse 9.1-x86_64)

to solve your GCC problem, pass in the following options to configure:

--without-multilib --disable-multilib

that'll get you past this first hurdle. i would, for good measure, pass them to binutils and glibc as well, although i don't know for sure if either package recognizes them.

during pass 1 of the linux-libc-header install, do this instead of what the book says:

cp -R include/asm-x86_64 /tools/include/asm
cp -R include/linux /tools/include

then when you do your first adjusting of the toolchain, do this:

SPECFILE=`gcc --print-file specs` &&
sed 's@ /lib/ld-linux.so.2@ /tools/lib/ld-linux-x86_64.so.2@g' \
$SPECFILE > tempspecfile &&
mv -f tempspecfile $SPECFILE &&
unset SPECFILE

when you do your second pass through GCC, do not apply the specs patch as given; it won't work. edit lines 65, 78, and 79 to point to /tools/lib/ld-linux-x86-64.so.2 - and then apply the patch.

during your second pass through binutils, do this at the end:

make -C ld LIB_PATH=/usr/lib:/lib:/lib64:/usr/lib64

compile everything else in part 1 as you would normally. when you get to the creation of symlinks at the beginning of part 2, replace this:

ln -s /tools/lib/libgcc_s.so{,.1} /usr/lib

with this:

ln -s /tools/lib64/libgcc_s.so{,.1} /usr/lib64

here are some things to keep in mind as you're building the actual system (chapter 6). vim does not compile (at least not on my machine) so i'd suggest using another editor. when building gcc, glibc, and binutils, make sure to pass the flags i gave above. when building anything that installs libraries, put them in /lib64 or /usr/lib64 whenever possible via passing a --libdir option to configure. same thing when the book tells you to move stuff around from /usr/lib to /lib - do it with /usr/lib64 and /lib64.

here's the kicker: GRUB does not compile under a 64-bit environment. my workaround for this was to take the various /boot/grub files from my host system and just copy them over to the LFS part, and then run grub from the host when i was ready to make the LFS bootable.

there are some other problems that i ran into that i don't remember off-hand but none of them were particularly difficult to solve. i only found this forum due to a google for the same problem you're having, so i don't know how often i'll check back here, but if you have problems or questions, post 'em and i'll try to remember to check in.

good luck!
 
Old 11-09-2004, 05:19 AM   #11
mdh
Member
 
Registered: Nov 2002
Location: Melbourne, Australia
Distribution: (C)LFS (x86_64, ix86, sparcv9, ppc)
Posts: 121

Rep: Reputation: 15
Startfile issues... you can't use the 32bit startfiles when building 64bit...

To build 64bit from a 32bit system you need to jump through a few hoops
For one, you gotta use a cross-toolchain.

I have a set of instructions which will slowly get merged into LFS (its kinda a big change ;-) )

they are available at
http://www.linuxfromscratch.org/~rya...pts/cross-lfs/

Will cross-build pure 64, 32/64 biarch... from whatever you choose to build from.

Scripts are a bit convoluted (evolved from the same plfs scripts we used to hash out LFS 5.0)

Save yourself some pain, give them a try :-)

Regards
Ryan
 
Old 11-09-2004, 10:41 AM   #12
ParticleHunter
Member
 
Registered: Apr 2004
Location: Malaga, Spain
Distribution: LFS
Posts: 129

Original Poster
Rep: Reputation: 15
hmm... sounds interesting... but, If I use your scripts, although cross-compiling LFS it will run 'natively' when switching to the new system, right?

well... I'll take a look at them, we'll stay in contact

Julio
 
Old 11-09-2004, 07:14 PM   #13
mdh
Member
 
Registered: Nov 2002
Location: Melbourne, Australia
Distribution: (C)LFS (x86_64, ix86, sparcv9, ppc)
Posts: 121

Rep: Reputation: 15
Quote:
Originally posted by ParticleHunter
hmm... sounds interesting... but, If I use your scripts, although cross-compiling LFS it will run 'natively' when switching to the new system, right?
Yep, it builds all ch5 (with some additions) and cross-builds a target-native toolchain to use for ch6

Regards
[R]
 
Old 11-30-2004, 02:41 PM   #14
tvburger
LQ Newbie
 
Registered: Nov 2004
Location: the Netherlands
Distribution: gentoo/ubuntu
Posts: 11

Rep: Reputation: 0
ultrasparc gcc 3.4.3 crosscompile

Hi,

After hours of work I finally got it done... (hopefully it will work properly :-p)

* CONFIGURE OPTIONS:
../gcc-3.4.3/configure --disable-threads --disable-nls --without-headers --with-newlib --without-multilib --disable-multilib --enable-shared --target=sparc64-tvburger.net-linux-gnu --prefix=/mnt/tools --enable-languages=c 2>&1|tee configure.log
finishing without errors.

* MAKE OPTIONS:
make LDFLAGS="-static" CFLAGS="-nostdlib" LANGUAGES="c" 2>&1|tee make.log
did have to hack several times.

* MAKE INSTALL:
make install
all ok.
--

I had to do multiple hacks, this is how i got the compiler done.

THREADS:
When compiling the file "gthr-default.h" gets included by "gthr.h". Unfortunatly there does not exist such a file...
When changing to "gthr-posix.h" it tries to use <pthread.h> something that doesn't exist without glibc...
So I ended up with adding --disable-threads as option to configure. This solved all problems with threads.

SED:
When I was compiling the program gave an error about: " sed -e ;"
Of course this is illegal syntax. Simply the script turned out to forget place " $t " behind it. When trying manually the hole bash command it did work (with changing "sed -e ;" to "sed -e $t ;"). How could I pass this? Fortunatly it has an if elseif construction.
When making symlinks to your bin directory containing your new binutils it will work. So let's do it:
ln -s ${PREFIX}/${TARGET}/bin ${PREFIX}/gcc-build/gcc/binutils

COULD NOT FIND ./nm
Later in the progress i found out that the program nm could not be found. Even when the dir containing nm (and ar and as) was in my PATH. Even when having the symlink in gcc-build/gcc/binutils. This time I had to make another symlink.
ln -s ${PREFIX}/${TARGET}/bin/* ${PREFIX}/gcc-build/gcc/.
Now it was going all ok.

COULD NOT FIND crti.o AND crtn.o
Hmm, my host system had also the crti.o and crtn.o files. Why not simply copy them in my dir? Well that was 32bit code, but what the hack.... Yes, it did proceed. So:
cp /usr/lib/{crti.o,crtn.o} ${PREFIX}/gcc-build/gcc/.
Lets go!

COULD NOT FIND -lc
When running xgcc it was given the option -lc. What? I didnot have a c library sofar. It simply shouldnt pass the option. Since I am no expert on makefile and makescripts I didn't no what to do. Even giving all kinds of options to configure and make didnt work. So lets do:
grep -R -- -lc ${PREFIX}/gcc-build
This gave me a .mk file which contained the -lc option. I simply deleted the entry. It did the trick.. OK nice going.

COULD NOT FIND -lc (2nd time)
Same trick.

THEN WARNINGS:
/mnt/tools/sparc64-tvburger.net-linux-gnu/bin/ld: warning: sparc:v8plus architecture of input file `/mnt/tools/gcc-build/gcc/crti.o' is incompatible with sparc:v9 output
/mnt/tools/sparc64-tvburger.net-linux-gnu/bin/ld: warning: sparc:v8plus architecture of input file `/mnt/tools/gcc-build/gcc/crtn.o' is incompatible with sparc:v9 output
make[2]: Leaving directory `/mnt/tools/gcc-build/gcc'
echo timestamp > stmp-multilib
make[1]: Leaving directory `/mnt/tools/gcc-build/gcc'


DONE..
huh? Yes it was done but with a warning. probably it now within the next day if it really will hold... hmmm..

Any comments on how todo better, are welcome. Did more people have such problems? I really want to do it again but now with the proper crt[in].o files. How to get them?

WELCOME TO THE MYSTERIES OF GCC - Tom
 
Old 12-03-2004, 04:52 AM   #15
tvburger
LQ Newbie
 
Registered: Nov 2004
Location: the Netherlands
Distribution: gentoo/ubuntu
Posts: 11

Rep: Reputation: 0
The files crti.o and crtn.o are created when compiling glibc.... But this makes a deadlock.... gcc depends glibc. What about it???

-= Tom =-
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LFS-5.0 GCC problem with binutils-2.14 pass 1 NCappaZoo Linux From Scratch 6 06-14-2009 03:47 AM
Building GCC on SuSE 9.3 from scratch... foucault Linux - Software 0 10-25-2005 06:30 AM
Installing GCC from scratch?? The_Nerd Linux - Software 2 10-23-2005 03:39 PM
Solved Problem Second GCC-Pass(or gettext sanity check problem) hoes Linux From Scratch 0 09-04-2005 10:20 AM
Rebuilding slackware from scratch with gcc-3.4.4 fast_rizwaan Slackware 11 08-15-2005 01:20 PM


All times are GMT -5. The time now is 10:06 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration