Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 670814

Summary: sys-libs/glibc-2.27-r6 crtn.o is broken
Product: Gentoo Linux Reporter: groundflyer <sldg.roman>
Component: Current packagesAssignee: Gentoo Toolchain Maintainers <toolchain>
Status: RESOLVED DUPLICATE    
Severity: critical CC: hydrapolic, slyfox
Priority: High    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Build log sys-libs:glibc-2.27-r6:20181109-182937.log
-march=native expansion
/usr/lib64/crtn.o

Description groundflyer 2018-11-10 07:39:06 UTC
Created attachment 554718 [details]
Build log sys-libs:glibc-2.27-r6:20181109-182937.log

Can't compile any programs after updating sys-libs/glibc to stable 2.27-r6. Builds fail on linkage:

/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../lib64/crtn.o(a.debug_info+0x1000300000000): reloc against `*UND*': error 4
/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
make: *** [Makefile:41: bzip2] Error 1

A section from glibc build log:

 * QA Notice: The following files contain writable and executable sections
 *  Files with such sections will not work properly (or at all!) on some
 *  architectures/operating systems.  A bug should be filed at
 *  https://bugs.gentoo.org/ to make sure the issue is fixed.
 *  For more information, see:
 *
 *    https://wiki.gentoo.org/wiki/Hardened/GNU_stack_quickstart
 *
 *  Please include the following list of files in your report:
 *  Note: Bugs should be filed for the respective maintainers
 *  of the package in question and not hardened@gentoo.org.
 * !WX --- --- usr/lib64/crtn.o

Another section from the log:

x86_64-pc-linux-gnu-objcopy: /var/tmp/portage/sys-libs/glibc-2.27-r6/image/usr/lib64/crtn.o: invalid string offset 16 >= 1 for section `'
x86_64-pc-linux-gnu-objcopy: /var/tmp/portage/sys-libs/glibc-2.27-r6/image/usr/lib64/crtn.o: invalid string offset 51353472 >= 1 for section `'
x86_64-pc-linux-gnu-objcopy: /var/tmp/portage/sys-libs/glibc-2.27-r6/image/usr/lib64/crtn.o: invalid string offset 10 >= 1 for section `'
x86_64-pc-linux-gnu-objcopy: /var/tmp/portage/sys-libs/glibc-2.27-r6/image/usr/lib64/crtn.o: invalid string offset 1 >= 1 for section `'
x86_64-pc-linux-gnu-objcopy: /var/tmp/portage/sys-libs/glibc-2.27-r6/image/usr/lib64/crtn.o: invalid string offset 1 >= 1 for section `'
x86_64-pc-linux-gnu-objcopy: /var/tmp/portage/sys-libs/glibc-2.27-r6/image/usr/lib64/crtn.o: invalid string offset 774910766 >= 1 for section `'
x86_64-pc-linux-gnu-objcopy: /var/tmp/portage/sys-libs/glibc-2.27-r6/image/usr/lib64/crtn.o: invalid string offset 1853125219 >= 1 for section `'
x86_64-pc-linux-gnu-objcopy: /var/tmp/portage/sys-libs/glibc-2.27-r6/image/usr/lib64/crtn.o: invalid string offset 1768697203 >= 1 for section `'
x86_64-pc-linux-gnu-objcopy: /var/tmp/portage/sys-libs/glibc-2.27-r6/image/usr/lib64/crtn.o: invalid string offset 841835362 >= 1 for section `'
x86_64-pc-linux-gnu-objcopy: /var/tmp/portage/sys-libs/glibc-2.27-r6/image/usr/lib64/crtn.o: invalid string offset 64 >= 1 for section `'
x86_64-pc-linux-gnu-objcopy: /var/tmp/portage/sys-libs/glibc-2.27-r6/image/usr/lib64/crtn.o: invalid string offset 1809973252 >= 1 for section `'
x86_64-pc-linux-gnu-objcopy: /var/tmp/portage/sys-libs/glibc-2.27-r6/image/usr/lib64/crtn.o: invalid string offset 16 >= 1 for section `'
x86_64-pc-linux-gnu-objcopy: /var/tmp/portage/sys-libs/glibc-2.27-r6/image/usr/lib64/crtn.o: invalid string offset 51353472 >= 1 for section `'
x86_64-pc-linux-gnu-objcopy: /var/tmp/portage/sys-libs/glibc-2.27-r6/image/usr/lib64/crtn.o: invalid string offset 10 >= 1 for section `'
x86_64-pc-linux-gnu-objcopy: /var/tmp/portage/sys-libs/glibc-2.27-r6/image/usr/lib64/crtn.o: invalid string offset 1 >= 1 for section `'
x86_64-pc-linux-gnu-objcopy: /var/tmp/portage/sys-libs/glibc-2.27-r6/image/usr/lib64/crtn.o: invalid string offset 1 >= 1 for section `'
x86_64-pc-linux-gnu-objcopy: /var/tmp/portage/sys-libs/glibc-2.27-r6/image/usr/lib64/crtn.o: invalid string offset 774910766 >= 1 for section `'
x86_64-pc-linux-gnu-objcopy: /var/tmp/portage/sys-libs/glibc-2.27-r6/image/usr/lib64/crtn.o: invalid string offset 1853125219 >= 1 for section `'
x86_64-pc-linux-gnu-objcopy: /var/tmp/portage/sys-libs/glibc-2.27-r6/image/usr/lib64/crtn.o: invalid string offset 1768697203 >= 1 for section `'
x86_64-pc-linux-gnu-objcopy: /var/tmp/portage/sys-libs/glibc-2.27-r6/image/usr/lib64/crtn.o: invalid string offset 841835362 >= 1 for section `'
x86_64-pc-linux-gnu-objcopy: /var/tmp/portage/sys-libs/glibc-2.27-r6/image/usr/lib64/crtn.o: invalid string offset 64 >= 1 for section `'
x86_64-pc-linux-gnu-objcopy: /var/tmp/portage/sys-libs/glibc-2.27-r6/image/usr/lib64/crtn.o: invalid string offset 1809973252 >= 1 for section `'

emerge --info:

Portage 2.3.51 (python 3.6.5-final-0, default/linux/amd64/17.0, gcc-7.3.0, glibc-2.27-r6, 4.9.122-gentoo x86_64)
=================================================================
System uname: Linux-4.9.122-gentoo-x86_64-Intel-R-_Core-TM-_i7-2670QM_CPU_@_2.20GHz-with-gentoo-2.4.1
KiB Mem:    16339192 total,   8032224 free
KiB Swap:    1959892 total,   1959892 free
Timestamp of repository gentoo: Fri, 09 Nov 2018 11:00:01 +0000
Head commit of repository gentoo: 69f363c1d5d04425afd74918877cd52dd037ab25
sh bash 4.4_p12
ld GNU ld (Gentoo 2.30 p2) 2.30.0
app-shells/bash:          4.4_p12::gentoo
dev-lang/perl:            5.24.3-r1::gentoo
dev-lang/python:          2.7.15::gentoo, 3.6.5::gentoo
dev-util/cmake:           3.9.6::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.4.1-r2::gentoo
sys-apps/openrc:          0.34.11::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.15.1-r2::gentoo
sys-devel/binutils:       2.30-r2::gentoo
sys-devel/gcc:            6.4.0-r1::gentoo, 7.3.0-r3::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 4.13::gentoo (virtual/os-headers)
sys-libs/glibc:           2.27-r6::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-jobs: 1
    sync-rsync-extra-opts: 

shmoster
    location: /usr/local/portage
    masters: gentoo

bumblebee
    location: /var/lib/layman/bumblebee
    masters: gentoo
    priority: 50

calculate
    location: /var/lib/layman/calculate
    masters: gentoo
    priority: 50

deadbeef-overlay
    location: /var/lib/layman/deadbeef-overlay
    masters: gentoo
    priority: 50

ennui
    location: /var/lib/layman/ennui
    masters: gentoo
    priority: 50

gentoo-zh
    location: /var/lib/layman/gentoo-zh
    masters: gentoo
    priority: 50

palemoon
    location: /var/lib/layman/palemoon
    masters: gentoo
    priority: 50

reagentoo
    location: /var/lib/layman/reagentoo
    masters: gentoo
    priority: 50

science
    location: /var/lib/layman/science
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -pipe -O2"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /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/pam.d/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -pipe -O2"
DISTDIR="/usr/portage/distfiles"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN 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="-march=native"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_GB.UTF-8"
LC_ALL=""
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="ru en"
MAKEOPTS="-j8"
PKGDIR="/usr/portage/packages"
PORTAGE_BINHOST="http://gentoo.wever.org/x86_64/core2/ http://binhost.ossdl.de/x86_64-pc-linux-gnu-nocona/"
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 bash-completion berkdb bzip2 cli crypt cxx dbus dri ffmpeg fontconfig fortran gdbm iconv icu ipv6 jpeg lapack libtirpc mp3 ncurses nls nptl ogg openmp pam pcre png python readline seccomp sqlite ssl tcpd theora truetype unicode v4l vaapi vim-syntax vorbis x264 xattr 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="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 headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon plan sheets stage words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" 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="evdev synaptics" KERNEL="linux" L10N="ru en" 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-1" POSTGRES_TARGETS="postgres9_5 postgres10" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6" RUBY_TARGETS="ruby23" USERLAND="GNU" VIDEO_CARDS="intel i965 nvidia" 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, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Sergei Trofimovich (RETIRED) gentoo-dev 2018-11-10 12:10:58 UTC
Please attach /usr/lib64/crtn.o itself

and expand your -march=native value: https://wiki.gentoo.org/wiki/Gcc-ICE-reporting-guide#Expand_-march.3Dnative.2C_exact_gcc_version_and_other_system-specific_options

Let's see if we can infer what broke the debug section of crtn.o.
Comment 2 groundflyer 2018-11-11 06:01:48 UTC
Created attachment 554810 [details]
-march=native expansion
Comment 3 groundflyer 2018-11-11 06:02:41 UTC
Created attachment 554812 [details]
/usr/lib64/crtn.o
Comment 4 groundflyer 2018-11-11 06:06:15 UTC
Manually built glibc-2.27, without Gentoo patches, contains working crtn.o
Comment 5 Sergei Trofimovich (RETIRED) gentoo-dev 2018-11-11 10:23:49 UTC
(In reply to groundflyer from comment #3)
> Created attachment 554812 [details]
> /usr/lib64/crtn.o

Was this crtn.o built on your machine at all? You have a few binhost set. Could it be you have pulled broken glibc from there?

The symtab is broken in a way similar to bug #666954: section names are either missing or off-by-one letter, .symtab section contains broken symbols.    

But to achieve that you needed to have debugedit installed and FEATURES=installsources set. I see none of it in your emerge --info.

Perhaps you have per-package package.env? Also note: broken =dev-util/debugedit-4.14.2 is masked.
Comment 6 groundflyer 2018-11-11 13:12:42 UTC
So what was the case. I've just discovered old package.env with:
sys-libs/glibc debugsyms installsources

Removing it fixes the problem. Can't recall why I added it.

Thanks for the help.
Comment 7 Sergei Trofimovich (RETIRED) gentoo-dev 2018-11-11 14:45:45 UTC

*** This bug has been marked as a duplicate of bug 666954 ***