Error configuring GCC, First Pass
Hi all. I'm attempting to compile LFS-5.1.1, and am having some problems. Binutils appeared to go smoothly, but when it came to building GCC-3.3.3 pass-one, I got the following error message on configuring:
Code:
Configuring "Makefile" in /mnt/lfs/sources/gcc-build using 'mt-frag' Thanks in advance! :) |
sorry if I do not answer that one directly, but instead give you directions...
I - and others - have commented on exactly the same issue...may have been yesterday or even 3 or 4 days ago... I cannot remember, so: try searching for posts from me or Andrew Benton - I remember him adding to this issue this is (most probable) due to a typo in your command (did you cut & paste it?) |
I didn't cut-and-paste the command, but I did check it very carefully several times, and I'm sure there was no typo. Here's what I typed:
Code:
../gcc-3.3.3/configure --prefix=/tools --with-local-prefix=/tools --disable-nls --enable-shared --enable-languages=c Any other ideas? What's this CC environment variable thing all about? Please excuse my "newbieness"! :) |
the thread I was referring to is here:
http://www.linuxquestions.org/questi...5&goto=newpost I did not follow it and don't know, if anything came out - maybe asking the one who posted the question will help? if this was really your command, then I wonder where the error-message got, what it is saying: /tools/bin/ld: Unrecognised option '--as needed' |
The CC environment-variable normally contains the real name - maybe even the path and the name of your compiler - you can use it to select the compiler ... if you have different versions installed - this is described in the hints, which are available for LFS
if I do: "echo $CC" I get this: cc Jonathan:/home/jochen# echo $CC cc in my .bash_profile I have these entries - which enable me to easyly change, which compiler gets used: CC=cc CXX=c++ #CC=/opt/gcc-2.95.3/bin/gcc #CXX=/opt/gcc-2.95.3/bin/cc++ export CC CXX if I comment out the first two and uncomment the second two - then source the file or log out and back in - which does the same - I will then be using gcc-2.95.3 which is in /opt/gcc-2.95.3/bin/gcc - that is: if the makefile references the compiler by using this variable... |
Nope, that didn't work. Never mind though. I've gotten around the problem by dumping Fedora Core 2 in favour of Debian as the host system. It seems to work on that. I know it's not the ideal solution, and I'd really have liked to have kept Fedora, but what's done is done. I had no choice because I'm working on a small hard drive.
|
I found while using Knoppix to build my LFS 5.11 that I had to set the CC environment variable to point to the gcc-2.95 instead gcc-3.3 that /usr/bin/gcc was linked to. As soon as I did this the error went away.
|
Short disclaimer:
Im a total Linux newbie, started looking into LFS two days ago and compiled my first Linux program ever yesterday. Be warned. From what I can tell based on experience and looking around on the net, the problem has nothing to do with the actual CC variable, the problem is further up, and the problem is that GCC 3.3.3 (used by Fedora 2) tries to use the --as-needed flag with the ld you compiled one step earlier (in binutils). LFS uses binutils 2.14, and that version of ld does not support --as-needed. Somehow GCC 3.3.3 checks for binutils version on the host system instead of checking the ld it is about to use. To fix it, use an older GCC or use binutils 2.15 in your LFS. |
- Run gcc -v and check the output for line "Reading specs from /usr/lib........./specs
- Save backup copy of specs file. - Edit this file and find (and delete) option --as-needed - After building the LFS copy back your original specs file. |
All times are GMT -5. The time now is 02:21 PM. |