Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 124682 - sys-libs/glibc-2.3.6-r3 compile failure on hardened due to x86_64/string patches
Summary: sys-libs/glibc-2.3.6-r3 compile failure on hardened due to x86_64/string patches
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
: 132082 132104 132137 132252 132685 (view as bug list)
Depends on:
Blocks: 100289
  Show dependency tree
 
Reported: 2006-03-02 12:20 UTC by Julian Sasse
Modified: 2006-05-08 09:37 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Full compile log for glibc-2.3.6-r3 (failed) (glibc236r3log.txt.gz,627.36 KB, application/octet-stream)
2006-03-02 12:22 UTC, Julian Sasse
Details
Full compile log (with errors) for glibc-2.3.6-r3 (glibc236r3log2.txt.gz,632.71 KB, application/octet-stream)
2006-03-03 09:56 UTC, Julian Sasse
Details
Compile stderr output only for glibc-2.3.6-r3 (glibc236r3stderr.txt,31.13 KB, text/plain)
2006-03-03 12:33 UTC, Julian Sasse
Details
Use direct GOT offsets instead of _rtld_global_ro for PIE builds (glibc-2.3.6-r3-PIE-amd64.patch,6.05 KB, patch)
2006-03-03 13:18 UTC, Kevin F. Quinn (RETIRED)
Details | Diff
glibc-2.3.3-amd64-string-PIE-fixes.diff (glibc-2.3.3-amd64-string-PIE-fixes.diff,5.66 KB, patch)
2006-03-14 19:37 UTC, SpanKY
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Julian Sasse 2006-03-02 12:20:52 UTC
glibc-2.3.6-r2 compiled fine, but 2.3.6-r3 errors out

emerge --info:

Gentoo Base System version 1.12.0_pre15
Portage 2.1_pre5-r2 (default-linux/amd64/2005.0, gcc-3.4.5, glibc-2.3.6-r2, 2.6.11-gentoo-r6 x86_64)
=================================================================
System uname: 2.6.11-gentoo-r6 x86_64               Intel(R) Pentium(R) 4 CPU 3.20GHz
dev-lang/python:     2.3.5, 2.4.2-r1
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1-r2
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r3
ACCEPT_KEYWORDS="amd64 ~amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=nocona -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /var/bind /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=nocona -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://gentoo.osuosl.org/ ftp://ftp.gtlib.cc.gatech.edu/pub/gentoo"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.us.gentoo.org/gentoo-portage"
USE="X acl acpi alsa amd64 apache2 avi bash-completion berkdb bindist bitmap-fonts bzip2 caps crypt cups dbx eds emboss emul-linux-x86 encode fam fastcgi flash font-server foomaticdb fortran ftp gcj gd gif gnutls gpm gstreamer gtk2 hardened hardenedphp imap imlib innodb ipv6 java javascript jpeg libwww lm_sensors lzw lzw-tiff maildir mailwrapper mcal memlimit mime mozilla mp3 mpeg mysql mysqli ncurses nls nptl opengl pam pcre pdflib perl php pic png posix postgres prelude python quicktime readline sasl sdl spell spl ssl svg tcpd threads tiff tokenizer truetype truetype-fonts type1-fonts usb userlocales vhosts xml xml2 xpm xsl xv zlib elibc_glibc kernel_linux userland_GNU"
Unset:  ASFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
Comment 1 Julian Sasse 2006-03-02 12:22:17 UTC
Created attachment 81132 [details]
Full compile log for glibc-2.3.6-r3 (failed)
Comment 2 SpanKY gentoo-dev 2006-03-02 19:11:04 UTC
unless i missed something, what you posted doesnt actually contain an error
Comment 3 Julian Sasse 2006-03-03 08:58:07 UTC
Yes ty, I feel real stupid now since I obviously used "| tee" when I should have done "2>&1 | tee".  I will upload a new attachment shortly that will contain everything.  In the meantime, some/all of the error text should be in comment #22 of Bug 116613:
http://bugs.gentoo.org/show_bug.cgi?id=116613#c22
BTW, this is not a duplicate; I was told that my issue was different and that I should open a new bug.
Comment 4 Julian Sasse 2006-03-03 09:05:31 UTC
I think the errors involved undefined references to `_rtld_global_ro' from memset, mempcpy, etc during the linuxthreads build.
Comment 5 Julian Sasse 2006-03-03 09:56:26 UTC
Created attachment 81216 [details]
Full compile log (with errors) for glibc-2.3.6-r3
Comment 6 Julian Sasse 2006-03-03 12:33:23 UTC
Created attachment 81230 [details]
Compile stderr output only for glibc-2.3.6-r3

This attachment has only the output that was written to stderr, so it has the warnings and errors from the whole compile in case you don't want to sift through the 26MB full output.  But of course if you need to see the errors in context, you will need to look at the other attachment.
Comment 7 Kevin F. Quinn (RETIRED) gentoo-dev 2006-03-03 13:18:52 UTC
Created attachment 81233 [details, diff]
Use direct GOT offsets instead of _rtld_global_ro for PIE builds

This problem has been introduced by the x86_64 optimisation patch and is triggerd by the hardened compiler.  It needs a similar treatment to that in bug #78951, I think.  Here is an untried patch that may fix the problem - please try it out and see what happens (in a chroot or lemming system, don't try in your main system as it may hose your glibc if I've made any mistakes).
Comment 8 Julian Sasse 2006-03-05 20:31:43 UTC
Unfortunately I don't have access to an x86_64 development box so I can't really test it at the moment.  Time permitting, I will try to setup a chroot in the next few days to test the patch, but perhaps there is someone else that can help test this in the meantime.
Comment 9 SpanKY gentoo-dev 2006-03-06 15:03:52 UTC
Kevin: i would just go ahead and update the glibc 2.3.6 patches in cvs with your changes here ...
Comment 10 Jory A. Pratt 2006-03-07 02:32:13 UTC
(In reply to comment #7)
> Created an attachment (id=81233) [edit]
> Use direct GOT offsets instead of _rtld_global_ro for PIE builds
> 
> This problem has been introduced by the x86_64 optimisation patch and is
> triggerd by the hardened compiler.  It needs a similar treatment to that in bug
> #78951, I think.  Here is an untried patch that may fix the problem - please
> try it out and see what happens (in a chroot or lemming system, don't try in
> your main system as it may hose your glibc if I've made any mistakes).
> 

Changes are not complete -fPIC is still missing which causes hardened to fail.

Comment 11 Jory A. Pratt 2006-03-07 10:08:50 UTC
for tracking purposes adding amd64 herd so we can keep up with status.
Comment 12 Nes Yarug 2006-03-09 12:16:47 UTC
Same errors here:

/var/tmp/portage/glibc-2.3.6-r3/work/build-amd64-x86_64-pc-linux-gnu-linuxthreads/libc.a(strlen.o): In function `strlen':
../sysdeps/x86_64/strlen.S:(.text+0x145): undefined reference to `_rtld_global_ro'
/var/tmp/portage/glibc-2.3.6-r3/work/build-amd64-x86_64-pc-linux-gnu-linuxthreads/libc.a(memset.o): In function `memset':
../sysdeps/x86_64/memset.S:(.text+0xd3): undefined reference to `_rtld_global_ro'
../sysdeps/x86_64/memset.S:(.text+0x103): undefined reference to `_rtld_global_ro'
/var/tmp/portage/glibc-2.3.6-r3/work/build-amd64-x86_64-pc-linux-gnu-linuxthreads/libc.a(mempcpy.o): In function `mempcpy':
../sysdeps/x86_64/mempcpy.S:(.text+0x123): undefined reference to `_rtld_global_ro'
../sysdeps/x86_64/mempcpy.S:(.text+0x173): undefined reference to `_rtld_global_ro'
/var/tmp/portage/glibc-2.3.6-r3/work/build-amd64-x86_64-pc-linux-gnu-linuxthreads/libc.a(mempcpy.o):../sysdeps/x86_64/mempcpy.S:(.text+0x293): more undefined references to `_rtld_global_ro' follow
collect2: ld returned 1 exit status
make[2]: *** [/var/tmp/portage/glibc-2.3.6-r3/work/build-amd64-x86_64-pc-linux-gnu-linuxthreads/elf/sln] Error 1
make[2]: *** Waiting for unfinished jobs....
/var/tmp/portage/glibc-2.3.6-r3/work/build-amd64-x86_64-pc-linux-gnu-linuxthreads/libc.a(strcpy.o): In function `strcpy':
../sysdeps/x86_64/strcpy.S:(.text+0x161): undefined reference to `_rtld_global_ro'
../sysdeps/x86_64/strcpy.S:(.text+0x29d): undefined reference to `_rtld_global_ro'
/var/tmp/portage/glibc-2.3.6-r3/work/build-amd64-x86_64-pc-linux-gnu-linuxthreads/libc.a(strlen.o): In function `strlen':
../sysdeps/x86_64/strlen.S:(.text+0x145): undefined reference to `_rtld_global_ro'
/var/tmp/portage/glibc-2.3.6-r3/work/build-amd64-x86_64-pc-linux-gnu-linuxthreads/libc.a(memset.o): In function `memset':
../sysdeps/x86_64/memset.S:(.text+0xd3): undefined reference to `_rtld_global_ro'
../sysdeps/x86_64/memset.S:(.text+0x103): undefined reference to `_rtld_global_ro'
/var/tmp/portage/glibc-2.3.6-r3/work/build-amd64-x86_64-pc-linux-gnu-linuxthreads/libc.a(mempcpy.o):../sysdeps/x86_64/mempcpy.S:(.text+0x123): more undefined references to `_rtld_global_ro' follow
collect2: ld returned 1 exit status
make[2]: *** [/var/tmp/portage/glibc-2.3.6-r3/work/build-amd64-x86_64-pc-linux-gnu-linuxthreads/elf/ldconfig] Error 1
make[2]: Leaving directory `/var/tmp/portage/glibc-2.3.6-r3/work/glibc-2.3.6/elf'
make[1]: *** [elf/others] Error 2
make[1]: Leaving directory `/var/tmp/portage/glibc-2.3.6-r3/work/glibc-2.3.6'
make: *** [all] Error 2

!!! ERROR: sys-libs/glibc-2.3.6-r3 failed.
Call stack:
  ebuild.sh, line 1933:   Called dyn_compile
  ebuild.sh, line 971:   Called src_compile
  glibc-2.3.6-r3.ebuild, line 1240:   Called src_compile
  glibc-2.3.6-r3.ebuild, line 1251:   Called toolchain-glibc_src_compile

emerge info:

Portage 2.1_pre5-r4 (default-linux/amd64/2006.0, gcc-3.4.5, glibc-2.3.6-r3, 2.6.13-gentoo x86_64)
=================================================================
System uname: 2.6.13-gentoo x86_64 AMD Athlon(tm) 64 Processor 3200+
Gentoo Base System version 1.12.0_pre16
dev-lang/python:     2.3.5, 2.4.2-r1
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1-r2
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r3
ACCEPT_KEYWORDS="amd64 ~amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -fomit-frame-pointer -O2"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/splash /etc/terminfo /etc/env.d"
CXXFLAGS="-march=k8 -fomit-frame-pointer -O2"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://ftp.uni-erlangen.de/pub/mirrors/gentoo http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ http://ftp.snt.utwente.nl/pub/os/linux/gentoo http://vlaai.snt.ipv6.utwente.nl/pub/os/linux/gentoo/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="amd64 apache2 bash-completion berkdb bitmap-fonts crypt cups dri eds emboss encode foomaticdb fortran gif gpm gstreamer hardened imlib ipv6 jpeg lzw lzw-tiff mpeg mysql ncurses nls nptl opengl pam pdflib perl png python readline sasl sdl spell ssl tcpd tiff truetype-fonts type1-fonts unicode usb userlocales vhosts xpm xv zlib elibc_glibc kernel_linux userland_GNU"
Unset:  ASFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY

Thanks,
Nes
Comment 13 SpanKY gentoo-dev 2006-03-14 19:31:34 UTC
ok, the proposed patch doesnt work cause Kevin typoed his define checks ...
-#include <rtld-global-offsets.h>
+#if defined PIC && !defined SHARED
+# include <rtld-global-offsets.h>
+#endif

that should of course be:
+#if defined PIC && defined SHARED

drop the '!' in other words

i'll fix this up and contact the SuSE guys
Comment 14 SpanKY gentoo-dev 2006-03-14 19:37:35 UTC
Created attachment 82184 [details, diff]
glibc-2.3.3-amd64-string-PIE-fixes.diff

Kevin's real work + my trivial typo fixes
Comment 15 SpanKY gentoo-dev 2006-03-14 20:10:23 UTC
ok, ive committed this to our cvs patchsets and it'll be in glibc-2.3.6-r4
Comment 16 Jakub Moc (RETIRED) gentoo-dev 2006-05-02 23:46:10 UTC
*** Bug 132082 has been marked as a duplicate of this bug. ***
Comment 17 Jakub Moc (RETIRED) gentoo-dev 2006-05-03 03:44:59 UTC
*** Bug 132104 has been marked as a duplicate of this bug. ***
Comment 18 Jakub Moc (RETIRED) gentoo-dev 2006-05-03 08:23:36 UTC
*** Bug 132137 has been marked as a duplicate of this bug. ***
Comment 19 SpanKY gentoo-dev 2006-05-03 21:19:15 UTC
glibc-2.3.6-r4 and glibc-2.4 should have this fixed
Comment 20 Michael Crawford (ali3nx) 2006-05-04 01:07:31 UTC
Thanks for redirecting me here Spanky. Seems there's still an issue with the ebuild someplace for 2.3.6-r4 on amd64

rm -f /var/tmp/portage/glibc-2.3.6-r4/work/build-amd64-x86_64-pc-linux-gnu-nptl/elf/symlink.list
test ! -x /var/tmp/portage/glibc-2.3.6-r4/work/build-amd64-x86_64-pc-linux-gnu-nptl/elf/ldconfig || LC_ALL=C LANGUAGE=C \
  /var/tmp/portage/glibc-2.3.6-r4/work/build-amd64-x86_64-pc-linux-gnu-nptl/elf/ldconfig -r /var/tmp/portage/glibc-2.3.6-r4/image/ \
                               /lib64 /usr/lib64
/var/tmp/portage/glibc-2.3.6-r4/work/build-amd64-x86_64-pc-linux-gnu-nptl/elf/ldconfig: Can't open configuration file /etc/ld.so.conf: No such file or directory
make[1]: Leaving directory `/var/tmp/portage/glibc-2.3.6-r4/work/glibc-2.3.6'
/var/tmp/portage/glibc-2.3.6-r4/temp/gentoo-multilib /var/tmp/portage/glibc-2.3.6-r4/work/build-amd64-x86_64-pc-linux-gnu-nptl
/var/tmp/portage/glibc-2.3.6-r4/work/build-amd64-x86_64-pc-linux-gnu-nptl
ln: creating symbolic link `/var/tmp/portage/glibc-2.3.6-r4/image//usr/lib/locale' to `/usr/lib64/locale': No such file or directory
 * Installing info pages...
make: *** No rule to make target `info'.  Stop.

!!! ERROR: sys-libs/glibc-2.3.6-r4 failed.
!!! Function toolchain-glibc_src_install, Line 463, Exitcode 2
!!! (no error message)
!!! If you need support, post the topmost build error, NOT this status message.
Comment 21 Jakub Moc (RETIRED) gentoo-dev 2006-05-04 06:55:24 UTC
*** Bug 132252 has been marked as a duplicate of this bug. ***
Comment 22 Jakub Moc (RETIRED) gentoo-dev 2006-05-04 06:56:21 UTC
(In reply to comment #20)
> Thanks for redirecting me here Spanky. Seems there's still an issue with the
> ebuild someplace for 2.3.6-r4 on amd64

Unrelated. File a new bug, please...
Comment 23 Frederik 'Freso' S. Olesen 2006-05-04 07:10:16 UTC
(In reply to comment #22)
>(In reply to comment #20)
>>Thanks for redirecting me here Spanky. Seems there's still an issue with the
>>ebuild someplace for 2.3.6-r4 on amd64
>
>Unrelated. File a new bug, please...

Done: Bug #132257
Comment 24 Jakub Moc (RETIRED) gentoo-dev 2006-05-08 07:57:02 UTC
*** Bug 132685 has been marked as a duplicate of this bug. ***