Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 57169 - Building libstdc++-v3 fails with gcc-3.4.1-r1
Summary: Building libstdc++-v3 fails with gcc-3.4.1-r1
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High critical (vote)
Assignee: Please assign to toolchain
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-15 05:57 UTC by Michael Schneider
Modified: 2004-10-02 12:15 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 Michael Schneider 2004-07-15 05:57:19 UTC
I just tried bootstrapping a system with gcc-3.4.1-r1 and the latest glibc.  Everything emerged fine, except for sys-libs/libstdc++-v3.  It failed with the error at the bottom of this report.  I tried removing -fstack-protector from my CFLAGS, but it did not help.  My CFLAGS do include -mtune=pentium4 (to work around some other gcc/glibc bugs), but the ebuild seems to be correctly filtering that.  My emerge info is:

michael@shrimp libstdc++-v3 $ emerge  info
Portage 2.0.50-r9 (default-x86-2004.0, gcc-3.4.1, glibc-2.3.4.20040619-r0, 2.6.7
)
=================================================================
System uname: 2.6.7 i686 Intel(R) Pentium(R) M processor 1300MHz
Gentoo Base System version 1.5.1
Autoconf: sys-devel/autoconf-2.59-r4
Automake: sys-devel/automake-1.8.5-r1
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-O2 -march=pentium3 -mtune=pentium4 -pipe -w -s -fomit-frame-pointer -fstack-protector"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3/s
hare/config /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=pentium3 -pipe -w -s -fomit-frame-pointer -fstack-protector
 -fvisibility-inlines-hidden"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache digest sandbox sfperms userpriv usersandbox"
GENTOO_MIRRORS="http://gentoo.ccccom.com ftp://gentoo.ccccom.com http://mirror.d
atapipe.net/gentoo http://mirror.tucdemonic.org/gentoo/"
MAKEOPTS=""
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="X acpi alsa berkdb crypt cups dga dvd dvdr flac gnome gnutls gpm gstreamer 
gtk2 gtkhtml hardened jpeg kerberos ldap mad ncurses nptl oggvorbis opengl pam p
erl pic png python readline samba spell sse ssl tcpd tiff truetype x86 xinerama 
xv zlib"

    Here's the compile log

if [ -f ranlib ] || ( [ i686-pc-linux-gnu = i686-pc-linux-gnu ] && [ -f /usr/bin/ranlib -o -f /bin/ranlib ] ) ; then \
  ranlib ./libgcc.a ; \
else true; fi;
make[2]: Leaving directory `/var/tmp/portage/libstdc++-v3-3.3.3-r1/work/build/gcc'
make[1]: Leaving directory `/var/tmp/portage/libstdc++-v3-3.3.3-r1/work/build/gcc'
Configuring in i686-pc-linux-gnu/libiberty
creating cache ../config.cache
checking whether to enable maintainer-specific portions of Makefiles... no
checking for makeinfo... makeinfo
checking for perl... perl
checking host system type... i686-pc-linux-gnu
checking build system type... i686-pc-linux-gnu
checking for ar... ar
checking for ranlib... ranlib
checking for gcc...  /var/tmp/portage/libstdc++-v3-3.3.3-r1/work/build/gcc/xgcc -B/var/tmp/portage/libstdc++-v3-3.3.3-r1/work/build/gcc/ -B/usr/i686-pc-linux-gnu/bin/ -B/usr/i686-pc-linux-gnu/lib/ -isystem /usr/i686-pc-linux-gnu/include
checking whether we are using GNU C... yes
checking whether  /var/tmp/portage/libstdc++-v3-3.3.3-r1/work/build/gcc/xgcc -B/var/tmp/portage/libstdc++-v3-3.3.3-r1/work/build/gcc/ -B/usr/i686-pc-linux-gnu/bin/ -B/usr/i686-pc-linux-gnu/lib/ -isystem /usr/i686-pc-linux-gnu/include accepts -g... yes
checking whether  /var/tmp/portage/libstdc++-v3-3.3.3-r1/work/build/gcc/xgcc -B/var/tmp/portage/libstdc++-v3-3.3.3-r1/work/build/gcc/ -B/usr/i686-pc-linux-gnu/bin/ -B/usr/i686-pc-linux-gnu/lib/ -isystem /usr/i686-pc-linux-gnu/include and cc understand -c and -o together... yes
checking for POSIXized ISC... no
checking for working const... no
checking for inline... no
checking for a BSD compatible install... /bin/install -c
Appending /var/tmp/portage/libstdc++-v3-3.3.3-r1/work/gcc-3.3.3/libiberty/../config/mh-x86pic to xhost-mkfrag
checking how to run the C preprocessor...  /var/tmp/portage/libstdc++-v3-3.3.3-r1/work/build/gcc/xgcc -B/var/tmp/portage/libstdc++-v3-3.3.3-r1/work/build/gcc/ -B/usr/i686-pc-linux-gnu/bin/ -B/usr/i686-pc-linux-gnu/lib/ -isystem /usr/i686-pc-linux-gnu/include -E
checking for sys/file.h... yes
checking for sys/param.h... yes
checking for limits.h... yes
checking for stdlib.h... yes
checking for malloc.h... yes
checking for string.h... yes
checking for unistd.h... yes
checking for strings.h... yes
checking for sys/time.h... yes
checking for time.h... yes
checking for sys/resource.h... yes
checking for sys/stat.h... yes
checking for sys/mman.h... yes
checking for fcntl.h... yes
checking for alloca.h... yes
checking for sys/pstat.h... no
checking for sys/sysmp.h... no
checking for sys/sysinfo.h... yes
checking for machine/hal_sysinfo.h... no
checking for sys/table.h... no
checking for sys/sysctl.h... yes
checking for sys/systemcfg.h... no
checking for sys/wait.h that is POSIX.1 compatible... no
checking whether time.h and sys/time.h may both be included... no
checking whether errno must be declared... yes
checking for ANSI C header files... no
checking for uintptr_t... no
checking for pid_t... yes
checking whether the C compiler ( /var/tmp/portage/libstdc++-v3-3.3.3-r1/work/build/gcc/xgcc -B/var/tmp/portage/libstdc++-v3-3.3.3-r1/work/build/gcc/ -B/usr/i686-pc-linux-gnu/bin/ -B/usr/i686-pc-linux-gnu/lib/ -isystem /usr/i686-pc-linux-gnu/include -O2 -march=pentium3 -fomit-frame-pointer -fstack-protector -O2 -pipe ) works... no
configure: error: installation or configuration problem: C compiler cannot create executables.
make: *** [configure-target-libiberty] Error 1

!!! ERROR: sys-libs/libstdc++-v3-3.3.3-r1 failed.
!!! Function src_compile, Line 164, Exitcode 2
!!! (no error message) 

Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Michael Schneider 2004-07-15 06:48:54 UTC
I also just installed sys-devel/gcc-3.3.3-r5 (compiled with gcc-3.4.1-r1), switched my gcc-config, and tried compiling libstdc++-v3.  It died in the exact same way.
Comment 2 Travis Tilley (RETIRED) gentoo-dev 2004-07-15 14:52:17 UTC
i've added -fstack-protector to the list of filtered flags, since the xgcc built to bootstrap libstdc++-v3 doesnt support it.
Comment 3 Michael Schneider 2004-07-15 15:33:53 UTC
I tried that as well, when building libstdc++-v3 with both gcc-3.4, and 3.3.  It did not help in either case.  The build failed in the same place both times, as it did in the original report.
Comment 4 Travis Tilley (RETIRED) gentoo-dev 2004-07-15 15:55:52 UTC
did you try with CFLAGS="-O2" CXXFLAGS="-O2"? or did you just edit CFLAGS?
Comment 5 Michael Schneider 2004-07-15 17:25:34 UTC
I tried it two ways.  I edited just CFLAGS (not CXXFLAGS, that I kept as CXXFLAGS=${CFLAGS}) to remove -fstack-protector.  I also edited the ebuild to include the line "filter-flags -fstack-protector" at approx. line 50, along with the other filter-flags statements.  I don't think I had both edits setup at the same time, as I ran about 6-8 tests.
    I noticed that while running it the second way, things were being compiled with -fno-stack-protector, or something similar.  If xgcc won't understand -fstack-protector, it would follow it wouldn't understand -fno-stack-protector as well, correct?
Comment 6 Travis Tilley (RETIRED) gentoo-dev 2004-07-15 17:57:49 UTC
ok, that makes a bit more sense now. when i added filter-flags -fstack-protector i added a filter-flags -fno-stack-protector right after it... mind doing an emerge sync and trying again with this new ebuild?
Comment 7 Michael Schneider 2004-07-15 19:07:00 UTC
Sure.  Probably won't be until tomorrow, but I'll report in when I get things going.

Thanks.
Comment 8 Michael Schneider 2004-07-15 20:17:21 UTC
I've updated my Portage tree, and confirmed that I've got the new ebuild.  It includes the following new lines, correct?

 # xgcc isnt patched with propolice
        filter-flags -fstack-protector
        filter-flags -fno-stack-protector
        filter-flags -fstack-protector-all
        filter-flags -fno-stack-protector-all

        # xgcc isnt patched with the gcc symbol visibility patch
        filter-flags -fvisibility-inlines-hidden
        filter-flags -fvisibility=hidden


Well... I've started the install, and the flag -fno-stack-protector is still showing up in the compile flags during ./configure and at least the first stage compile.  I'd say chances of this failing again are pretty good.  I'll check up on the compile in the morning.
Comment 9 Richard Freeman gentoo-dev 2004-07-16 04:26:11 UTC
I am also having this problem with gcc-3.4.1 on amd64.  GCC 3.3.3 also doesn't work.  

My CFLAGS were "-march=k8 -mtune=k8 -O3 -pipe -fomit-frame-pointer" on 3.4, and "-O2 -pipe -fomit-frame-pointer" on 3.3.

I synced up after the supposed change to the ebuild, and the offending line still reads:

checking whether the C compiler ( /var/tmp/portage/libstdc++-v3-3.3.3-r1/work/build/gcc/xgcc -B/var/tmp/portage/libstdc++-v3-3.3.3-r1/work/build/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 -O2 -O2 -pipe -fno-stack-protector ) works... no
configure: error: installation or configuration problem: C compiler cannot create executables.

We seem to still be getting -fno-stack-protector...
Comment 10 Michael Schneider 2004-07-16 06:17:43 UTC
I've tried compiling gcc with USE="-hardened", with -fstack-protector removed from my CFLAGS at the same time.  ./configure is still spitting the following out:

shrimp root # emerge -uv --deep world
Calculating world dependencies ...done!
>>> emerge (1 of 2) sys-libs/libstdc++-v3-3.3.3-r1 to /
>>> md5 src_uri ;-) gcc-3.3.3.tar.bz2
>>> Unpacking source...
>>> Unpacking gcc-3.3.3.tar.bz2 to /var/tmp/portage/libstdc++-v3-3.3.3-r1/work
 * Patching ${S}/ltmain.sh...
 *   Applying portage-1.4.1.patch...
 *   Applying relink-1.4.0a-GCC3.0-2.patch...
 *   Applying sed-1.4.3.patch...
 *   Applying tmp-1.3.5.patch...
>>> Source unpacked.
~x86
 * CFLAGS=" -O2 -march=pentium4 -pipe -fno-stack-protector"
 * CXXFLAGS=" -O2 -march=pentium4 -pipe"
 * Configuring libstdc++...
Comment 11 Robert Moss (RETIRED) gentoo-dev 2004-07-16 10:29:54 UTC
checking whether the C compiler (gcc  -O2 -fprefetch-loop-arrays -pipe -fno-stack-protector ) works... yes

Curiouser and curiouser...
Comment 12 Travis Tilley (RETIRED) gentoo-dev 2004-07-16 14:06:49 UTC
the fixed ebuild:
ayanami libstdc++-v3 # md5sum libstdc++-v3-3.3.3-r1.ebuild
3004957420eba61ca33636e99e4302f9  libstdc++-v3-3.3.3-r1.ebuild

well... hopefully fixed anyways.
Comment 13 merwan kashouty 2004-07-16 16:29:48 UTC
failed thisa morning but works now... thanks
Comment 14 Michael Schneider 2004-07-16 17:18:17 UTC
heh, looks like we have a winner.  Thanks for the help.  Now onwards to see if I can break anything else.
Comment 15 Alexander Naydenko 2004-07-16 18:17:50 UTC
The same problem :( with new version of ebuild. I've checked it twice, it had to filter out that flag. Here is what I have:

---------------------------------
Configuring in i686-pc-linux-gnu/libiberty
creating cache ../config.cache
checking whether to enable maintainer-specific portions of Makefiles... no
checking for makeinfo... makeinfo
checking for perl... perl
checking host system type... i686-pc-linux-gnu
checking build system type... i686-pc-linux-gnu
checking for ar... ar
checking for ranlib... ranlib
checking for gcc...  /var/tmp/portage/libstdc++-v3-3.3.3-r1/work/build/gcc/xgcc -B/var/tmp/portage/libstdc++-v3-3.3.3-r1/work/build/gcc/ -B/usr/i686-pc-linux-gnu/bin/ -B/usr/i686-pc-linux-gnu/lib/ -isystem /usr/i686-pc-linux-gnu/include
checking whether we are using GNU C... yes
checking whether  /var/tmp/portage/libstdc++-v3-3.3.3-r1/work/build/gcc/xgcc -B/var/tmp/portage/libstdc++-v3-3.3.3-r1/work/build/gcc/ -B/usr/i686-pc-linux-gnu/bin/ -B/usr/i686-pc-linux-gnu/lib/ -isystem /usr/i686-pc-linux-gnu/include accepts -g... yes
checking whether  /var/tmp/portage/libstdc++-v3-3.3.3-r1/work/build/gcc/xgcc -B/var/tmp/portage/libstdc++-v3-3.3.3-r1/work/build/gcc/ -B/usr/i686-pc-linux-gnu/bin/ -B/usr/i686-pc-linux-gnu/lib/ -isystem /usr/i686-pc-linux-gnu/include and cc understand -c and -o together... yes
checking for POSIXized ISC... no
checking for working const... no
checking for inline... no
checking for a BSD compatible install... /bin/install -c
Appending /var/tmp/portage/libstdc++-v3-3.3.3-r1/work/gcc-3.3.3/libiberty/../config/mh-x86pic to xhost-mkfrag
checking how to run the C preprocessor...  /var/tmp/portage/libstdc++-v3-3.3.3-r1/work/build/gcc/xgcc -B/var/tmp/portage/libstdc++-v3-3.3.3-r1/work/build/gcc/ -B/usr/i686-pc-linux-gnu/bin/ -B/usr/i686-pc-linux-gnu/lib/ -isystem /usr/i686-pc-linux-gnu/include -E
checking for sys/file.h... yes
checking for sys/param.h... yes
checking for limits.h... yes
checking for stdlib.h... yes
checking for malloc.h... yes
checking for string.h... yes
checking for unistd.h... yes
checking for strings.h... yes
checking for sys/time.h... yes
checking for time.h... yes
checking for sys/resource.h... yes
checking for sys/stat.h... yes
checking for sys/mman.h... yes
checking for fcntl.h... yes
checking for alloca.h... yes
checking for sys/pstat.h... no
checking for sys/sysmp.h... no
checking for sys/sysinfo.h... yes
checking for machine/hal_sysinfo.h... no
checking for sys/table.h... no
checking for sys/sysctl.h... yes
checking for sys/systemcfg.h... no
checking for sys/wait.h that is POSIX.1 compatible... no
checking whether time.h and sys/time.h may both be included... no
checking whether errno must be declared... yes
checking for ANSI C header files... no
checking for uintptr_t... no
checking for pid_t... yes
checking whether the C compiler ( /var/tmp/portage/libstdc++-v3-3.3.3-r1/work/build/gcc/xgcc -B/var/tmp/portage/libstdc++-v3-3.3.3-r1/work/build/gcc/ -B/usr/i686-pc-linux-gnu/bin/ -B/usr/i686-pc-linux-gnu/lib/ -isystem /usr/i686-pc-linux-gnu/include -O2 -mcpu=pentium4 -fno-stack-protector ) works... no
configure: error: installation or configuration problem: C compiler cannot create executables.
make: *** [configure-target-libiberty] Error 1
----------------------------------
Portage 2.0.50-r9 (default-x86-1.4, gcc-3.4.1, glibc-2.3.4.20040619-r0, 2.6.5-gentoo-r1-nx1)
=================================================================
System uname: 2.6.5-gentoo-r1-nx1 i686 Intel(R) Pentium(R) 4 CPU 3.00GHz
Gentoo Base System version 1.4.15
distcc 2.15 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
Autoconf: sys-devel/autoconf-2.59-r3
Automake: sys-devel/automake-1.8.5-r1
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-O2 -mcpu=pentium4 -pipe -funroll-loops -fno-unit-at-a-time"
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.3/share/config /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -mcpu=pentium4 -pipe -funroll-loops -fno-unit-at-a-time"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs buildpkg ccache fixpackages userpriv"
GENTOO_MIRRORS="http://gentoo.oregonstate.edu http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X aalib acl acpi alsa apm arts audiofile avi berkdb bindist bonobo caps cdr cjk crypt cups curl dga directfb doc dvd dvdr encode esd ethereal fbcon flac foomaticdb gd gdbm gif gnome gphoto2 gpm gstreamer gtk gtk2 gtkhtml icq imagemagick imlib jabber java jikes jpeg kde ldap libg++ libwww mad mikmod mmx motif mozilla mpeg msn mule mysql nas ncurses nls odbc offensive oggvorbis opengl oscar oss pam pda pdflib perl png pnp prelude python qt quicktime readline samba sdl shared slang spell sse ssl svga tcltk tcpd tetex theora tiff truetype unicode usb x86 xml xml2 xmms xv yahoo zlib"
Comment 16 Alexander Naydenko 2004-07-16 19:09:14 UTC
Oops. Sorry, just rsynced again with other server and all works witout any problems.
Comment 17 Travis Tilley (RETIRED) gentoo-dev 2004-07-16 19:16:32 UTC
ok, cool. closing bug :)
Comment 18 Ilya Maykov 2004-10-02 12:15:25 UTC
I ran into a similar problem on a PowerPC system (Aluminum PowerBook). Seems that xgcc doesn't like the -mcpu=G4 flag. Fixed it by stripping the -mcpu flag.

Add the following to the ebuild, in the do_filter_flags() function:

setting="`get-flag mcpu`"
[ ! -z "${setting}" ] && filter-flags -mcpu="${setting}"

Of course this compiles the library without any cpu-specific optimizations, but such is life. This might not be required for all -mcpu flags, but it is certainly required for -mcpu=G4.