Created attachment 530760 [details] build.log.bz2 'MAKEOPTS=-j1 emerge -v1 glibc' fails with: ... /var/tmp/portage/sys-libs/glibc-2.26-r7/work/build-x86-x86_64-pc-linux-gnu-nptl/elf/sln /var/tmp/portage/sys-libs/glibc-2.26-r7/work/build-x86-x86_64-pc-linux-gnu-nptl/elf/symlink.list /var/tmp/portage/sys-libs/glibc-2.26-r7/work/build-x86-x86_64-pc-linux-gnu-nptl/elf/sln: /var/tmp/portage/sys-libs/glibc-2.26-r7/work/build-x86-x86_64-pc-linux-gnu-nptl/elf/sln: cannot execute binary file make[1]: *** [Makefile:106: install-symbolic-link] Error 126 root@localhost:/mnt/cdrom(7)# file /var/tmp/portage/sys-libs/glibc-2.26-r7/work/build-x86-x86_64-pc-linux-gnu-nptl/elf/sln /var/tmp/portage/sys-libs/glibc-2.26-r7/work/build-x86-x86_64-pc-linux-gnu-nptl/elf/sln: ELF 32-bit LSB executable, Intel 80386, version 1 (GNU/Linux), statically linked, for GNU/Linux 3.2.0, not stripped root@localhost:/mnt/cdrom(8)# emerge --info '=sys-libs/glibc-2.26-r7::gentoo' Portage 2.3.36 (python 3.5.5-final-0, default/linux/amd64/17.0/systemd, gcc-7.3.0, glibc-2.26-r6, 4.16.2-gentoo x86_64) ================================================================= System Settings ================================================================= System uname: Linux-4.16.2-gentoo-x86_64-Intel-R-_Core-TM-_i7-3630QM_CPU_@_2.40GHz-with-gentoo-2.4.1 KiB Mem: 4040360 total, 1773664 free KiB Swap: 0 total, 0 free Timestamp of repository gentoo: Wed, 09 May 2018 06:30:01 +0000 Head commit of repository gentoo: fbe832b17dfaac3584e5623b61de68b37d4948f0 sh bash 4.4_p19 ld GNU ld (Gentoo 2.30 p2) 2.30.0 app-shells/bash: 4.4_p19::gentoo dev-lang/perl: 5.26.2::gentoo dev-lang/python: 2.7.14-r2::gentoo, 3.5.5-r1::gentoo dev-util/cmake: 3.11.1::gentoo dev-util/pkgconfig: 0.29.2::gentoo sys-apps/baselayout: 2.4.1-r2::gentoo sys-apps/sandbox: 2.13::gentoo sys-devel/autoconf: 2.13::gentoo, 2.69-r4::gentoo sys-devel/automake: 1.11.6-r3::gentoo, 1.16.1-r1::gentoo sys-devel/binutils: 2.30-r2::gentoo sys-devel/gcc: 7.3.0-r1::gentoo sys-devel/gcc-config: 1.9.1::gentoo sys-devel/libtool: 2.4.6-r5::gentoo sys-devel/make: 4.2.1-r3::gentoo sys-kernel/linux-headers: 4.16-r1::gentoo (virtual/os-headers) sys-libs/glibc: 2.26-r6::gentoo Repositories: gentoo location: /usr/portage sync-type: rsync sync-uri: rsync://rsync.gentoo.org/gentoo-portage priority: -1000 sync-rsync-extra-opts: sync-rsync-verify-max-age: 24 sync-rsync-verify-jobs: 1 sync-rsync-verify-metamanifest: no ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="* -@EULA" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c" CXXFLAGS="-O2 -pipe" DISTDIR="/usr/portage/distfiles" ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://distfiles.gentoo.org" LANG="en_US.utf8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git" PORTAGE_TMPDIR="/var/tmp" USE="X acl alsa amd64 apache2 berkdb bzip2 cairo cdda cddb cli client crypt cups cxx dbus dri eds firefox fortran gdbm gimp git gnome gnome-keyring gpm gstreamer gtk gtk3 iconv icu introspection ipv6 jadetex jpeg jpeg2k latex ldap modules mozilla multilib ncurses nfs nls nptl ogg opengl openmp pam pcre png policykit preview-latex pulseaudio python raw readline seccomp sqlite ssl sudo systemd tcpd test tex theora udev udisks unicode vala xattr xetex xorg zlib" ABI_X86="64" 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" APACHE2_MODULES="alias auth_basic authz_groupfile dav dav_fs authn_file auth_digest" CALLIGRA_FEATURES="karbon plan sheets stage words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-0" POSTGRES_TARGETS="postgres9_5" PYTHON_SINGLE_TARGET="python3_5" PYTHON_TARGETS="python2_7 python3_5" RUBY_TARGETS="ruby22 ruby23" USERLAND="GNU" VIDEO_CARDS="virtualbox" 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: CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS root@localhost:/mnt/cdrom(9)# emerge -pqv '=sys-libs/glibc-2.26-r7::gentoo' [ebuild U ] sys-libs/glibc-2.26-r7 [2.26-r6] USE="(multilib) -audit -caps -debug -doc -gd (-hardened) -headers-only -nscd -profile (-selinux) -suid -systemtap (-vanilla)"
Was troubleshooting this same failure a couple of days ago and found out the user's kernel was missing IA32_EMULATION, can you check for that? Surprisingly, without any 32bit binary support in the kernel, the glibc build gets all the way this far before finally failing.
(In reply to Ben Kohler from comment #1) > Was troubleshooting this same failure a couple of days ago and found out the > user's kernel was missing IA32_EMULATION, can you check for that? > > Surprisingly, without any 32bit binary support in the kernel, the glibc > build gets all the way this far before finally failing. The current kernel was compiled without IA32_EMULATION: root@localhost:/root(20)# zgrep IA32 /proc/config.gz # CONFIG_IA32_EMULATION is not set
After installing the 4.16.8-gentoo kernel with the IA32_EMULATION I was also able to compile glibc-2.26-r7: root@localhost:/root(9)# uname -a Linux localhost 4.16.8-gentoo #1 SMP Fri May 11 00:19:42 CEST 2018 x86_64 Intel(R) Core(TM) i7-3630QM CPU @ 2.40GHz GenuineIntel GNU/Linux root@localhost:/root(10)# zgrep IA32 /proc/config.gz CONFIG_IA32_EMULATION=y # CONFIG_IA32_AOUT is not set root@localhost:/root(11)# qlist -Iv glibc sys-libs/glibc-2.26-r7
Yeah that is a bit silly. Especially since "sln" is just a statically built ln workaround for the case when dynamic linking is not working. Should ask upstream about it.
We've just encountered this issue as well. Note that the Kernel Self Protection Project recommends turning off IA32 support: https://kernsec.org/wiki/index.php/Kernel_Self_Protection_Project/Recommended_Settings It's really surprising that an IA32 binary appears as a pre-compiled blob in the glibc source and is used when better alternatives are present.
(In reply to Hans de Graaff from comment #5) > We've just encountered this issue as well. Note that the Kernel Self > Protection Project recommends turning off IA32 support: > https://kernsec.org/wiki/index.php/Kernel_Self_Protection_Project/ > Recommended_Settings If user enables USE=multilib I think it's expected for package to build 32-bit binaries and run them. > It's really surprising that an IA32 binary appears as a pre-compiled blob in > the glibc source and is used when better alternatives are present. As far as I'm aware there is no 'sln' blob in source tree. glibc-2.28/elf/sln.c is the source for the binary. It's statically linked as part of the build process. It is needed for 'make install' to work when inplace-upgrade happens. If Gentoo does not need it we can override it by setting system's 'ln' (as done for cross-compiling case): Makerules:symbolic-link-prog = $(LN_S)
(In reply to Sergei Trofimovich from comment #6) > As far as I'm aware there is no 'sln' blob in source tree. > glibc-2.28/elf/sln.c is the source for the binary. It's statically linked as > part of the build process. > > It is needed for 'make install' to work when inplace-upgrade happens. > > If Gentoo does not need it we can override it by setting system's 'ln' (as > done for cross-compiling case): > Makerules:symbolic-link-prog = $(LN_S) This actually makes sense since portage takes care of replacing the system files.
Created attachment 552660 [details, diff] tentative patch (won't be added now, just for safekeeping) OK we discussed this and decided that you should have kernel support for the ABIs you want to build. If you don't have that you can expect that things break. So this is from Toolchain a WONTFIX. [The problem *can* be solved with attached (not much tested) patch, but we would like to avoid more Gentoo-specific modifications as much as possible.]
(In reply to Andreas K. Hüttel from comment #8) > Created attachment 552660 [details, diff] [details, diff] > tentative patch (won't be added now, just for safekeeping) > > OK we discussed this and decided that you should have kernel support for the > ABIs you want to build. If you don't have that you can expect that things > break. So this is from Toolchain a WONTFIX. This makes sense. And I would consider this FIXED in glibc 2.27 in the sense that it fails early and clearly now: >>> Running pre-merge checks for sys-libs/glibc-2.27-r6 * Checking general environment sanity. make -j2 -s glibc-test * Checking that IA32 emulation is enabled in the running kernel ... /usr/portage/sys-libs/glibc/glibc-2.27-r6.ebuild: line 664: /var/tmp/portage/sys-libs/glibc-2.27-r6/temp/check-ia32-emulation.elf32: cannot execute binary file: Exec format error