Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
error: cannot run C compiled programs
View unanswered posts
View posts from last 24 hours

Reply to topic    Gentoo Forums Forum Index Duplicate Threads
View previous topic :: View next topic  
Author Message

Joined: 07 Feb 2005
Posts: 235
Location: Hoboken, NJ

PostPosted: Mon Apr 11, 2005 4:53 pm    Post subject: error: cannot run C compiled programs Reply with quote

Okay guys, this is a very weird error, one that i can't even find MENTIONED on all of gentoo forums. Here's my story: my main harddrive (/ partition) crashed, leaving me with only a working /home partition drive. not to be daunted, i hook up another harddrive in its place and try to start over. I had originally built the system using the Stage 1 on 3 with NPTL in the 2004.3 profile, then upgraded myself to 2005.0. So i figured i'd go with the Stage 1 on 3 2005.0 build. to keep it short, it refused to work. kept bombing out, once even giving me a kernel panic that required a reboot to fix. Anywho, i figured the 2005.0 profile was wack (i know its not, it just is for my box) and i went to the 2004.3 which worked previously. I started having problems.. Mostly with things like glibc and gcc compiling. I fooled around with flags and such, and i'm convinced that its not the method thats messed up, but somethign else i must be doing wrong. So far, i have a perfectly md5'ed stage three, and i followed the first step in recompiling the toolchain (7.1 for those who follow the guide) it refused to work. glibc kept breaking after 2 hours of solid compiling. finally though, i recompiled the entire toolchain, by compiling gcc FIRST, before glibc, for some reason that made a difference *shrugs*. and it would ONLY compile with the absolute minimum CLFAGS, i.e. whats shipped with stage 3, but with USE flags of USE="nptl ithreads". then i tried the next step, after several env-updates and source /etc/profiles i try to recompile the toolchain in the same order, no go. By the way, there was an emerge sync in there which upped the current gcc version from -r1 to -r2. i was getting some weird errors that i kept ignoring. so i switched up the order, and i think when i had gcc last this time, it compiled everything fine - except gcc. so, glibc binutils and such should be fully up to date with my CFLAGS, however gcc refuses to compile. So i know it works with zero CFLAGS and minimal USE, but not with slightly higher CFLAGS and my full-blown use. the strange part is the error message, it doesn't seem to make sense with whats happening. heres what i get:

# emerge -v gcc glibc binutils portage
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for x86_64-pc-linux-gnu-gcc... /var/tmp/portage/gcc- -B/var/tmp/portage/gcc- -B/usr/x86_64-pc-linux-gnu/bin/ -B/usr/x86_64-pc-linux-gnu/lib/ -isystem /usr/x86_64-pc-linux-gnu/include -isystem /usr/x86_64-pc-linux-gnu/sys-include  -m32
checking for C compiler default output file name... a.out
checking whether the C compiler works... configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
make[1]: *** [configure-target-libstdc++-v3] Error 1
make[1]: Leaving directory `/var/tmp/portage/gcc-'
make: *** [profiledbootstrap] Error 2

!!! ERROR: sys-devel/gcc- failed.
!!! Function gcc_do_make, Line 1133, Exitcode 2
!!! emake failed with profiledbootstrap
!!! If you need support, post the topmost build error, NOT this status message.

any by the way, i've recompiled libtool and libstdc++-v3 several times. in addition i've updated all packaged that are currently on my system so i know the compiler isnt borked, or if it is, in a way thats still functional. As i said earlier, the first time it compiled alright was with the stage3 CFLAGS defaults, and USE="nptl ithreads"
and here's my emerge info:

# emerge info
Gentoo Base System version 1.6.10
Portage (default-linux/amd64/2004.3, gcc-3.4.3-20050110, glibc-, 2.6.9-gentoo-r1 x86_64)
System uname: 2.6.9-gentoo-r1 x86_64 AMD Athlon(tm) 64 Processor 3200+
Python:              dev-lang/python-2.3.5 [2.3.5 (#1, Apr 11 2005, 05:53:42)]
dev-lang/python:     2.3.5
sys-devel/autoconf:  2.59-r6, 2.13
sys-devel/automake:  1.7.9-r1, 1.8.5-r3, 1.5, 1.4_p6, 1.6.3, 1.9.5
sys-devel/libtool:   1.5.14
ACCEPT_KEYWORDS="amd64 ~amd64"
CFLAGS="-O3 -march=k8 -funroll-loops -pipe"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O3 -march=k8 -funroll-loops -pipe"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox"
USE="amd64 X a52 aac aalib acpi aim alsa apache2 apm avi bash-completion berkdb bitmap-fonts bzlib calendar cdparanoia cdr crypt directfb divx4linux dvd dvdr dvdread emul-linux-x86 encode fbcon ffmpeg font-server fortran ftp gif glut gpm gtk gtk2 imlib ipv6 ithreads java javascript jp2 jpeg libcaca lzw lzw-tiff mad motif mp3 mpeg multilib ncurses nls nptl offensive ogg openal opengl oss perl png python qt quicktime readline samba spell ssl tcpd tiff truetype truetype-fonts type1-fonts usb userlocales videos vorbis wmf xml2 xpm xrandr xv xvid zlib"

Has anyone even seen that error before? i can't find it ANYWHERE on the forums, and i've tried all the fixes for "compiler cannot create executables" in case its like that. By the way, when i do a

# echo 'main(){printf("Hello World!\n");}' > test.c
# gcc test.c
# ./a.out
Hello World!

so yeah, i'm a little confused...
Like i said, i have also updated my system, so only GCC gives me this error, any suggestions are GREATLY appreciated.

Open Source, Open Mind
Back to top
View user's profile Send private message

Joined: 11 May 2004
Posts: 760
Location: At Uni

PostPosted: Mon Apr 11, 2005 5:11 pm    Post subject: Reply with quote

Yeah, the php search function sucks, but your problem is mentioned in the FAQs:
Command-line ACCEPT_KEYWORDS is considered harmful, use the package.* files.

The Stage 1 on 3 Install
Back to top
View user's profile Send private message

Joined: 07 Feb 2005
Posts: 235
Location: Hoboken, NJ

PostPosted: Mon Apr 11, 2005 5:20 pm    Post subject: Reply with quote

Wow, i never expected a reply that fast... I decided since it looked like my toolchain is fine except fir GCC, i'd compile gtk+ (and of course xorg as a dependancy), so as soon as thats finished i'll try your solution 8) btw, can i just have


in my make.conf or is that a no-no? Honestly, i've never heard of nor used sandbox, ever.
Open Source, Open Mind
Back to top
View user's profile Send private message

Joined: 14 Apr 2004
Posts: 5511
Location: Durham, UK

PostPosted: Mon Apr 11, 2005 5:23 pm    Post subject: Reply with quote

Please follow up to here: (it's linked to in a slightly convoluted way from the howto. :) )

Moved from Gentoo on AMD64.
No-one's more important than the earthworm.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Duplicate Threads All times are GMT
Page 1 of 1

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum