I was trying to re-emerge gcc in anticipation of upgrading to the 2005.0 profile and encountered this problem. 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-3.4.3-r1/work/build/gcc/xgcc -B/var/tmp/portage/gcc-3.4.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 -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-3.4.3-r1/work/build' make: *** [profiledbootstrap] Error 2 !!! ERROR: sys-devel/gcc-3.4.3-r1 failed. !!! Function gcc_do_make, Line 1133, Exitcode 2 !!! emake failed with profiledbootstrap Reproducible: Always Steps to Reproduce: 1. USE="multilib" emerge --oneshot gcc Actual Results: Merge works for a while Fails on configure Expected Results: Built Correctly emerge info Password: Portage 2.0.51.19 (default-linux/amd64/2004.3, gcc-3.4.3, glibc-2.3.4.20041102-r1, 2.6.11-hardened-r1 x86_64) ================================================================= System uname: 2.6.11-hardened-r1 x86_64 AMD Athlon(tm) 64 Processor 2800+ Gentoo Base System version 1.4.16 Python: dev-lang/python-2.3.4-r1 [2.3.4 (#1, Apr 13 2005, 00:48:37)] distcc 2.18.3 x86_64-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] ccache version 2.3 [enabled] dev-lang/python: 2.3.4-r1 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.4 sys-devel/binutils: 2.15.92.0.2-r7 sys-devel/libtool: 1.5.14 virtual/os-headers: 2.6.8.1-r4 ACCEPT_KEYWORDS="amd64" AUTOCLEAN="yes" CFLAGS="-O2 -march=athlon64 -ffast-math -funit-at-a-time -ftracer -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O2 -march=athlon64 -ffast-math -funit-at-a-time -ftracer -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs autoconfig ccache distlocks sandbox" GENTOO_MIRRORS="ftp://gentoo.mirrors.tds.net/gentoo ftp://ftp.ussg.iu.edu/pub/linux/gentoo http://gentoo.osuosl.org/ http://gentoo.netnitco.net ftp://pandemonium.tiscali.de/pub/gentoo/" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/gp" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="amd64 / X aac aalib acpi alsa apache2 arts avi bash-completion berkdb bitmap-fonts cdparanoia cdr clamav crypt cups curl divx4linux dlloader dvd encode esd f77 faad fam flac flash font-server foomatic foomaticdb fortran gcj gd gdbm gif gimpprint gnome gpm gtk gtk2 hardened imagemagick imap imlib insults ipv6 jack java jp2 jpeg kde ldap libwww lzw lzw-tiff mad maildir matroska mbox mikmod monkey motif mozilla mp3 mpeg multilib mysql ncurses nls nptl objc offensive oggvorbis opengl oss pam pdflib perl png povray ppds python qt readline samba sasl sdl slang snmp speex spell ssl tcltk tcpd theora tiff truetype truetype-fonts type1-fonts usb userlocales xine xml2 xmms xpm xrandr xv xvid zlib" Unset: ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS
attach ALL of the config.log's from the build dir find /var/tmp/portage/gcc-3.4.3-r1/work/build -name config.log
Created attachment 56413 [details] /var/tmp/portage/gcc-3.4.3-r1/work/build/32/zlib/config.log
Created attachment 56414 [details] /var/tmp/portage/gcc-3.4.3-r1/work/build/gcc/config.log
Created attachment 56415 [details] /var/tmp/portage/gcc-3.4.3-r1/work/build/intl/config.log
Created attachment 56416 [details] /var/tmp/portage/gcc-3.4.3-r1/work/build/zlib/config.log
Created attachment 56417 [details] /var/tmp/portage/gcc-3.4.3-r1/work/build/libiberty/config.log
Created attachment 56418 [details] /var/tmp/portage/gcc-3.4.3-r1/work/build/x86_64-pc-linux-gnu/32/libstdc++-v3/config.log
Created attachment 56420 [details] /var/tmp/portage/gcc-3.4.3-r1/work/build/x86_64-pc-linux-gnu/libstdc++-v3/config.log
Created attachment 56421 [details] /var/tmp/portage/gcc-3.4.3-r1/work/build/fastjar/config.log
Created attachment 56422 [details] /var/tmp/portage/gcc-3.4.3-r1/work/build/config.log
configure:2447: checking whether the C compiler works configure:2453: ./a.out ./a.out: error while loading shared libraries: /lib32/tls/libc.so.6: cannot apply additional memory protection after relocation: Permission denied configure:2456: $? = 127 configure:2465: error: cannot run C compiled programs. wow that's a weird error ... ever see that one before eradicator ?
need to reopen ...
Spanky, this looks like kernel bug - search http://gentoo.kems.net/gentoo-x86-portage/sys-kernel/hardened-dev-sources/ChangeLog for this error.
hardened team: any thoughts on my last comment ?
I've seen that error a few times. It's either the result of the flawed design of PT_GNU_STACK. Or perhaps something built with -z relro.. Would need to see a scanelf -a/readelf -e
Not to badger you, but us there any progress on this?
Still need to see the results of the readelf -e a.out before any progress can be made. configure:2453: ./a.out ./a.out: error while loading shared libraries: /lib32/tls/libc.so.6: cannot apply additional memory protection after relocation: Permission denied -------------------------------------------------------- Side note I would avoid gcc-3.4.3 with hardened setups. The gcc seems to be faultly.
I use the standard 2005.0 profile on my AMD64 box and a self-patches kernel, amognst others with GRSecurity. I need to a chpax -m / paxctl -m (or set the M subject flag in the ACL) for any 32-Bit-App I want to run, which has always been like this using a kernel featuring the resp. PaX feature. (which is CONFIG_PAX_MPROTECT, I suppose, but I haven't verified this.)
*** This bug has been marked as a duplicate of 93769 ***