Summary: | sys-libs/glibc-2.13: static linking some apps breaks with missing memcpy_chk_ssse3 symbols | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Harris Landgarten <harrisl> |
Component: | [OLD] Core system | Assignee: | Gentoo Toolchain Maintainers <toolchain> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | aidanamarks, attila.jecs, billydv1, binki, bobr, casta, caster, charles, dan.mcgregor, DarkNRG, dawnstyle, donald.r.gray, emilbeinroth, fabian, gentoo, gerdesj, holger, ivan, jackdachef, kripton, leonchik1976, m.ustymenko, mark+gentoobugs, nelchael, parus, polidevk.polidevk, rose, ruckc, skrattaren, slyfox, spirch_1, srki80, StormByte, stribika, theli.ua, valet3valet, vityokster, zeekec |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | AMD64 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 354107 | ||
Attachments: |
build log
memcpy_chk fix for x86_64 and i686 glibc-2.13-memset-chk-static-pic.patch |
Description
Harris Landgarten
2011-02-06 04:38:25 UTC
Created attachment 261634 [details]
build log
the snippets you posted are simple warnings. the actual error: /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.2/../../../../lib64/libc.a(memmove_chk.o): In function `__memmove_chk': memmove_chk.c:(.text+0x1b4): undefined reference to `__memmove_chk_ssse3_back' memmove_chk.c:(.text+0x1b9): undefined reference to `__memmove_chk_ssse3' i can confirm that busybox does now emerge successfull after upgrade to sys-libs/glibc-2.13. i can confirm that busybox does NOT emerge successfull after upgrade to sys-libs/glibc-2.13. *** Bug 353861 has been marked as a duplicate of this bug. *** ive sent this patch upstream to fix the issue: http://sources.gentoo.org/gentoo/src/patchsets/glibc/2.13/0060_all_glibc-2.13-static-memmove-ssse3.patch?rev=1.1 Will be a rev bump with that patch before upstream releases it? patch works for me. at least I successfully compiled kernel only when recompiled glibc with this patch. *** Bug 354167 has been marked as a duplicate of this bug. *** This revision of glibc should not have been released into the ~arch, it should have been added to the tree masked. I have successfully downgraded glibc without issue (only because I have buildpkg in my features that allows me a safety net). I think if you have the ability to downgrade and are not afraid of the slight possibility of hosing your system, downgrading is the best option until some of the bugs are resolved. *** Bug 354347 has been marked as a duplicate of this bug. *** *** Bug 354185 has been marked as a duplicate of this bug. *** I have a very similar error (which isn't fixed by the above patch): networking/lib.a(arping.o): In function `arping_main': arping.c:(.text.arping_main+0x447): undefined reference to `__memset_chk' archival/lib.a(tar.o): In function `writeLongname': tar.c:(.text.writeLongname+0x11e): undefined reference to `__memset_chk' archival/lib.a(tar.o): In function `writeFileToTarball': tar.c:(.text.writeFileToTarball+0x21d): undefined reference to `__memset_chk' collect2: ld returned 1 exit status make: *** [busybox_unstripped] Error 1 if you arent showing the exact same error, you need to post full info. file a new bug with all the relevant details. (In reply to comment #14) > if you arent showing the exact same error, you need to post full info. file a > new bug with all the relevant details. > On hardened nomultilib ~amd64 the 0060 patch changes: the snippets you posted are simple warnings. the actual error: /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.2/../../../../lib64/libc.a(memmove_chk.o): In function `__memmove_chk': memmove_chk.c:(.text+0x1b4): undefined reference to `__memmove_chk_ssse3_back' memmove_chk.c:(.text+0x1b9): undefined reference to `__memmove_chk_ssse3' To: networking/lib.a(arping.o): In function `arping_main': arping.c:(.text.arping_main+0x447): undefined reference to `__memset_chk' archival/lib.a(tar.o): In function `writeLongname': tar.c:(.text.writeLongname+0x11e): undefined reference to `__memset_chk' archival/lib.a(tar.o): In function `writeFileToTarball': tar.c:(.text.writeFileToTarball+0x21d): undefined reference to `__memset_chk' collect2: ld returned 1 exit status make: *** [busybox_unstripped] Error 1 "Failed: -Wl,--start-group -lcrypt -lm -Wl,--end-group" Am I wrong in assuming that ${LDFLAGS} is not being honored here? Or is this normal for busybox? (In reply to comment #15) > "Failed: -Wl,--start-group -lcrypt -lm -Wl,--end-group" > > Am I wrong in assuming that ${LDFLAGS} is not being honored here? Or is this > normal for busybox? Busybox currently filters out any LDFLAGS which begin with -Wl. Thus, if the flags you escape via -Wl are necessary for successful compilation, then your build will break. See bug 346953 which includes a patch which fixes this. Can anyone post a modified ebuild including the patch from #6 in order to test it further? *** Bug 354539 has been marked as a duplicate of this bug. *** (In reply to comment #17) > Can anyone post a modified ebuild including the patch from #6 in order to test > it further? > Make sure you really want to do this! Make a quickpkg of your existing glibc Make sure you have a bootcd available so that you can put glibc back again if necessary Edit the patch and change the a/ and b/ in the diff lines to glibc-2.13/, then put the patch into a file called something like: /etc/portage/patches/sys-libs/glibc-2.13/patch-from-bug-353816.patch You may have to create those directories if you have not used this nifty Portage feature before, remember permissions (portage:portage eg). You do not have to amend the existing ebuild or mess with overlays Now when you emerge glibc you should see a userland patching section near the start after it applies the existing Portage patches to the source which mentions applying your new patch. After doing this I was then able to compile Busybox and hence my kernel again. I wanted to confirm that the patch from #6, installed as mentioned in #19, does in fact fix this bug -- when will we see this pushed into the tree? that is a lot of unnecessary effort. simply use /etc/portage/patches/ and then you dont have to edit the ebuild at all. *** Bug 354795 has been marked as a duplicate of this bug. *** Created attachment 262405 [details, diff] memcpy_chk fix for x86_64 and i686 seems the i686 multiarch code has a similar bug. this patch should fix both (and thus should also fix Comment #13 now). *** Bug 354811 has been marked as a duplicate of this bug. *** *** Bug 354815 has been marked as a duplicate of this bug. *** (In reply to comment #23) > Created an attachment (id=262405) [details] > memcpy_chk fix for x86_64 and i686 > > seems the i686 multiarch code has a similar bug. this patch should fix both > (and thus should also fix Comment #13 now). > This one works great, build of busybox-1.18.3 went fine with it Thanks ! *** Bug 354873 has been marked as a duplicate of this bug. *** Thanks for the patch. Everything compiles and runs. *** Bug 354883 has been marked as a duplicate of this bug. *** fixed with glibc-2.13-r1 *** Bug 354909 has been marked as a duplicate of this bug. *** (In reply to comment #30) > fixed with glibc-2.13-r1 > Still broken on ~amd64 hardened+nomultilib. networking/lib.a(arping.o): In function `arping_main': arping.c:(.text.arping_main+0x3be): undefined reference to `__memset_chk' archival/lib.a(tar.o): In function `writeLongname': tar.c:(.text.writeLongname+0xd6): undefined reference to `__memset_chk' archival/lib.a(tar.o): In function `writeFileToTarball': tar.c:(.text.writeFileToTarball+0x21e): undefined reference to `__memset_chk' collect2: ld returned 1 exit status make: *** [busybox_unstripped] Error 1 What package produces this error? I can compile busybox +static just fine on a current ~amd64 +nomultilib box. (In reply to comment #32) > (In reply to comment #30) > > fixed with glibc-2.13-r1 > > > > Still broken on ~amd64 hardened+nomultilib. > > networking/lib.a(arping.o): In function `arping_main': > arping.c:(.text.arping_main+0x3be): undefined reference to `__memset_chk' > archival/lib.a(tar.o): In function `writeLongname': > tar.c:(.text.writeLongname+0xd6): undefined reference to `__memset_chk' > archival/lib.a(tar.o): In function `writeFileToTarball': > tar.c:(.text.writeFileToTarball+0x21e): undefined reference to `__memset_chk' > collect2: ld returned 1 exit status > make: *** [busybox_unstripped] Error 1 > Sadly I confirm this. The patch fixes amd64+multilib, but amd64+hardened+nomultilib is still broken. Same error here on my gateway. Anyway, the patch is a great step over for most of desktop systems :) Juste for reference, the emerge --info of the system that remains broken : Portage 2.2.0_alpha23 (hardened/linux/amd64/no-multilib, gcc-4.5.2, glibc-2.13-r1, 2.6.37-hardened-r1 x86_64) ================================================================= System uname: Linux-2.6.37-hardened-r1-x86_64-Intel-R-_Atom-TM-_CPU_D510_@_1.66GHz-with-gentoo-2.0.1 Timestamp of tree: Mon, 14 Feb 2011 20:00:02 +0000 app-shells/bash: 4.1_p9 dev-lang/python: 2.7.1, 3.1.3 dev-util/cmake: 2.8.3-r1 sys-apps/baselayout: 2.0.1-r1 sys-apps/openrc: 0.7.0 sys-apps/sandbox: 2.5 sys-devel/autoconf: 2.68 sys-devel/automake: 1.11.1 sys-devel/binutils: 2.21 sys-devel/gcc: 4.5.2 sys-devel/gcc-config: 1.4.1 sys-devel/libtool: 2.4-r1 sys-devel/make: 3.82 virtual/os-headers: 2.6.36.1 (sys-kernel/linux-headers) Repositories: gentoo gcpan xwing local_portage Installed sets: @system ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="* -@EULA" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=native -O2 -mtune=native -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/openvpn/easy-rsa /var/bind" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-march=native -O2 -mtune=native -pipe" DISTDIR="/usr/portage/distfiles" EMERGE_DEFAULT_OPTS="--with-bdeps y" FEATURES="assume-digests binpkg-logs buildsyspkg collision-protect distlocks fixlafiles fixpackages metadata-transfer news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync" FFLAGS="" GENTOO_MIRRORS="http://dagobah.xwing.info/ ftp://ftp.free.fr/mirrors/ftp.gentoo.org/ http://mirror.ovh.net/gentoo-distfiles/ http://gentoo.tiscali.nl/" LANG="fr_FR.utf8" LC_ALL="fr_FR.utf8" LDFLAGS="-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,--sort-common" LINGUAS="fr" MAKEOPTS="-j5" 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/gcpan-portage /usr/local/portage/portage /usr/local/portage/local-portage" SYNC="rsync://dagobah.xwing.info/gentoo-portage" USE="acl acpi amd64 bash-completion bashlogger bzip2 cli cracklib crypt cups cxx dri enscript fontconfig hardened iconv idled idn iproute2 ipv6 ithreads jpeg justify mmx mudflap ncurses nls nptl nptlonly openmp pam pcre perl pic png pppd readline sasl session sse sse2 ssl sysfs syslog tcpd threads tiff truetype udev unicode urandom usb vim-pager vim-syntax 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 cgi cgid 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" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="fr" NGINX_MODULES_HTTP="access auth_basic autoindex browser charset empty_gif fastcgi gzip limit_req limit_zone map memcached proxy realip referer rewrite upstream_ip_hash userid stub_status" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CPPFLAGS, CTARGET, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS Sorry, didn't see the +hardened there. Disregard that, &c. glibc-2.13-r1 has __memcpy_chk symbols in libc.a on my hardened system. which isnt to say there arent suspicious PIC checks in the relevant .S files, just that it doesnt seem to be a problem for me. All packages now compile for me with the new glibc and I haven't seen any runtime errors. *** Bug 355021 has been marked as a duplicate of this bug. *** I can confirm that everything is fine with new glibc. With glibc-2.13-r1 i am still getting undefined reference to '__memset_chk' in busybox-1.18.3. amd64+hardened+multilib *** Bug 353917 has been marked as a duplicate of this bug. *** Confirm,glibc-2.13-r1 is no problem. amd64,multilib Compiling initrd with genekrnel fails on e2fsprogs, undefined reference to `__memset_chk' (In reply to comment #43) > Compiling initrd with genekrnel fails on e2fsprogs, undefined reference to > `__memset_chk' > May be the same as bug #355021. (In reply to comment #44) > (In reply to comment #43) > > Compiling initrd with genekrnel fails on e2fsprogs, undefined reference to > > `__memset_chk' > > > > May be the same as bug #355021. > Seems to be yet another duplicate of this bug. The common ground I have seen is trying to compile something statically. If I edit the busybox ebuild and change CONFIG_STATIC=y to CONFIG_PIE=y busybox compiles fine, but I am suspicious that the rescue shell would be useless. Should I treat #355021 as the same bug? It is not fixed yet for hardened toolchain. *** Bug 355021 has been marked as a duplicate of this bug. *** Created attachment 263413 [details, diff]
glibc-2.13-memset-chk-static-pic.patch
this should fix missing __memset_chk on hardened systems
(In reply to comment #48) > Created an attachment (id=263413) [details] > glibc-2.13-memset-chk-static-pic.patch > > this should fix missing __memset_chk on hardened systems > Great, confirmed the fix. With this patch on top of glibc-2.13-r1 busybox now build fine on hardened Thanks ! (In reply to comment #49) > (In reply to comment #48) > > Created an attachment (id=263413) [details] [details] > > glibc-2.13-memset-chk-static-pic.patch > > > > this should fix missing __memset_chk on hardened systems > > > > > Great, confirmed the fix. With this patch on top of glibc-2.13-r1 busybox now > build fine on hardened > > Thanks ! > Worked for me, too :) Solved the same problem in both busybox and cryptsetup. ive queued the patch in the glibc 2.13 patchset *** Bug 356115 has been marked as a duplicate of this bug. *** Can someone confirm that the version now in portage works with busybox and genkernel? (In reply to comment #53) > Can someone confirm that the version now in portage works with busybox and > genkernel? > not really - if there hasn't been a silent version-bump / update in the meantime: Fri Feb 18 18:31:50 2011 >>> sys-libs/glibc-2.13-r1 merge time: 9 minutes and 44 seconds. I attempted to update busybox from sys-apps/busybox-1.18.1 to sys-apps/busybox-1.18.2 and still got that error (In reply to comment #54) > (In reply to comment #53) > > Can someone confirm that the version now in portage works with busybox and > > genkernel? > > > > not really - if there hasn't been a silent version-bump / update > > in the meantime: > > > Fri Feb 18 18:31:50 2011 >>> sys-libs/glibc-2.13-r1 > merge time: 9 minutes and 44 seconds. > > > I attempted to update busybox from > > sys-apps/busybox-1.18.1 > > to > > sys-apps/busybox-1.18.2 > > and still got that error > sorry, I'm talking about hardened + multilib + x86_64 the non-hardened should work fine, currently testing the patch from #48 (In reply to comment #51) > ive queued the patch in the glibc 2.13 patchset > yes, please include that patch for hardened in the next version bump that worked for me busybox built fine *solved* thanks ! (In reply to comment #55) > (In reply to comment #54) > > (In reply to comment #53) > > > Can someone confirm that the version now in portage works with busybox and > > > genkernel? > > > > > > > not really - if there hasn't been a silent version-bump / update > > > > in the meantime: > > > > > > Fri Feb 18 18:31:50 2011 >>> sys-libs/glibc-2.13-r1 > > merge time: 9 minutes and 44 seconds. > > > > > > I attempted to update busybox from > > > > sys-apps/busybox-1.18.1 > > > > to > > > > sys-apps/busybox-1.18.2 > > > > and still got that error > > > > sorry, > > I'm talking about hardened + multilib + x86_64 > > the non-hardened should work fine, > > currently testing the patch from #48 > busybox-1.18.3 genkernel-3.4.13 initramfs compiles fine on my machine. Portage 2.1.9.41 (hardened/linux/amd64/no-multilib, gcc-4.5.2, glibc-2.13-r1, 2.6.26-2-amd64 x86_64) Yes, I can also now confirm. I have updated glibc, emerged busybox, compiled a kernel with genkernel and am at about 800 of 1800 packages being recompiled. All good!!! *** Bug 357461 has been marked as a duplicate of this bug. *** |