i've been testing gcc-3.4.4 on ia64 and hit a bug with db-4.2.x ... the final build proccess errors out like this: ia64-unknown-linux-gnu-g++ -shared -nostdlib /usr/lib/gcc/ia64-unknown-linux-gnu/3.4.4/../../../crti.o /usr/lib/gcc/ia64-unknown-linux-gnu/3.4.4/crtbeginS.o .libs/cxx_db.o .libs/cxx_dbc.o .libs/cxx_dbt.o .libs/cxx_env.o .libs/cxx_except.o .libs/cxx_lock.o .libs/cxx_logc.o .libs/cxx_mpool.o .libs/cxx_txn.o .libs/txn_region.o .libs/txn_stat.o .libs/txn_util.o .libs/xa.o .libs/xa_db.o .libs/xa_map.o -Wl,--rpath -Wl,/usr/lib/gcc/ia64-unknown-linux-gnu/3.4.4 -Wl,--rpath -Wl,/usr/lib/gcc/ia64-unknown-linux-gnu/3.4.4 -L/usr/ia64-unknown-linux-gnu/lib -L/usr/ia64-unknown-linux-gnu/bin -L/usr/lib/gcc/ia64-unknown-linux-gnu/3.4.4 -L/usr/lib/gcc/ia64-unknown-linux-gnu/3.4.4/../../../../ia64-unknown-linux-gnu/lib -L/usr/lib/gcc/ia64-unknown-linux-gnu/3.4.4/../../.. /usr/lib/gcc/ia64-unknown-linux-gnu/3.4.4/libstdc++.so -lm -lc -lgcc_s -lunwind /usr/lib/gcc/ia64-unknown-linux-gnu/3.4.4/crtendS.o /usr/lib/gcc/ia64-unknown-linux-gnu/3.4.4/../../../crtn.o -Wl,-soname -Wl,libdb_cxx-4.2.so -o .libs/libdb_cxx-4.2.so /usr/lib/gcc/ia64-unknown-linux-gnu/3.4.4/../../../../ia64-unknown-linux-gnu/bin/ld: warning: creating a DT_TEXTREL in object. /usr/lib/gcc/ia64-unknown-linux-gnu/3.4.4/../../../../ia64-unknown-linux-gnu/bin/ld: .libs/cxx_env.o: @gprel relocation against dynamic symbol DbEnv::error_stream_ /usr/lib/gcc/ia64-unknown-linux-gnu/3.4.4/../../../../ia64-unknown-linux-gnu/bin/ld: .libs/cxx_env.o: @gprel relocation against dynamic symbol DbEnv::error_stream_ /usr/lib/gcc/ia64-unknown-linux-gnu/3.4.4/../../../../ia64-unknown-linux-gnu/bin/ld: final link failed: Nonrepresentable section on output collect2: ld returned 1 exit status make: *** [libdb_cxx-4.2.la] Error 1 the reason is because configure failed to properly detect PIC support: checking if ia64-unknown-linux-gnu-g++ PIC flag -fPIC works... no checking if ia64-unknown-linux-gnu-g++ supports -c -o file.o... no and if we read the config.log: configure:12373: checking if ia64-unknown-linux-gnu-g++ PIC flag -fPIC works configure:12391: ia64-unknown-linux-gnu-g++ -c -O2 -pipe -fhandle-exceptions -D_GNU_SOURCE -D_REENTRANT -fPIC -DPIC conftest.cc >&5 cc1plus: warning: -fhandle-exceptions has been renamed -fexceptions (and is now on by default) cc1plus: warning: -fhandle-exceptions has been renamed -fexceptions (and is now on by default) configure:12395: $? = 0 configure:12406: result: no configure:12430: checking if ia64-unknown-linux-gnu-g++ supports -c -o file.o configure:12458: ia64-unknown-linux-gnu-g++ -c -O2 -pipe -fhandle-exceptions -D_GNU_SOURCE -D_REENTRANT -o out/conftest2.o conftest.cc >&5 cc1plus: warning: -fhandle-exceptions has been renamed -fexceptions (and is now on by default) cc1plus: warning: -fhandle-exceptions has been renamed -fexceptions (and is now on by default) configure:12462: $? = 0 configure:12479: result: no one solution would be to change -fhandle-exceptions to -fexceptions in dist/configure when dealing with >=gcc-3.4.4 Portage 2.0.51.22-r1 (default-linux/ia64/2004.3, gcc-3.4.4, glibc-2.3.5-r0, 2.6.9-rc1 ia64) ================================================================= System uname: 2.6.9-rc1 ia64 Gentoo Base System version 1.6.12 distcc 2.18.3 ia64-unknown-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] ccache version 2.4 [enabled] dev-lang/python: 2.3.5 sys-apps/sandbox: 1.2.8 sys-devel/autoconf: 2.13, 2.59-r6 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.5 sys-devel/binutils: 2.15.92.0.2-r8, 2.15.97, 2.16-r1, 2.16.90.0.1, 2.16.90.0.2, 2.16.90.0.3 sys-devel/libtool: 1.5.18 virtual/os-headers: 2.6.11 ACCEPT_KEYWORDS="ia64 ~ia64" AUTOCLEAN="yes" CBUILD="ia64-unknown-linux-gnu" CFLAGS="-O2 -pipe" CHOST="ia64-unknown-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/texmf/web2c /etc/env.d" CXXFLAGS="-O2 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig ccache distlocks noauto nodoc noinfo noman sandbox sfperms" GENTOO_MIRRORS="ftp://gentoo.oregonstate.edu/pub/gentoo" MAKEOPTS="-j1" PKGDIR="/root/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="ia64 X aalib alsa berkdb bitmap-fonts cdr crypt cscope cups curl eds encode esd fam flac foomaticdb fortran gd gif gnome gpm gstreamer gtk gtk2 imagemagick imlib ipv6 jpeg kde libg++ libwww mikmod motif mozilla mysql ncurses ogg oggvorbis opengl oss pam pdflib perl png postgres python qt quicktime readline ruby samba scanner sdl spell ssl tcltk tcpd tetex tiff truetype truetype-fonts type1-fonts vorbis xine xml2 xmms xv zlib userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS
There is a previous test that should check whether -fhandle-exceptions is needed. As -fexceptions is on by default, there should not be a -fhandle-exceptions in the compilation command
Perhaps could you attach a complete config.log?
i know there's a check to add such a thing to CXXFLAGS and that's the problem the parameter is still valid (gcc just warns, it doesnt error), but the fact that it warns is what is killing the PIC check i posted the relevant portion of the config.log ... if you wish to see the check for -fhandle-exceptions then there's nothing to show ... the check succeeds because the exit status of gcc is 0 so the configure process adds it to CXXFLAGS if you do something like this in the ebuild, it should work nicely: [[ $(gcc-version) == "3.4" && $(gcc-micro-version) -gt 3 ]] && sed -i -e s:-fhandle-exceptions:-fexceptions: ../dist/configure
I looked at the configure script, and it doesn't use -fhandle-exceptions for any gcc version in 3.x. Could you give the output of "gcc --version"? It could be that the crappy case statement used for checking the gcc version is broken.
ah yes, the case statement is the source of our problems $ gcc --version gcc (GCC) 3.4.4 (Gentoo 3.4.4, ssp-3.4.4-1.0, pie-8.7.8) the case statement is matching the ssp version string :/ *-1.* matches ssp-3.4.4-1.0 using '-dumpversion' instead of '--version' would be a lot more sane i think
Any idea whether this would work on 2.9 compilers?
I just upgraded to gcc-3.4.4 on AMD64, and when doing an "emerge -e system" run into the equivalent problem when linking db-4.2.52_p2: /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/../../../../x86_64-pc-linux-gnu/bin/ld: .libs/cxx_db.o: relocation R_X86_64_32S against `vtable for Db' can not be used when making a shared object; recompile with -fPIC .libs/cxx_db.o: could not read symbols: Bad value emerge --info Portage 2.0.51.22-r1 (default-linux/amd64/2005.0, gcc-3.4.4, glibc-2.3.5-r0, 2.6.12-rc4-nitro1 x86_64) ================================================================= System uname: 2.6.12-rc4-nitro1 x86_64 AMD Athlon(tm) 64 Processor 3000+ Gentoo Base System version 1.6.12 ccache version 2.4 [enabled] dev-lang/python: 2.3.5, 2.4.1 sys-apps/sandbox: 1.2.8 sys-devel/autoconf: 2.13, 2.59-r6 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.5 sys-devel/binutils: 2.16-r1 sys-devel/libtool: 1.5.18 virtual/os-headers: 2.6.11-r1 ACCEPT_KEYWORDS="amd64 ~amd64" AUTOCLEAN="yes" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=athlon64 -O2 -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /var/qmail/alias /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/texmf/web2c /etc/env.d" CXXFLAGS="-march=athlon64 -O2 -pipe -fvisibility-inlines-hidden" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig ccache distlocks sandbox sfperms strict" GENTOO_MIRRORS="http://gentoo.osuosl.org/ http://mirror.clarkson.edu/pub/distributions/gentoo/ http://mirrors.acm.cs.rpi.edu/gentoo/" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage /usr/local/bmg-main /usr/local/gentoo.de" SYNC="rsync://rsync.us.gentoo.org/gentoo-portage" USE="amd64 X aac aalib acpi alsa bash-completion berkdb bitmap-fonts cdr crypt cups curl dbus eds esd flac font-server foomaticdb fortran gd gdbm gif gnome gpm gstreamer gtk hal howl imagemagick imlib ipv6 java jp2 jpeg libwww lzw lzw-tiff mad maildir mono motif mozilla mp3 ncurses nls nptl ogg oggvorbis opengl oss pam perl pic png python qt readline ruby sdl speex sqlite ssl tcltk tcpd tetex theora tiff truetype truetype-fonts type1-fonts usb userlocales vorbis xine xml xml2 xmms xpm xrandr xv zlib userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, MAKEOPTS
well we've neved had a 2.9.x compiler in portage, just 2.95.3 ... the case statement is not written such that it'd match 2.##.x, just 2.#.x ...
*** Bug 94766 has been marked as a duplicate of this bug. ***
I've committed new versions of 4.2 and 4.3 that replace gcc --version by gcc -dumpversion
thanks, just synced and everythings working now