glibc fails to compile after upgrading to gcc-3.3.3-r5. glibc-2.3.3_pre20040420 previously compiled with gcc-3.3.3-r3. Pls let me know if you need additional info. Compilation error message - =========================== gconv_cache.c: In function `__gconv_load_cache': gconv_cache.c:75: error: invalid `asm': operand number out of range gconv_cache.c:75: error: invalid `asm': operand number out of range gconv_cache.c:112: error: invalid `asm': operand number out of range gconv_cache.c:112: error: invalid `asm': operand number out of range {standard input}: Assembler messages: {standard input}:92: Error: non-constant expression in ".if" statement {standard input}:123: Error: non-constant expression in ".if" statement make[2]: *** [/var/tmp/portage/glibc-2.3.3_pre20040420/work/glibc-2.3.2/buildhere/iconv/gconv_cache.o] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory `/var/tmp/portage/glibc-2.3.3_pre20040420/work/glibc-2.3.2/iconv' make[1]: *** [iconv/subdir_lib] Error 2 make[1]: Leaving directory `/var/tmp/portage/glibc-2.3.3_pre20040420/work/glibc-2.3.2' make: *** [all] Error 2 !!! ERROR: sys-libs/glibc-2.3.3_pre20040420 failed. !!! Function src_compile, Line 536, Exitcode 2 !!! (no error message) Emerge List =========== root@amoeba # ACCEPT_KEYWORDS="~x86" emerge -pv gcc glibc These are the packages that I would merge, in order: Calculating dependencies ...done! [ebuild R ] sys-devel/gcc-3.3.3-r5 +X -bootstrap -build -debug +f77 +gcj +hardened +java -multilib +nls +objc -static -uclibc 0 kB [ebuild R ] sys-libs/glibc-2.3.3_pre20040420 -build +nls +nptl +pic 18 kB Total size of downloads: 18 kB System Setup ============ root@amoeba # emerge --info Portage 2.0.50-r7 (default-x86-1.4, gcc-3.3.3, glibc-2.3.3_pre20040420-r0, 2.6.5-hardened-r2) ================================================================= System uname: 2.6.5-hardened-r2 i686 Intel(R) Pentium(R) 4 CPU 2.40GHz Gentoo Base System version 1.4.15 ccache version 2.3 [disabled] Autoconf: sys-devel/autoconf-2.59-r3 Automake: sys-devel/automake-1.8.3 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-O2 -pipe -march=pentium4 -ftracer -fomit-frame-pointer -fstack-protector" CHOST="i686-pc-linux-gnu" COMPILER="gcc3" CONFIG_PROTECT="/etc /etc/tomcat /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.2/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/bind /var/lib/jboss /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O2 -pipe -march=pentium4 -ftracer -fomit-frame-pointer -fstack-protector" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs buildpkg digest" GENTOO_MIRRORS="http://gentoo.kems.net http://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/ http://www.gtlib.cc.gatech.edu/pub/gentoo http://www.zentek-international.com/mirrors/gentoo/" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/portage/local" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="S3TC X X509 aalib aavm acl acpi acpi4linux ada alsa amd antlr apache2 apm arts async atlas auctex autofs avi bcel berkdb bindist blas bonobo bsh cap caps cdr chroot clamav crypt cups curl dga dillo directfb dnd doc dv dvd dvdr emacs emacs-w3 encode esd etdyn ethereal evms2 evo exiscan exiscan-acl expat f77 faad fam fax fbcon fbdev ffmpeg fftw flac fltk foomaticdb foreign-package foreign-sysvinit freetype fs fullrpc gb gcj gd gdbm gif gimpprint ginac glade glut gnome gnomedb gphoto2 gpm gsl gstreamer gtk gtk2 gtkhtml guile hardened hdf5 ieee1394 imagemagick imap imlib imlib2 innodb ipv6 jabber jack jack-caps jack-tmpfs java javamail javascript jbig jdepend jikes jpeg jsch jython kadu-modules kadu-voice kde kerberos lcms ldap libdsk libg++ libgda libwww lids lmtp ltsp mad maildir mbox md5sum mdb memlimit mikmod mldonkeypango mmap mmx monkey mono motif mozcalendar mozctl mozdomi mozilla mozinterfaceinfo mozp3p mozsvg mozxmlterm mpeg mpi msn mysql nas ncurses nls nptl nvidia oav objc ocaml odbc offensive oggvorbis opengl openssh optional-tasks oscar oss pam parse-clocks passfile pdflib pear-db perl php pic pie plotutils png ppds prelude propolice pthreads pwdb python qhull qt quicktime readline regexp ruby samba sasl scanner sdl skey slang slp snmp speedo spell sqlite sse ssl svga t1lib tcltk tcpd tetex threads tiff transcode truetype type1 unicode usagi usb v4l v4l2 vim-with-x virus-scan wmf wsconvert wxwin wxwindows x86 xalan xemacs xerces xfs xml xml2 xmms xosd xprint xv xvid yahoo zeo zlib"
I encountered this with gcc-3.4-r5 and gcc-3.3.3-r6, but only when both "hardened" and "nptl" useflags are set. Without "hardened" or "nptl" everything (apparently) works fine. Steps to reproduce/test: Unpack stage1 tarball to an empty directory. Copy in resolv.conf & portage tree from host system. mount proc chroot in env-update && source /etc/profile export USE="build bootstrap hardened nptl -nls" export ACCEPT_KEYWORDS="~x86" emerge '>=sys-kernel/linux-header-2.6.0' emerge gcc glibc
Funny thing is, I built glibc just last night w/ hardened, nptl, and pic USE, and had no issues on my x86. Fire off an emerge -e world, wake up, and now I have this error too. Rather odd.
Did some more testing; building glibc-2.3.3_pre20040207 and glibc-2.3.3_pre20040117 also fails with the same error. So this maybe this is a problem in gcc or the "hardened" patches or something?
would you mind trying 2.3.4.20040605?
Travis, I tried glibc-2.3.3_pre20040529, 2.3.4_20040602 and 2.3.4_20040605 using both gcc-3.3.3-r5 and gcc-3.4.0-r6 (compiled with the hardened USE flag). Compilation always fails if I set the nptl USE flag during the glibc compile. The hardened USE flag doesn't seem to matter here, during the glibc compile, I mean. But I never tried with a not hardened gcc. I also tried using binutils-2.14.x and binutils-2.15.90.0.3-r3 but the result is always the same. Tell me if there some more test I could do, or if I should give you more info! PS: I'm on x86.
My attempts to compile newly released sys-libs/glibc-2.3.3.20040420 are also failing with errors similar to those originally reported. I also tried rolling back to previous version of gcc, but that has not worked either. Attemps at compiling gcc-2.9.xxx also failed, different errors. I've only tried this on the one machine I have access to, perhaps someone could confirm? Thanks.
please try in order binutils-2.14.90.0.8-r1, gcc-3.3.3-r6, glibc-2.3.3.20040420
Created attachment 32821 [details] buildlog (binutils-2.14.90.0.8-r1, gcc-3.3.3-r6, glibc-2.3.3.20040420) This is the log of a (failed) build with binutils-2.14.90.0.8-r1, gcc-3.3.3-r6, glibc-2.3.3.20040420. It was created by running 'ssh root@dodo 2>&1 | tee ~/buildlog.txt' To see commands only grep for 'dodo'
I confirm this bug. binutils-2.14.90.0.8-r1, gcc-3.3.3-r5, trying to compile glibc-2.3.3.20040420 hardened & nptl in USE. ~x86.
i had the same error, i tried to compile glibc-2.3.3.20040420 with gcc-3.3.3-r5. i tried some of the glibc-pre versions, but with the same result. without the nptl flag set glibc compiled without any error. i fixes the problem for me by recompiling my gcc with USE="-hardened" after that glibc-2.3.3.20040420 emerged without that gconv_cache error! now i got emerge --info Portage 2.0.50-r7 (default-x86-1.4, gcc-3.3.3, glibc-2.3.3.20040420-r0, 2.6.5-gentoo-r1) so the problem seems to be compiling glibc with a hardened gcc.
Well, at least I know it's not specific to my VIA C3-2 chip then :)
*** Bug 53442 has been marked as a duplicate of this bug. ***
Created attachment 33187 [details, diff] patch for logic mismatch The code it complains about compiles as such: (void) ({ do { } while (0); ({ register unsigned int resultvar; asm volatile ( "bpushl .L__X'%k3, %k3\n\t" "movl %1, %%eax\n\t" "call *_dl_sysinfo\n\t" "bpopl .L__X'%k2, %k2\n\t" : "=a" (resultvar) : "i" (6) , "cd" ((fd)) : "memory", "cc"); (int) resultvar; }); }); ** We bpushl to %k3 but bpopl from %k2. ** in ./sysdeps/unix/sysv/linux/i386/sysdep.h: #define LOADARGS_0 #ifdef __PIC__ # if defined I386_USE_SYSENTER # define LOADARGS_1 \ "bpushl .L__X'%k3, %k3\n\t" # define LOADARGS_5 \ "movl %%ebx, %4\n\t" \ "movl %3, %%ebx\n\t" # else # define LOADARGS_1 \ "bpushl .L__X'%k2, %k2\n\t" # define LOADARGS_5 \ "movl %%ebx, %3\n\t" \ "movl %2, %%ebx\n\t" # endif (stuff skipped for this comment) #define RESTOREARGS_0 #ifdef __PIC__ # if defined I386_USE_SYSENTER && defined SHARED # define RESTOREARGS_1 \ "bpopl .L__X'%k3, %k3\n\t" # define RESTOREARGS_5 \ "movl %4, %%ebx" # else # define RESTOREARGS_1 \ "bpopl .L__X'%k2, %k2\n\t" # define RESTOREARGS_5 \ "movl %3, %%ebx" # endif ** note how the restore section tests for SHARED but the load part doesn't ** These calls are added as conditional wrappers if PIC code is desired. Makes sense to me that they should have the exact same triggers.
i've added this patch to glibc 2.3.4.20040605-r1 for testing as: # this patch is needed to compile nptl with a hardened gcc has_hardened && use nptl && \ epatch ${FILESDIR}/2.3.4/glibc-2.3.4-hardened-sysdep-shared.patch i'd also like to note that enabling nptl on amd64 with this ebuild in any way, no matter what, makes all sorts of apps think i dont exist... they tell me so. they yell "You dont exist!" and then die. kinda depressing, really. ^_^ cvs and ssh are examples of philosophically challenged apps.
well? any reports of breakage on x86?
I don't really want to try this out as current glibc stable is 2.3.2 which my entire system is linked against. If I update to 2.3.4, newly compiled binaries will require 2.3.4 on my system (well, that's my understanding) I'm happy to keep glibc masked until the fix is applied to a stable glibc version - I understand glibc 2.3.3 will be released soon. Can the fix be ported to a 2.3.3 version?
Works for me. (gcc-3.4.0; glibc-2.3.4.20040605-r1)
Fails with gcc-3.3.3-r5. Everything else is same as when I originally reported this bug. Pls let me know if you need additional info. ===== EMERGE LOG ===== GCONV_PATH=/var/tmp/portage/glibc-2.3.4.20040605-r1/work/build/iconvdata LC_ALL=C /var/tmp/portage/glibc-2.3.4.20040605-r1/work/build/elf/ld-linux.so.2 --library-path /var/tmp/portage/glibc-2.3.4.20040605-r1/work/build:/var/tmp/portage/glibc-2.3.4.20040605-r1/work/build/math:/var/tmp/portage/glibc-2.3.4.20040605-r1/work/build/elf:/var/tmp/portage/glibc-2.3.4.20040605-r1/work/build/dlfcn:/var/tmp/portage/glibc-2.3.4.20040605-r1/work/build/nss:/var/tmp/portage/glibc-2.3.4.20040605-r1/work/build/nis:/var/tmp/portage/glibc-2.3.4.20040605-r1/work/build/rt:/var/tmp/portage/glibc-2.3.4.20040605-r1/work/build/resolv:/var/tmp/portage/glibc-2.3.4.20040605-r1/work/build/crypt:/var/tmp/portage/glibc-2.3.4.20040605-r1/work/build/nptl /var/tmp/portage/glibc-2.3.4.20040605-r1/work/build/iconvdata/bug-iconv3 > /var/tmp/portage/glibc-2.3.4.20040605-r1/work/build/iconvdata/bug-iconv3.out /bin/sh -e run-iconv-test.sh /var/tmp/portage/glibc-2.3.4.20040605-r1/work/build > /var/tmp/portage/glibc-2.3.4.20040605-r1/work/build/iconvdata/iconv-test.out /var/tmp/portage/glibc-2.3.4.20040605-r1/work/build/iconv/iconv_prog: conversion stopped due to problem in writing the output run-iconv-test.sh: line 142: 18165 Done(1) $PROG -f $from -t $t testdata/suntzus 20392 Segmentation fault | $PROG -f $t -t $to >$temp1 make[2]: *** [/var/tmp/portage/glibc-2.3.4.20040605-r1/work/build/iconvdata/iconv-test.out] Error 1 make[2]: Leaving directory `/var/tmp/portage/glibc-2.3.4.20040605-r1/work/glibc-2.3.4.20040605/iconvdata' make[1]: *** [iconvdata/tests] Error 2 make[1]: Leaving directory `/var/tmp/portage/glibc-2.3.4.20040605-r1/work/glibc-2.3.4.20040605' make: *** [check] Error 2 !!! ERROR: sys-libs/glibc-2.3.4.20040605-r1 failed. !!! Function do_makecheck, Line 163, Exitcode 2 !!! (no error message)
Anybody tested with the patch from attachment #33187 [details, diff] yet? It's been reported to solve the problem at hand with the gconv stuff. However we will not add it to the toolchain till it's been tested and we got some confirmed reports that it solved the problem at hand for people that are getting this bug to show up.
I applied that patch to glibc-2.3.3.20040420, and it compiled and installed fine. I'm using gcc-3.3.3-r6. Relevant use-flags of course hardened + nptl. ~x86.
My previous failed attempt to compile glibc was with the logic mismatch patch - glibc-2.3.4-hardened-sysdep-shared.patch - applied. Not to glibc-2.3.3-... though. Will try it when I get a chance.
I also applied that patch to glibc-2.3.3.20040420, and it compiled and installed fine. I'm also using gcc-3.3.3-r6 on a VIA C3-2 system
Update on Compile Error - I didn't notice this earlier, but the following was causing the compile error earlier - /var/log/syslog/krn_messages:Jun 17 22:26:21 amoeba grsec: attempted resource overstep by requesting 4096 for RLIMIT_CORE against limit 0 by /var/tmp/portage/glibc-2.3.4.20040605-r1/work/build/elf/ld.so[ld-linux.so.2:29583] uid/euid:0/0 gid/egid:0/0, parent /bin/bash[sh:2726] uid/euid:0/0 gid/egid:0/0 I fixed this using ulimit -c unlimited and reran the process. Unfortunately, this didn't help, the new error message is listed at the bottom of this post. There's nothing in the kernel messages to indicate that the problem is being caused by any of my settings in my Grsecurity enabled kernel. I'll try and compile/load a new kernel and see if I can compike glibc then. But seeing as the error is at roughly the same point of the build process, this failed compilation may be caused by an unrelated issue in glibc & hardened gcc. Thanks. ===== EMERGE LOG ===== GCONV_PATH=/var/tmp/portage/glibc-2.3.4.20040605-r1/work/build/iconvdata LC_ALL=C /var/tmp/portage/glibc-2.3.4.20040605-r1/work/build/elf/ld-linux.so.2 --library-path /var/tmp/portage/glibc-2.3.4.20040605-r1/work/build:/var/tmp/portage/glibc-2.3.4.20040605-r1/work/build/math:/var/tmp/portage/glibc-2.3.4.20040605-r1/work/build/elf:/var/tmp/portage/glibc-2.3.4.20040605-r1/work/build/dlfcn:/var/tmp/portage/glibc-2.3.4.20040605-r1/work/build/nss:/var/tmp/portage/glibc-2.3.4.20040605-r1/work/build/nis:/var/tmp/portage/glibc-2.3.4.20040605-r1/work/build/rt:/var/tmp/portage/glibc-2.3.4.20040605-r1/work/build/resolv:/var/tmp/portage/glibc-2.3.4.20040605-r1/work/build/crypt:/var/tmp/portage/glibc-2.3.4.20040605-r1/work/build/nptl /var/tmp/portage/glibc-2.3.4.20040605-r1/work/build/iconvdata/bug-iconv3 > /var/tmp/portage/glibc-2.3.4.20040605-r1/work/build/iconvdata/bug-iconv3.out /bin/sh -e run-iconv-test.sh /var/tmp/portage/glibc-2.3.4.20040605-r1/work/build > /var/tmp/portage/glibc-2.3.4.20040605-r1/work/build/iconvdata/iconv-test.out run-iconv-test.sh: line 142: 6184 Segmentation fault (core dumped) $PROG -t ../localedata/charmaps/$from -f ../localedata/charmaps/$tc -o $temp2 $temp1 make[2]: *** [/var/tmp/portage/glibc-2.3.4.20040605-r1/work/build/iconvdata/iconv-test.out] Error 1 make[2]: Leaving directory `/var/tmp/portage/glibc-2.3.4.20040605-r1/work/glibc-2.3.4.20040605/iconvdata' make[1]: *** [iconvdata/tests] Error 2 make[1]: Leaving directory `/var/tmp/portage/glibc-2.3.4.20040605-r1/work/glibc-2.3.4.20040605' make: *** [check] Error 2 !!! ERROR: sys-libs/glibc-2.3.4.20040605-r1 failed. !!! Function do_makecheck, Line 156, Exitcode 2 !!! (no error message)
Re comment #23 The problem with ld.so is described here in detail. http://sources.redhat.com/bugzilla/show_bug.cgi?id=227
Thanks solar. It explains the issue I'm having, unfortunately not how to to fix it though. I'm too much of a noob to figure out what all this means.
Hi, I also applied the patch and it worked. Hardened-GCC-3.3.3-r6, glibc-2.3.3.20040420, NPTL all ~x86 Rumen
The patch also worked for me with nptl, hardened, pic and erandom enabled on USE. GCC version is 3.3.3 20040412 (Gentoo Hardened Linux 3.3.3-r6, ssp-3.3.2-2, pie-8.7.6). Good work.
Added debug to IUSE for all glibc ebuilds. Good feedback on scott's work so we imported the sysdep-shared.patch bug #52254#c13 into x86 stable glibc-2.3.3.20040420 This should resolve this bug but let's leave it open a few days incase any bugs pop up. Note: patch not imported to glibc-2.3.4.20040619 (yet)
Is it this attachment? http://bugs.gentoo.org/attachment.cgi?id=33187&action=view If so, I will try it and see if it maybe will fix my issue with sandbox ...
Martin, Yeah thats the patch. It probably resolves all the glibc nptl bugs and anything related to iconv/gconv showing up.
WORKSFORME: # cat /etc/portage/package.keywords =sys-kernel/linux-headers-2.6.7 -* =sys-libs/glibc-2.3.4.20040619 -* =sys-devel/gcc-3.4.* -* I bootstrapped as described in comment #1 -- it worked. Then I performed "emerge -ue world" -- this also worked. BUT THERE IS A PROBLEM WITH NPTL AND HARDENED GCC, PLEASE SEE Bug 26756
This bug can be CLOSED now?
As It Works For Me (tm) I guess it can be closed :)
Closing bug as FIXED then.