GCC/build problems
I was doing a system upgrade. Following the instructions from
http://www.gentoo.org/doc/en/handboo...?part=2&chap=1 Code:
emerge --sync Code:
emerge --update --deep --with-bdeps=y --newuse world Code:
configure: error: C compiler cannot create executables I then tried to rebuild libtool. Again, I got the same message: Code:
bullshark@beastlinux ~ % sudo emerge -av --oneshot libtool Code:
This file contains any messages produced by compilers while Quote:
Code:
Portage 2.1.10.65 (hardened/linux/x86, gcc-4.5.3, glibc-2.14.1-r3, 3.2.12-gentoo-laptop i686) Code:
bullshark@beastlinux ~ % cat hello.c |
What does config.log say??
|
That is the config.log. I made a mistake and said it was the build.log. I was just about to go back and fix that, and then I saw you had replied.
I edited it. Also see the part I quoted from the config.log. |
I solved it.
|
so how did you solve it?
|
your post said you solved it, how?
I'm have built LFS 7.1 and it boots. now been going through BLFS and every thing I try to install gets that same error, configure:3306: gcc -V >&5 gcc: error: unrecognized option '-V' gcc: fatal error: no input files compilation terminated. configure:3317: $? = 1 configure:3306: gcc -qversion >&5 gcc: error: unrecognized option '-qversion' gcc: fatal error: no input files compilation terminated. thanks for your help yelims |
Here's how I solved it, and please let me know if this fixes your LFS.
Yelims, of course, you will have to do things a bit different in LFS because you're not using emerge, and I don't know if you can put binary packages in LFS. If not, maybe you can extract the contents of http://tinderbox.dev.gentoo.org/defa...2.21.1-r1.tbz2 (that's for x86, so if you're using something else, browse to the right url patch) except for gentoo specific files (probably won't hurt). Hopefully your filesystem layout (paths) are the same or adjust accordingly. Keep reading to see why I used binutils. It might be a different package (or source tarball) that needs to be reinstalled with your system. Notice that when I made the simple hello.c Code:
#include <stdio.h> Code:
bullshark@beastlinux ~ % gcc hello.c -o hello Notice it says binutils in there, so that gave me the idea to reinstall binutils, couldn't hurt to try. I already had setup my Gentoo installation to be able to use binary packages so that I could get a working gcc. I will write how I did that for anybody that's also using Gentoo. Add these to lines to your /etc/make.conf Code:
PKGDIR="/usr/portage/packages" Create that directory. Don't worry, any subdirectory under that will automatically be created for you. Code:
mkdir -p /usr/portage/packages Code:
emerge --getbinpkgonly --oneshot -av sys-devel/gcc Code:
bullshark@beastlinux ~ % gcc hello.c -o hello Important, if you've read the gcc upgrading guide on the gentoo docs, it says to rebuild libtools. Also downgrading gcc is highly discouraged and says it will result in strange behaviour, so do not use this gcc to compile anything but a newer gcc And it will likely be an older gcc. After emerging the new gcc, set it as your default gcc with gcc-config (See gentoo docs on upgrading gcc for more details on how to do this.) Now you've to repeat the process because you just changed gcc versions again. Also, because I wanted all my packages compiled with source using my CFLAG's and USE flags, I recompiled binutils Code:
emerge -av --oneshot sys-devel/libtools Code:
env-update && . /etc/profile Note: If you haven't figured out what the . does when used this way, it's an alias to source, so if you really wanted to, you could just source /etc/profile. Both will give you the same result. Now you've got a working Gentoo system again! Also Gentoo had put in my user's .bashrc (and .zshrc because I use zsh also) export PATH=..... with a path to the gcc versions bin directory. Probably not relevant, but since I use sudo and have configured, added my user to the wheel group and configured it so that it prompts me for the password to run a command as root, i added all the sbin (system binary) paths to my .bashrc (and .zshrc) with Code:
export PATH=$PATH:/home/bullshark/bin:/usr/local/sbin:/usr/sbin:/sbin If you found this post helpful, please give me some reputation points by marking it useful. Thanks. I hope this helps somebody solve their problem. |
thanks flip
it is what I figured I'll be rebuilding my binutils and gcc |
You may have to build it on another machine because you can't build anything right now. After you build it on another machine, copy the folder with the binaries and source to your LFS machine and then run the make install.
|
Thanks!!!
@fakie - I have peruzed these forums for quite some time now and have always thought it was too much trouble to register to get in on the action. But sweet jesus, you just saved my machine!!! So I thought I should take the time to at least thank you.
Despite the fact that I do not run Gentoo (Arch user personally, although I spent some time with Gentoo), this diagnotic trick of creating the hello.c was simply genius. I was straining my eyes over that stupid log file, messing with this and that, trying to compile this and that, and even went so far as to begin the initial steps of downgrading my entire system when I came across your post. So you just saved me from possibly severyle breaking my install, thanks! By the way, my problem was with a file owned by glibc, which during a recent update moved /lib to /usr/lib and symlinked the original. Needless to say, for me this move was not entirely smooth for me. So resintallation of glibc fixed it for me. Cheers! :hattip: |
Hey =D Glad I could help!
|
All times are GMT -5. The time now is 08:05 AM. |