On a 32-bit system, using the toolchain from the hardened-dev overlay, glibc-2.11 fails to compile with gcc-4.4.2-r1 if the later is compiled with fortran support. Linking dies with an undefined reference to `__stack_chk_fail_local'. Reproducible: Always Steps to Reproduce: 1.Add "fortran" to the USE flags in /etc/make.conf 2.Emerge gcc-4.4.2-r1 3.Emerge glibc-2.11 Actual Results: Emerging glibc-2.11 fails with undefined reference to `__stack_chk_fail_local' in several functions: _dl_initial_error_catch_tsd rtld_lock_default_lock_recursive rtld_lock_default_unlock_recursive lookup_doit dlmopen_doit Expected Results: glibc-2.11 should compile and merge properly. On the amd64 arch, compiling glibc-2.11 also fails when using gcc-4.4.2-r1 if USE="fortran" is set, but a different terminal error occurs.
Here's emerge --info Portage 2.1.6.13 (hardened/linux/x86/10.0, gcc-4.4.2, glibc-2.10.1-r0, 2.6.28-hardened-r9 i686) ================================================================= System uname: Linux-2.6.28-hardened-r9-i686-AMD_Phenom-tm-_II_X4_965_Processor-with-gentoo-1.12.13 Timestamp of tree: Sat, 21 Nov 2009 08:00:01 +0000 app-shells/bash: 4.0_p28 dev-lang/python: 2.6.2-r1 sys-apps/baselayout: 1.12.13 sys-apps/sandbox: 1.6-r2 sys-devel/autoconf: 2.63-r1 sys-devel/automake: 1.10.2 sys-devel/binutils: 2.20 sys-devel/gcc-config: 1.4.1 sys-devel/libtool: 2.2.6a virtual/os-headers: 2.6.27-r2 ACCEPT_KEYWORDS="x86" CBUILD="i686-pc-linux-gnu" CFLAGS="-O2 -march=i686 -pipe" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d" CXXFLAGS="-O2 -march=i686 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch" GENTOO_MIRRORS="ftp://192.168.100.9/pub/gentoo" LDFLAGS="-Wl,-O1" MAKEOPTS="-j3" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage/layman/hardened-development" SYNC="rsync://192.168.100.7/portage" USE="acl berkdb bzip2 cli cracklib crypt cups dri fortran gdbm gpm hardened iconv modules mudflap ncurses nls nptl nptlonly openmp pam pcre perl pic pppd python readline reflection session spl ssl sysfs tcpd urandom x86 xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="apm ark chips cirrus cyrix dummy fbdev glint i128 i740 imstt intel mach64 mga neomagic nsc nv r128 radeon rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga trident tseng v4l vesa vga via vmware voodoo" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Here's the error message i686-pc-linux-gnu-gcc -Wl,-O1 -nostdlib -nostartfiles -r -o /var/tmp/portage/sys-libs/glibc-2.11/work/build-default-i686-pc-linux-gnu-nptl/elf/librtld.os '-Wl,-(' /var/tmp/portage/sys-libs/glibc-2.11/work/build-default-i686-pc-linux-gnu-nptl/elf/dl-allobjs.os /var/tmp/portage/sys-libs/glibc-2.11/work/build-default-i686-pc-linux-gnu-nptl/elf/rtld-libc.a -lgcc '-Wl,-)' \ -Wl,-Map,/var/tmp/portage/sys-libs/glibc-2.11/work/build-default-i686-pc-linux-gnu-nptl/elf/librtld.os.map i686-pc-linux-gnu-gcc -Wl,-O1 -nostdlib -nostartfiles -shared -Wl,-z,now \ -Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both -Wl,-z,defs -Wl,--verbose 2>&1 | \ LC_ALL=C \ sed -e '/^=========/,/^=========/!d;/^=========/d' \ -e 's/\. = .* + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' \ > /var/tmp/portage/sys-libs/glibc-2.11/work/build-default-i686-pc-linux-gnu-nptl/elf/ld.so.lds i686-pc-linux-gnu-gcc -Wl,-O1 -nostdlib -nostartfiles -shared -o /var/tmp/portage/sys-libs/glibc-2.11/work/build-default-i686-pc-linux-gnu-nptl/elf/ld.so \ -Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both -Wl,-z,defs -Wl,-z,now \ /var/tmp/portage/sys-libs/glibc-2.11/work/build-default-i686-pc-linux-gnu-nptl/elf/librtld.os -Wl,--version-script=/var/tmp/portage/sys-libs/glibc-2.11/work/build-default-i686-pc-linux-gnu-nptl/ld.map \ -Wl,-soname=ld-linux.so.2 -T /var/tmp/portage/sys-libs/glibc-2.11/work/build-default-i686-pc-linux-gnu-nptl/elf/ld.so.lds /var/tmp/portage/sys-libs/glibc-2.11/work/build-default-i686-pc-linux-gnu-nptl/elf/librtld.os: In function `_dl_initial_error_catch_tsd': (.text+0xa6): undefined reference to `__stack_chk_fail_local' /var/tmp/portage/sys-libs/glibc-2.11/work/build-default-i686-pc-linux-gnu-nptl/elf/librtld.os: In function `rtld_lock_default_lock_recursive': rtld.c:(.text+0xd8): undefined reference to `__stack_chk_fail_local' /var/tmp/portage/sys-libs/glibc-2.11/work/build-default-i686-pc-linux-gnu-nptl/elf/librtld.os: In function `rtld_lock_default_unlock_recursive': rtld.c:(.text+0x108): undefined reference to `__stack_chk_fail_local' /var/tmp/portage/sys-libs/glibc-2.11/work/build-default-i686-pc-linux-gnu-nptl/elf/librtld.os: In function `lookup_doit': rtld.c:(.text+0x193): undefined reference to `__stack_chk_fail_local' /var/tmp/portage/sys-libs/glibc-2.11/work/build-default-i686-pc-linux-gnu-nptl/elf/librtld.os: In function `dlmopen_doit': rtld.c:(.text+0x21c): undefined reference to `__stack_chk_fail_local' /var/tmp/portage/sys-libs/glibc-2.11/work/build-default-i686-pc-linux-gnu-nptl/elf/librtld.os:rtld.c:(.text+0x830): more undefined references to `__stack_chk_fail_local' follow /usr/lib/gcc/i686-pc-linux-gnu/4.4.2/../../../../i686-pc-linux-gnu/bin/ld: /var/tmp/portage/sys-libs/glibc-2.11/work/build-default-i686-pc-linux-gnu-nptl/elf/ld.so: hidden symbol `__stack_chk_fail_local' isn't defined /usr/lib/gcc/i686-pc-linux-gnu/4.4.2/../../../../i686-pc-linux-gnu/bin/ld: final link failed: Nonrepresentable section on output collect2: ld returned 1 exit status make[2]: *** [/var/tmp/portage/sys-libs/glibc-2.11/work/build-default-i686-pc-linux-gnu-nptl/elf/ld.so] Error 1 make[2]: Leaving directory `/var/tmp/portage/sys-libs/glibc-2.11/work/glibc-2.11/elf' make[1]: *** [elf/subdir_lib] Error 2 make[1]: Leaving directory `/var/tmp/portage/sys-libs/glibc-2.11/work/glibc-2.11' make: *** [all] Error 2
I should emphasis that this problem is localized to the "fortran" USE flag. Taking it out avoids the problem.
Here's the emerge --info for the amd64 system ortage 2.1.6.13 (hardened/linux/amd64/10.0, gcc-4.4.2, glibc-2.11-r0, 2.6.28-hardened-r9 x86_64) ================================================================= System uname: Linux-2.6.28-hardened-r9-x86_64-AMD_Phenom-tm-_II_X4_965_Processor-with-gentoo-1.12.13 Timestamp of tree: Sat, 21 Nov 2009 08:00:01 +0000 app-shells/bash: 4.0_p28 dev-lang/python: 2.6.2-r1 dev-util/cmake: 2.6.4 sys-apps/baselayout: 1.12.13 sys-apps/sandbox: 1.6-r2 sys-devel/autoconf: 2.63-r1 sys-devel/automake: 1.10.2 sys-devel/binutils: 2.20 sys-devel/gcc-config: 1.4.1 sys-devel/libtool: 2.2.6a virtual/os-headers: 2.6.27-r2 ACCEPT_KEYWORDS="amd64" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d" CXXFLAGS="-O2 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch" GENTOO_MIRRORS="ftp://192.168.100.9/pub/gentoo" LDFLAGS="-Wl,-O1" MAKEOPTS="-j3" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage/layman/hardened-development" SYNC="rsync://192.168.100.7/portage" USE="acl amd64 berkdb bzip2 cli cracklib crypt cups dri fortran gdbm gpm hardened iconv justify mmx modules mudflap multilib ncurses nls nptl nptlonly openmp pam pcre perl pic pppd python readline reflection session spl sse sse2 ssl sysfs tcpd urandom xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nv r128 radeon savage sis tdfx trident vesa vga via vmware voodoo" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Here's the terminal error on the amd64 system PP='x86_64-pc-linux-gnu-gcc -E -x c-header' /var/tmp/portage/sys-libs/glibc-2.11/work/build-amd64-x86_64-pc-linux-gnu-nptl/elf/ld-linux-x86-64.so.2 --library-path /var/tmp/portage/sys-libs/glibc-2.11/work/build-amd64-x86_64-pc-linux-gnu-nptl:/var/tmp/portage/sys-libs/glibc-2.11/work/build-amd64-x86_64-pc-linux-gnu-nptl/math:/var/tmp/portage/sys-libs/glibc-2.11/work/build-amd64-x86_64-pc-linux-gnu-nptl/elf:/var/tmp/portage/sys-libs/glibc-2.11/work/build-amd64-x86_64-pc-linux-gnu-nptl/dlfcn:/var/tmp/portage/sys-libs/glibc-2.11/work/build-amd64-x86_64-pc-linux-gnu-nptl/nss:/var/tmp/portage/sys-libs/glibc-2.11/work/build-amd64-x86_64-pc-linux-gnu-nptl/nis:/var/tmp/portage/sys-libs/glibc-2.11/work/build-amd64-x86_64-pc-linux-gnu-nptl/rt:/var/tmp/portage/sys-libs/glibc-2.11/work/build-amd64-x86_64-pc-linux-gnu-nptl/resolv:/var/tmp/portage/sys-libs/glibc-2.11/work/build-amd64-x86_64-pc-linux-gnu-nptl/crypt:/var/tmp/portage/sys-libs/glibc-2.11/work/build-amd64-x86_64-pc-linux-gnu-nptl/nptl /var/tmp/portage/sys-libs/glibc-2.11/work/build-amd64-x86_64-pc-linux-gnu-nptl/sunrpc/rpcgen -Y ../scripts -c rpcsvc/bootparam_prot.x -o /var/tmp/portage/sys-libs/glibc-2.11/work/build-amd64-x86_64-pc-linux-gnu-nptl/sunrpc/xbootparam_prot.T make[2]: *** [/var/tmp/portage/sys-libs/glibc-2.11/work/build-amd64-x86_64-pc-linux-gnu-nptl/sunrpc/xbootparam_prot.stmp] Segmentation fault make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory `/var/tmp/portage/sys-libs/glibc-2.11/work/glibc-2.11/sunrpc' make[1]: *** [sunrpc/others] Error 2 make[1]: Leaving directory `/var/tmp/portage/sys-libs/glibc-2.11/work/glibc-2.11' make: *** [all] Error 2
Some way it don't inherit the flag-o-matic.eclass from the overlay with the fix for the USE="fortran" Can you post the eclass-debug.log?
Thanks Magnus, you're right, it was not inheriting the right flags --- that was clear in the 32-bit error. The 64-bit was a bit more obscure. Nonetheless both bugs were fixed by including /etc/portage/repos.conf as you suggested in IRC. I used just the following lines [DEFAULT] eclass-overrides = hardened-dev BTW, there are a few errors in http://forums.gentoo.org/viewtopic-t-705939.html where this is discussed: 1. You need repos.conf even with portage-2.1.6.13, not just >=sys-apps/portage-2.2 2. The name of the file is repos.conf not repo.conf 3. eclass-overrides = secure does not work 4. eclass-overrides = hardened-development also does not work Both 3 and 4 lead to Unavailable repository 'secure' referenced by eclass-overrides entry in '/etc/portage/repos.conf' or Unavailable repository 'hardened-development' referenced by eclass-overrides entry in '/etc/portage/repos.conf' I know we had the name issue with hardened-dev and hardened-development names. I should point out that I included the overlay with layman whereas that forum post suggests using git directly, but I doubt that makes a difference.
people shouldnt have to rely on random external overlays for packages to work. if the tree isnt up-to-date, then it needs to be fixed.
In-tree hardened gcc-4 is not affected (ok not entirely true, stack protector slips in with gcc-3.4.x but doesn't fail the build) as we do not have SSP-by-default. The patch to flag-o-matic will be added prior to enabling SSP-by-default in gcc-4.x.
same as bug 293721.
thanks for the explanation
*** This bug has been marked as a duplicate of bug 293721 ***