Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 43790 - gcc-3.3.2 C compiler cannot create executables
Summary: gcc-3.3.2 C compiler cannot create executables
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GCC Porting (show other bugs)
Hardware: x86 Linux
: High blocker (vote)
Assignee: Please assign to toolchain
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-05 04:25 UTC by Ole Tange
Modified: 2004-09-23 19:24 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ole Tange 2004-03-05 04:25:19 UTC
gcc-3.2.2 works without problems.

Upgrading to gcc-3.3.2 causes error when emerging any C-package (such as hashalot or gawk).



Reproducible: Always
Steps to Reproduce:
1. emerge gcc-3.3.2
2. emerge gawk

Actual Results:  
checking for working autoheader... found 
checking for working makeinfo... found 
checking for gcc... gcc 
checking whether the C compiler (gcc -O2 -mcpu=i686 -pipe ) works... no 
configure: error: installation or configuration problem: C compiler cannot 
create executables. 
 
 


Running gcc gives: 
 
# gcc 
Could not run/locate "gcc"
Comment 1 Ole Tange 2004-03-05 04:28:17 UTC
Workaround:
Downgrade to 3.2.2
Insert into gcc-3.3.2-r5.ebuild
  KEYWORDS="~x86"
Comment 2 Alexander Gabert (RETIRED) gentoo-dev 2004-03-05 06:42:26 UTC
can you give the output of gcc-config -L and emerge info
Comment 3 Jay Bolton 2004-03-14 14:16:28 UTC
Here's the output you wanted, from another machine with the same problem.  Also, had to manually edit /etc/ld.so.conf and run ldconfig before emerge would run.  to reproduce:

1) start with 1.4 circa 1/18/04, world built -fstack-protector
2) emerge sync; emerge -u portage
3) get a nasty note about __guard@GCC and do what the nasty note says (re-merge a bunch of stuff with -fstack-protector turned off)
4) emerge -u portage watch it fail
5) try something that needs libstdc++.so.5, i.e. "emerge info" (python fails)
6) then edit ld.so.conf to update the path to the gcc-lib and run ld-config
7) emerge -u portage and it will fail (in my case, hashalot fails to merge, not awk, but the same error:  C compiler cannot create executables
8) run "gcc" and get the error: Could not run/locate "gcc"

Here's the output you wanted.  If you don't do step (6) you get a failure running "emerge info" :)

alderaan root# emerge info


Performing Global Updates: /usr/portage/profiles/updates/1Q-2004
(Could take a couple minutes if you have a lot of binary packages.)
  .='update pass'  *='binary update'  @='/var/db move'
  ...................portage: Update type "slotmove" not recognized.
  ..



   ** Skipping packages. Run 'fixpackages' or set it in FEATURES to fix the
       tbz2's in the packages directory. Note: This can take a very long time.
       Portage 2.0.49-r20 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r3, 2.4.22-gentoo-r5)
       =================================================================
       System uname: 2.4.22-gentoo-r5 i686 AMD Athlon(tm) XP 1800+
       Gentoo Base System version 1.4.3.10
       ACCEPT_KEYWORDS="x86"
       AUTOCLEAN="yes"
       CFLAGS="-mcpu=athlon -O3 -pipe"
       CHOST="i686-pc-linux-gnu"
       COMPILER="gcc3"
       CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/bind /var/qmail/control"
       CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
       CXXFLAGS="-O2 -mcpu=i686 -pipe"
       DISTDIR="/usr/portage/distfiles"
       FEATURES="autoaddcvs ccache sandbox"
       GENTOO_MIRRORS="http://gentoo.oregonstate.edu http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
       MAKEOPTS="-j2"
       PKGDIR="/usr/portage/packages"
       PORTAGE_TMPDIR="/var/tmp"
       PORTDIR="/usr/portage"
       PORTDIR_OVERLAY=""
       SYNC="rsync://rsync.gentoo.org/gentoo-portage"
       USE="X aalib apm arts avi berkdb cdr crypt cups encode esd foomaticdb gdbm gif gnome gpm gtk gtk2 imlib java jpeg kde libg++ libwww mad mbox mikmod milter motif mpeg mysql ncurses nls oggvorbis opengl oss pam pdflib perl png python qt quicktime readline ruby sasl sdl slang spell ssl svga tcltk tcpd truetype x86 xml2 xmms xv zlib"

       alderaan root # gcc-config -L
        * /usr/bin/gcc-config: Profile does not exist!

Comment 4 Jay Bolton 2004-03-14 14:42:50 UTC
Should also mention that when this happens, you can't "downgrade to 3.2.2, add mask" because you can't ebuild 3.2.2 without a compiler from which to bootstrap, and the bug here is...

To recover, you'd have to merge from a binary package of some earlier version (say, the 1.4 GRP) and then add the mask!!!  and continue with whatever it was you were trying to do.  However, if you happen to be lucky enough to read this bug in advance, you could avoid the problem by masking the 3.3.2 package!
Comment 5 Jay Bolton 2004-03-16 09:52:50 UTC
Workaround:  

as above, ensure libstdc++ exists in one of the paths in /etc/ld.so.conf, i.e. probably you will have to modify the line that reads similarly to:

/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.3

And replace it with: 

/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2

Then edit /etc/env.d/gcc/config specifically, the line that reads like:

CURRENT=i686-pc-linux-gnu-3.2.3

Replace with:

CURRENT=i686-pc-linux-gnu-3.3.2

I'm not sure exactly why these were not updated by portage, I will leave that to the gurus.  These changes permit me to proceed with the update. 
Comment 6 Ole Tange 2004-03-18 08:35:12 UTC
Could we please have gcc-3.3.2 marked as unstable until this bug is resolved?
(I have just now made my 3rd computer unusuable because of this bug doing emerge -kbvu world)
Comment 7 Ghislain Bourgeois 2004-05-05 21:34:02 UTC
With GCC 3.3.3-r3, the compiler works and doesn't give me this error. But, on my desktop, I downgraded binutils since portage wanted to do it to version 2.14.90.0.8-r1 and it gives me this error when emerging anything that needs gcc to compile... On my server, I didn't downgrade it and it works well... Just to say the error might come from binutils.

Hysteric
Comment 8 Mikael 2004-05-06 12:26:13 UTC
i get this error with gcc 3.3.3-r3.
it happend after a `emerge world --deep -u` yesterday (5/5)
can't really remember what was upgraded :-/

cat /etc/env.d/gcc/config
CURRENT=i686-pc-linux-gnu-3.3.3

cat /etc/ld.so.conf | grep gcc-lib
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.3

gcc-config -L
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.3

emerge info
Portage 2.0.50-r6 (default-x86-2004.0, gcc-3.3.3, glibc-2.3.3_pre20040420-r0, 2.6.5-gentoo-r1)
=================================================================
System uname: 2.6.5-gentoo-r1 i686 AMD Athlon(tm) XP 2800+
Gentoo Base System version 1.4.10
Autoconf: sys-devel/autoconf-2.59-r3
Automake: sys-devel/automake-1.8.3
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-march=athlon-xp -pipe -O2"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.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="-march=athlon-xp -pipe -O2"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache sandbox"
GENTOO_MIRRORS="ftp://mirrors.sec.informatik.tu-darmstadt.de/gentoo/ http://ftp.linux.ee/pub/gentoo/distfiles/ http://ftp.du.se/pub/os/gentoo http://gentoo.math.bme.hu"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow X alsa apm arts avi berkdb cdr crypt cups encode foomaticdb gdbm gif gpm gtk2 imlib ipv6 jpeg kde libg++ libwww mad mikmod mmx motif mpeg ncurses nls nptl oggvorbis opengl oss pam pdflib perl png python qt quicktime readline samba sdl slang spell sse ssl svga tcpd truetype x86 xml2 xv zlib"
Comment 9 Corvus 2004-05-12 02:17:08 UTC
workaround to get system back to work like i had to do:

bug:
emerge -uvD portage failed right after upgrading gcc when trying on hashalot.

after that gcc said 

# gcc 
Could not run/locate "gcc"

emerge something said

python: - did not find libc++.so.5
(or something like this)

cool, gcc garbaged, and python -> emerge borked, YIPPEAHYEAH

so found this bug and tried the workaround

1st
change entry in /etc/ld.so.conf
/usr/lib/gcc-lib/i586-pc-linux-gnu/3.2.3
to
/usr/lib/gcc-lib/i586-pc-linux-gnu/3.3.2

2nd
run
# ldconfig

3rd
set /etc/env.d/gcc/config
CURRENT=<arch>-gnu-gcc-3.2.3
to
CURRENT=<arch>-gnu-gcc-3.3.2

4th
set correct LDpath in
/etc/env.d/gcc/<CURRENT>
to
LDPATH=/usr/lib/gcc-lib/<arch>-gnu/3.3.2

5th
do same in 
/etc/env.d/05gcc

6th
run
# env-update

then proceed with normal work

I'd like to know how the info from /etc/env.d/gcc/<CURRENT>
is supposed to get into the normal environment - like /etc/env.d/05gcc

run gcc-config? but with which options?
Comment 10 Corvus 2004-05-12 02:21:13 UTC
i forgot, portage version

Portage 2.0.49-r21 (default-x86-1.4, gcc-3.3.2, glibc-2.3.2-r9, 2.4.20-gentoo-r9)
=================================================================
System uname: 2.4.20-gentoo-r9 i586 AMD-K6tm w/ multimedia extensions
Gentoo Base System version 1.4.3.10
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-Os -march=k6 -pipe"
CHOST="i586-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/bind /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-Os -march=k6 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache sandbox"
GENTOO_MIRRORS="http://laptop.home ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo http://gentoo.oregonstate.edu/ http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="apm crypt foomaticdb gdbm gif gpm gtk2 imlib jpeg libg++ libwww lprng mad mikmod motif mpeg mysql ncurses nls oggvorbis oss pam pdflib perl png python readline slang ssl tcpd x86 xml2 zlib"
Comment 11 Julien De Groote 2004-08-13 13:51:35 UTC
Hi 

I got the exact same error twice today
I am freshly setting up a new machine and I followed the handbook to the lettre. I tried setting up distcc to be used during bootstrap but it didn't work. 
Then I tried to bootstrap b/c I thought this was related to distcc but ...

this is what I get when bootstrapping : 

# --- cut here
checking whether make sets $(MAKE)... yes
checking for i686-pc-linux-gnu-strip... no
checking for strip... strip
checking for i686-pc-linux-gnu-gcc... gcc
checking for C compiler default output... configure: error: C compiler cannot create executables
See `config.log' for more details.
configure: error: /bin/sh './configure' failed for autoconf-lib-link

!!! ERROR: sys-devel/gettext-0.12.1 failed.
!!! Function econf, Line 362, Exitcode 1
!!! econf failed
# --- cut here

thanks for helping
Comment 12 Julien De Groote 2004-08-13 14:04:01 UTC
nevermind. mispelled a word
sorry
Comment 13 Colin Kushnier 2004-08-20 06:06:21 UTC
Platform: x86, LiveCD: 2004.2
While attempting to perform a stage1 install and bootstrap, I have run into this issue and am unable to continue unless a workaround is known (there must be others also affected?).

My experience is identical to that of user who provided comment #11, I was following the handbook doing a first-time install, attempted to emerge distcc and received the error:

checking for C compiler default output... configure: error: C compiler cannot create executables
See `config.log' for more details.

!!! ERROR: sys-devel/distcc-2.13-r1 failed.
!!! Function econf, Line 362, Exitcode 77
!!! econf failed


Giving up on distcc, when I reached the steps:
# cd /usr/portage
# scripts/bootstrap.sh -f 
# scripts/bootstrap.sh

The error was similar:


checking for C compiler default output... configure: error: C compiler cannot create executables
See `config.log' for more details.
configure: error: /bin/sh './configure' failed for autoconf-lib-link

!!! ERROR: sys-devel/gettext-0.12.1 failed.
!!! Function econf, Line 362, Exitcode 1
!!! econf failed


Is there a workaround for this? Hoping to get my new gentoo box farther along in the install process to play around with rather than giving up and rebooting.
Comment 14 Reimo Geerts 2004-08-20 13:33:59 UTC
I'm having the same problem as user who posted comment 11 also, but on a AMD64 install.
ie my error reads:
# --- cut here
checking whether make sets $(MAKE)... yes
checking for x86-64-pc-linux-gnu-strip... no
checking for strip... strip
checking for x86-64-pc-linux-gnu-gcc... gcc
checking for C compiler default output... configure: error: C compiler cannot create executables
See `config.log' for more details.
configure: error: /bin/sh './configure' failed for autoconf-lib-link

!!! ERROR: sys-devel/gettext-0.12.1-r1 failed.
!!! Function econf, Line 362, Exitcode 1
!!! econf failed
# --- cut here

Hope there is someone who can help
Comment 15 Colin Kushnier 2004-08-20 18:16:53 UTC
In my case I found something that seemed to work;

Upon inspecting the contents of "config.log" (I was getting the same error for both distcc and bootstrapping so I the one I looked at was somewhere like /var/tmp/portage/distcc-2.13-r1/work/distcc-2.13-r1/)
seemed to indicate that the installed version of gcc (3.3.3 something) was producing an error on having -mtune=pentium3 (in my case) specified in /etc/make.conf ,
 The gcc documentation page I was referring to in order to specify the options for /etc/make.conf gave the definitions for -mtune=cpu-type and -march=cpu-type to be similar (I understood the difference, but specified both knowing it to be a bit redundant but not thinking it would hurt).

So in short, I edited /etc/make.conf to remove the option -mtune=pentium3 (in my case) and after that emerging both distcc and the bootstrap process worked correctly.

It would appear that at least as of gcc 3.3.3 the -mtune option is considered deprecated and will result in an error being thrown which will halt configure scripts.

If anyone else has the same experience would you mind posting details?
Comment 16 Reimo Geerts 2004-08-22 01:24:03 UTC
update - my bad.
I intitally used the stage 1 tarball of the live CD (2004.1), since tried again, using the latest tarball(2004.2) of the web, and the bootstrap seems to be working now - fingers crossed.  Will update again if it fails.
Comment 17 Ole Tange 2004-09-18 03:38:40 UTC
The problem is gone in GCC-3.3.4. I suggest closing this bug.
Comment 18 Alexander Gabert (RETIRED) gentoo-dev 2004-09-23 19:24:05 UTC
yes