Emerging sys-libs/glibc-2.32-r1 breaks the library especially portage with "Illegal instruction". Postinst was failing: * (488/489) Generating zu_ZA.ISO-8859-1 ... [ ok ] * (486/489) Generating zh_TW.EUC-TW ... [ ok ] * (484/489) Generating zh_SG.UTF-8 ... [ ok ] * (487/489) Generating zh_TW.UTF-8 ... [ ok ] * (489/489) Generating zu_ZA.UTF-8 ... [ ok ] * Generation complete * Adding locales to archive ... [ ok ] /usr/lib/portage/python3.7/phase-helpers.sh: line 844: 27962 Illegal instruction "${cmd[@]}" * ERROR: sys-libs/glibc-2.32-r1::gentoo failed (postinst phase): * has_version: unexpected ebuild-ipc exit code: 132 * * Call stack: * ebuild.sh, line 125: Called pkg_postinst * environment, line 2652: Called has_version 'sys-auth/libnss-nis' * phase-helpers.sh, line 929: Called ___best_version_and_has_version_common 'sys-auth/libnss-nis' * phase-helpers.sh, line 914: Called die * The specific snippet of code: * die "${FUNCNAME[1]}: unexpected ebuild-ipc exit code: ${retval}" I rolled back the glibc-2.31-r6.tbz2 by tar and successfully rebuild the stable version like this: I_ALLOW_TO_BREAK_MY_SYSTEM=yes emerge -av1 =sys-libs/glibc-2.31-r6 It's a Virtual Machine. # lscpu |grep "Model name" Model name: Intel(R) Xeon(R) CPU E5-2640 v3 @ 2.60GHz I was using these CFLAGS for years: CFLAGS="-march=corei7 -mtune=native -O2 -pipe -fomit-frame-pointer" CXXFLAGS="${CFLAGS} -fvisibility-inlines-hidden" I tried building glibc with different CFLAGS: -march=native -mtune=native OR -march=generic I also tried without -march -mtune (which should effectively be generic?). After every change I also did a emerge -1 libtool gcc binutils before the emerge glibc. It's failing and breaking the system every time.
# emerge --info binutils gcc glibc libtool Portage 3.0.8 (python 3.7.9-final-0, default/linux/amd64/17.1, gcc-10.2.0, glibc-2.32-r1, 5.7.12-gentoo x86_64) ================================================================= System Settings ================================================================= System uname: Linux-5.7.12-gentoo-x86_64-Intel-R-_Xeon-R-_CPU_E5-2640_v3_@_2.60GHz-with-gentoo-2.7 KiB Mem: 4043160 total, 1101628 free KiB Swap: 4194300 total, 3745380 free Timestamp of repository mva: Mon, 21 Sep 2020 16:07:12 +0000 Head commit of repository mva: e96e2d2fe7c443cbe8417dce00f6c1f2464ce52b Timestamp of repository gentoo: Thu, 24 Sep 2020 10:35:39 +0000 Head commit of repository gentoo: e602f5ba2b87c84e954d1083d1d8c00c17abadb5 sh bash 5.0_p18 ld GNU ld (Gentoo 2.34 p6) 2.34.0 distcc 3.3.3 x86_64-pc-linux-gnu [disabled] app-shells/bash: 5.0_p18::gentoo dev-java/java-config: 2.3.1::gentoo dev-lang/perl: 5.30.3-r1::gentoo dev-lang/python: 2.7.18-r3::gentoo, 3.7.9::gentoo, 3.8.5::gentoo, 3.9.0_rc2::gentoo dev-util/cmake: 3.18.2::gentoo dev-util/pkgconfig: 0.29.2::gentoo sys-apps/baselayout: 2.7::gentoo sys-apps/openrc: 0.42.1::gentoo sys-apps/sandbox: 2.20::gentoo sys-devel/autoconf: 2.69-r5::gentoo sys-devel/automake: 1.16.2::gentoo sys-devel/binutils: 2.34-r2::gentoo sys-devel/gcc: 10.2.0-r1::gentoo sys-devel/gcc-config: 2.3.2::gentoo sys-devel/libtool: 2.4.6-r6::gentoo sys-devel/make: 4.3::gentoo sys-kernel/linux-headers: 5.8::gentoo (virtual/os-headers) sys-libs/glibc: 2.32-r1::gentoo Repositories: mva location: /var/db/repos/mva sync-type: git sync-uri: https://github.com/gentoo-mirror/mva.git masters: gentoo portage_local location: /usr/local/portage masters: gentoo gentoo location: /usr/portage sync-type: git sync-uri: https://github.com/gentoo-mirror/gentoo priority: 100 ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="@FREE" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -pipe -fomit-frame-pointer" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/iproute2 /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-O2 -pipe -fomit-frame-pointer -fvisibility-inlines-hidden" DISTDIR="/var/cache/portage/distfiles" EMERGE_DEFAULT_OPTS="--autounmask-write" ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH 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-docompress binpkg-dostrip binpkg-logs buildsyspkg clean-logs compress-build-logs config-protect-if-modified distlocks ebuild-locks fail-clean fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch parallel-install pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://ftp.halifax.rwth-aachen.de/gentoo/ http://de-mirror.org/gentoo/ http://ftp-stud.hs-esslingen.de/pub/Mirrors/gentoo/ " LANG="en_US.UTF-8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" LINGUAS="en de" MAKEOPTS="-j5 -l2" PKGDIR="/var/cache/portage/packages/amd64_i7" 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="acl amd64 berkdb bzip2 cli crypt dri fastcgi fortran gdbm iconv libglvnd libtirpc lzo mmx multilib ncurses nls nptl openmp optimization pam pcre postgres readline seccomp smp split-usr sqlite sse sse2 sse3 sse4_1 sse4_2 ssl ssse3 strong-optimization tcpd unicode vim-syntax xattr zlib" ABI_X86="64" ADA_TARGET="gnat_2018" 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="authn_core authz_core socache_shmcb unixd 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 h eaders include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock grei s isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="evdev" 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="php7-2 php7-3 php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_7" PYTHON_TARGETS="python2_7 python3_7" RUBY_TARGETS="ruby25 ruby26" USERLAND="GNU" VIDEO_CARDS="vmware" 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, INSTALL_MASK, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS ================================================================= Package Settings ================================================================= sys-devel/binutils-2.34-r2::gentoo was built with the following: USE="gold nls plugins -default-gold -doc -multitarget -static-libs -test" ABI_X86="(64)" CFLAGS="-O2 -pipe" CXXFLAGS="-O2 -pipe" FEATURES="strict parallel-fetch usersync binpkg-dostrip clean-logs network-sandbox qa-unresolved-soname-deps fail-clean xattr pid-sandbox preserve-libs usersandbox binpkg-docompress sandbox assume-digests compress-build-logs binpkg-logs parallel-install config-protect-if-modified buildsyspkg fixlafiles userpriv multilib-strict unmerge-logs protect-owned unknown-features-warn distlocks ebuild-locks merge-sync news sfperms i pc-sandbox unmerge-orphans userfetch" sys-devel/gcc-10.2.0-r1::gentoo was built with the following: USE="(cxx) fortran (multilib) nls nptl openmp pch (pie) sanitize ssp vtv (-ada) -d -debug -doc (-fixed-point) -go -graphite (-hardened) -jit (-libssp) -lto -objc -objc++ -objc-gc -pgo -systemtap -test -vanilla -zstd" ABI_X86="(64)" CFLAGS="-pipe -O2" CXXFLAGS="-pipe -O2" FEATURES="preserve-libs parallel-install fail-clean qa-unresolved-soname-deps ipc-sandbox sandbox config-protect-if-modified pid-sandbox binpkg-dostrip news usersync unmerge-logs distlocks buildsyspkg strict protect-owned xattr ebuild-locks fixlafiles sfperms assume-digests usersandbox unmerge-orphans network-sandbox merge-sync userpriv multilib-strict userfetch clean-logs unknown-features-warn binpkg-logs compress-build-l ogs parallel-fetch binpkg-docompress" sys-libs/glibc-2.32-r1::gentoo was built with the following: USE="(crypt) multiarch (multilib) ssp (static-libs) -audit -caps (-cet) -compile-locales -custom-cflags -doc -gd -headers-only -nscd -profile (-selinux) -static-pie -suid -systemtap -test (-vanilla)" ABI_X86="(64)" CFLAGS="-pipe -O2" CXXFLAGS="-pipe -O2" FEATURES="ebuild-locks ipc-sandbox parallel-fetch protect-owned sandbox assume-digests usersandbox qa-unresolved-soname-deps fail-clean buildsyspkg network-sandbox userpriv sfperms unmerge-orphans parallel-install news usersync xattr binpkg-dostrip config-protect-if-modified fixlafiles merge-sync compress-build-logs multilib-strict pid-sandbox distlocks preserve-libs strict unknown-features-warn unmerge-logs binpkg-docompr ess clean-logs binpkg-logs userfetch" sys-devel/libtool-2.4.6-r6::gentoo was built with the following: USE="-vanilla" ABI_X86="(64)"
You will need to extract a backtrace to get the idea what instruction is being used here. Or you can try a patch from bug #740110 and see if it works for you as is: https://sourceware.org/git/?p=glibc.git;a=patch;h=23af890b3f04e80da783ba64e6b6d94822e01d54 You will need to drop it into /etc/portage/patches/sys-libs/glibc/ and rebuild glibc.
The patch solved it. Thanks.
*** This bug has been marked as a duplicate of bug 740110 ***