Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 762682 - sys-libs/glibc-2.32-r3 fails: .../bin/ld: /lib/librt.so.1: undefined reference to `__clock_settime@GLIBC_PRIVATE'
Summary: sys-libs/glibc-2.32-r3 fails: .../bin/ld: /lib/librt.so.1: undefined referenc...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL: https://sourceware.org/bugzilla/show_...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-30 21:39 UTC by Albert Zeyer
Modified: 2023-05-27 10:28 UTC (History)
3 users (show)

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


Attachments
build.log (build.log.bz2,145.86 KB, application/x-bzip2)
2020-12-30 21:39 UTC, Albert Zeyer
Details
environment (environment,146.32 KB, text/plain)
2020-12-30 21:41 UTC, Albert Zeyer
Details
#2 - gd with old glibc (02b-media-libs:gd-2.3.0:20210316-195554.log,100.03 KB, text/plain)
2021-03-16 23:22 UTC, Anthony Low
Details
#3 - glibc with old gd and USE=gd (03b-sys-libs:glibc-2.33:20210316-195645.log.xz,189.10 KB, application/x-xz)
2021-03-16 23:24 UTC, Anthony Low
Details
#4 - glibc with old gd and USE=-gd (04c-sys-libs:glibc-2.33:20210316-200119.log.xz,258.83 KB, application/x-xz)
2021-03-16 23:24 UTC, Anthony Low
Details
#5 - gd with new glibc (05b-media-libs:gd-2.3.0:20210316-200516.log,100.03 KB, text/x-log)
2021-03-16 23:24 UTC, Anthony Low
Details
#6 - glibc with new gd and USE=gd (06c-sys-libs:glibc-2.33:20210316-200629.log.xz,258.93 KB, application/x-xz)
2021-03-16 23:25 UTC, Anthony Low
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Albert Zeyer 2020-12-30 21:39:56 UTC
Created attachment 680326 [details]
build.log

$ emerge -pqv '=sys-libs/glibc-2.32-r3::gentoo'
[ebuild     U ] sys-libs/glibc-2.32-r3 [2.27-r6] USE="caps (crypt%*) gd (static-libs%*) -audit (-cet) -compile-locales -custom-cflags% -doc -headers-only -multiarch (-multilib) -nscd -profile (-selinux) -ssp% -static-pie% -suid -systemtap -test% (-vanilla) (-hardened%)" 

!!! The following installed packages are masked:
- dev-libs/protobuf-3.6.1.3::gentoo (masked by: package.mask)
/etc/portage/package.mask:
# resolving some slot conflicts...

- virtual/rubygems-14::gentoo (masked by: package.mask)
- sys-apps/portage-2.3.51-r1::gentoo (masked by: package.mask)
- dev-ruby/rubygems-2.7.9::gentoo (masked by: package.mask)
- dev-python/markupsafe-0.23::gentoo (masked by: package.mask)
For more information, see the MASKED PACKAGES section in the emerge
man page or refer to the Gentoo Handbook.


$ emerge --keep-going --update system

...
i686-pc-linux-gnu-gcc  -march=athlon -pipe -O2 -Wl,-O1 -Wl,--as-needed -Wl,-O1 -Wl,--as-needed  -shared -s
tatic-libgcc -Wl,-O1  -Wl,-z,defs -Wl,-dynamic-linker=/lib/ld-linux.so.2  -B/var/tmp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-nptl/csu/   -Wl,-soname=libmemusage.so -Wl,-z,combreloc -Wl,-z,relro -Wl,-z,now  -L/var/tmp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-nptl -L/var/t
mp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-nptl/math -L/var/tmp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-nptl/elf -L/var/tmp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-nptl/dlfcn -L/var/tmp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-
gnu-nptl/nss -L/var/tmp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-nptl/nis -L/var/tmp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-nptl/rt -L/var/tmp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-nptl/resolv -L/var/tmp/portage/sys-libs/glibc-2.32-r3/work/buil
d-x86-i686-pc-linux-gnu-nptl/mathvec -L/var/tmp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-nptl/support -L/var/tmp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-nptl/crypt -L/var/tmp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-nptl/nptl -Wl,-rpath-link=/var/t
mp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-nptl:/var/tmp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-nptl/math:/var/tmp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-nptl/elf:/var/tmp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-nptl/dlf
cn:/var/tmp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-nptl/nss:/var/tmp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-nptl/nis:/var/tmp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-nptl/rt:/var/tmp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-g
nu-nptl/resolv:/var/tmp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-nptl/mathvec:/var/tmp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-nptl/support:/var/tmp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-nptl/crypt:/var/tmp/portage/sys-libs/glibc-2.32-r3/work/bu
ild-x86-i686-pc-linux-gnu-nptl/nptl -o /var/tmp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-nptl/malloc/libmemusage.so -T /var/tmp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-nptl/shlib.lds /var/tmp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-nptl/csu/abi-no
te.o -Wl,--whole-archive /var/tmp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-nptl/malloc/libmemusage_pic.a -Wl,--no-whole-archive /var/tmp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-nptl/dlfcn/libdl.so.2   -Wl,--start-group /var/tmp/portage/sys-libs/glibc-2.32-r3/work/build-x
86-i686-pc-linux-gnu-nptl/libc.so /var/tmp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-nptl/libc_nonshared.a -Wl,--as-needed /var/tmp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-nptl/elf/ld.so -Wl,--no-as-needed -Wl,--end-group
/usr/lib/gcc/i686-pc-linux-gnu/8.2.0/../../../../i686-pc-linux-gnu/bin/ld: /lib/librt.so.1: undefined reference to `__clock_settime@GLIBC_PRIVATE'                                                                 
/usr/lib/gcc/i686-pc-linux-gnu/8.2.0/../../../../i686-pc-linux-gnu/bin/ld: /lib/librt.so.1: undefined reference to `__clock_getcpuclockid@GLIBC_PRIVATE'                                                           
/usr/lib/gcc/i686-pc-linux-gnu/8.2.0/../../../../i686-pc-linux-gnu/bin/ld: /lib/librt.so.1: undefined reference to `__clock_nanosleep@GLIBC_PRIVATE'
/usr/lib/gcc/i686-pc-linux-gnu/8.2.0/../../../../i686-pc-linux-gnu/bin/ld: /lib/librt.so.1: undefined reference to `__clock_getres@GLIBC_PRIVATE'                                                                  
collect2: error: ld returned 1 exit status          
make[2]: *** [../Rules:215: /var/tmp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-nptl/
malloc/memusagestat] Error 1
make[2]: Leaving directory '/var/tmp/portage/sys-libs/glibc-2.32-r3/work/glibc-2.32/malloc'
make[1]: *** [Makefile:471: malloc/others] Error 2
make[1]: Leaving directory '/var/tmp/portage/sys-libs/glibc-2.32-r3/work/glibc-2.32'
make: *** [Makefile:9: all] Error 2
make: Leaving directory '/var/tmp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-nptl'
 * ERROR: sys-libs/glibc-2.32-r3::gentoo failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=sys-libs/glibc-2.32-r3::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sys-libs/glibc-2.32-r3::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/sys-libs/glibc-2.32-r3/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-libs/glibc-2.32-r3/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-libs/glibc-2.32-r3/work/glibc-2.32'
 * S: '/var/tmp/portage/sys-libs/glibc-2.32-r3/work/glibc-2.32'
 
>>> Failed to emerge sys-libs/glibc-2.32-r3, Log file:
 
>>>  '/var/tmp/portage/sys-libs/glibc-2.32-r3/temp/build.log'
...

$ emerge --info '=sys-libs/glibc-2.32-r3::gentoo'                                           
Portage 2.3.51 (python 3.6.5-final-0, default/linux/x86/17.0, gcc-8.2.0, glibc-2.27-r6, 3.5.7 i686)      
=================================================================                                        
                         System Settings                                                                 
=================================================================                                        
System uname: Linux-3.5.7-i686-AMD_Sempron-tm-_Processor_2800+-with-gentoo-2.7                           
KiB Mem:      495804 total,     29640 free                                                               
KiB Swap:    5242876 total,   4935724 free                                                                
Timestamp of repository gentoo: Sat, 26 Dec 2020 03:30:01 +0000                                           
Head commit of repository gentoo: d6074a6ef8eaad81aae84f74f02fd0f1c30c5d2e                               
sh bash 5.0_p18                                                                                          
ld GNU ld (Gentoo 2.34 p6) 2.34.0                                                                        
distcc 3.2rc1 i686-pc-linux-gnu [disabled]                                                                
app-shells/bash:          5.0_p18::gentoo                                                                
dev-lang/perl:            5.30.3::gentoo
dev-lang/python:          3.4.8::gentoo, 3.6.5::gentoo, 3.8.6-r1::gentoo, 3.9.0-r1::gentoo
dev-util/cmake:           3.9.6::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/openrc:          0.38.3-r1::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.11.6-r3::gentoo, 1.16.1-r1::gentoo
sys-devel/binutils:       2.34-r2::gentoo
sys-devel/gcc:            7.3.0-r3::gentoo, 8.2.0-r6::gentoo
sys-devel/gcc-config:     2.3.2-r1::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.4-r1::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-metamanifest: no
    sync-rsync-extra-opts:
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-jobs: 1
    
ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="*"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=athlon -fomit-frame-pointer -pipe"
CHOST="i686-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/php/apache2-php7.2/ext-active/ /etc/php/cgi-php7.2/ext-active/ /etc/php/cli-php7.2/ex
t-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=athlon -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
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 -march=i686 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sy
nc 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 -march=i686 -pipe"
GENTOO_MIRRORS="http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ ftp:///ftp-stud.fht-esslingen.d
e/pub/Mirrors/gentoo/ ftp://ftp6.uni-erlangen.de/pub/mirrors/gentoo ftp://vlaai.snt.ipv6.utwente.nl/pub/os
/linux/gentoo/ ftp://mirror.nutsmaas.nl/gentoo/"
LANG="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j3"
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 --exclud
e=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X509 a52 aac acl addc apache2 arp arping asm authdaemond bash-completion bayes bcmath berkdb binary b
lksha1 bzip2 caps caps-ng cgi cli client cron crypt cscope ctype ctypes-python cups curl cxx daemon dbus d
hcp drop-root dv e2fs e2fsprogs eai encode exif extensions fam fastcgi filecaps fileinfo filter flac flash
 foomatic ftp gd gdbm gif gmp gnutls gpg hash highlight hpn http iconv idn imap inifile inotify iptables i
pv6 ithreads javascript jemalloc jit jpeg json keyutils kmod leim libglvnd linuxthreads-tls logrotate lz4
lzma lzo mad magic maildir mbox mdnsresponder-compat memcache mhash mime mosh mosh-hardening mp3 mysql mys
qli native-extensions ncurses net netifrc no-htdocs noaudio nojoystick novideo nptl nse ocaml ogg ogg123 o
pcache openmp openssl pam passwordsave pch pci pcntl pcre pdf perl phar php pie pkinit plugins png portage
 posix postscript proxy python qt-static qt3-static quotas readline regex rpc ruby samba sanitize sasl sec
comp sendmail server session sftp sha512 sharedext simplexml slang slp smp sockets socks5 split-usr sqlite
 ssh ssl subversion tcpd tesseract threads tiff tls-heartbeat tokenizer tools truetype tty-helpers udev un
icode unzip update-alternatives urandom usb utempter uuid vda vidix vorbis vtv webdav win32codecs winbind
x86 xanim xattr xml xpm xvid zeroconf zip zlib" ABI_X86="32" APACHE2_MODULES="authn_core authz_core socach
e_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_file authz_dbm authz_groupfi
le authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires
ext_filter file_cache filter headers include info log_config logio mime mime_magic negotiation rewrite set
envif speling status unique_id userdir usertrack vhost_alias auth_digest" CURL_SSL="openssl" ELIBC="glibc"
 KERNEL="linux" PYTHON_SINGLE_TARGET="python3_8" PYTHON_TARGETS="python3_8" RUBY_TARGETS="ruby25" USERLAND
="GNU"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LINGUAS, PORTAGE_BINHOST, PORTAGE_B
UNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Albert Zeyer 2020-12-30 21:41:03 UTC
Created attachment 680329 [details]
environment
Comment 2 Albert Zeyer 2020-12-30 21:46:46 UTC
Maybe this is somehow related? https://github.com/NixOS/nixpkgs/issues/84043
Comment 3 Andreas K. Hüttel archtester gentoo-dev 2020-12-30 22:49:27 UTC
Filed bug upstream. Yes, this looks like it's trying to link to the installed librt.so instead of the just built one.
Comment 4 Andreas K. Hüttel archtester gentoo-dev 2020-12-30 23:16:38 UTC
The error does not come from this command (the joys of parallel build), but from one a few lines up in the build log (linking memusagestat):

i686-pc-linux-gnu-gcc  -march=athlon -pipe -O2 -Wl,-O1 -Wl,--as-needed -Wl,-rpath-link=/var/tmp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-nptl:/var/tmp/portage/sys-libs/gl
ibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-nptl/math:/var/tmp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-nptl/elf:/var/tmp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i
686-pc-linux-gnu-nptl/dlfcn:/var/tmp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-nptl/nss:/var/tmp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-nptl/nis:/
var/tmp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-nptl/rt:/var/tmp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-nptl/resolv:/var/tmp/portage/sys-libs/gl
ibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-nptl/mathvec:/var/tmp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-nptl/support:/var/tmp/portage/sys-libs/glibc-2.32-r3/work/buil
d-x86-i686-pc-linux-gnu-nptl/crypt:/var/tmp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-nptl/nptl -pie -Wl,-O1 -nostdlib -nostartfiles -o /var/tmp/portage/sys-libs/glibc-2.3
2-r3/work/build-x86-i686-pc-linux-gnu-nptl/malloc/memusagestat  -Wl,-O1 -Wl,--as-needed  -Wl,-z,combreloc -Wl,-z,relro  /var/tmp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-
nptl/csu/Scrt1.o /var/tmp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-nptl/csu/crti.o `i686-pc-linux-gnu-gcc  -march=athlon -pipe -O2 -Wl,-O1 -Wl,--as-needed  --print-file-n
ame=crtbeginS.o` /var/tmp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-nptl/malloc/memusagestat.o  -lgd -lpng -lz -lm -Wl,-dynamic-linker=/lib/ld-linux.so.2 -Wl,-z,now /var/t
mp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-nptl/libc.so.6 /var/tmp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-nptl/libc_nonshared.a -Wl,--as-needed 
/var/tmp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-nptl/elf/ld.so -Wl,--no-as-needed -lgcc  `i686-pc-linux-gnu-gcc  -march=athlon -pipe -O2 -Wl,-O1 -Wl,--as-needed  --prin
t-file-name=crtendS.o` /var/tmp/portage/sys-libs/glibc-2.32-r3/work/build-x86-i686-pc-linux-gnu-nptl/csu/crtn.o
Comment 5 Albert Zeyer 2020-12-31 08:33:18 UTC
Same error with glibc-2.31-r7.
Comment 6 Sergei Trofimovich (RETIRED) gentoo-dev 2020-12-31 09:02:49 UTC
Does it happen for you in non-parallel build? Say, in MAKEOPTS=-j1 mode?

I don't see `rt` mentioned anywhere directly and I suspect it might come from libgd.so. If it comes from there then 'USE=-gd emerge -v1 glibc' is worth a try to see if it helps.
Comment 7 Albert Zeyer 2020-12-31 09:22:15 UTC
glibc-2.30-r9 installs fine.
Comment 8 Albert Zeyer 2020-12-31 10:21:50 UTC
glibc-2.32-r3 still fails with the same error, after I installed glibc-2.30-r9.
Comment 9 Albert Zeyer 2020-12-31 11:04:59 UTC
glibc-2.32-r3 installed fine with USE=-gd.
Comment 10 Albert Zeyer 2020-12-31 12:24:26 UTC
After reinstalling gd-2.3.0, installing glibc-2.32-r3 (with USE=gd) worked fine.
Comment 11 Sergei Trofimovich (RETIRED) gentoo-dev 2020-12-31 21:05:06 UTC
I tried to reproduce the failure in x86 chroot with USE=gd and glibc 2.30-r9->2.32-r3 and had no problems. I wonder why you had librt involved at all. Do you happen to have a backup of libgd before you rebuilt it?
Comment 12 Albert Zeyer 2021-01-01 11:07:51 UTC
Unfortunately I don't have any backup.

Maybe it was relevant that libgd was compiled using glibc-2.27-r6 before.
Comment 13 Sergei Trofimovich (RETIRED) gentoo-dev 2021-01-01 14:38:49 UTC
It might be. But it looks unlikely as libgd (and at a glance any of it's depends) does not have time-related symbols.

Could it be that you explicitly used -lrt in LDFLAGS at some point?
Comment 14 Albert Zeyer 2021-01-01 15:00:38 UTC
> Could it be that you explicitly used -lrt in LDFLAGS at some point?

No.

Btw, why do you think that libgd is the cause at all? Why do you think this comes from libgd?

Maybe the USE flag gd had some other effects on glibc which made it compile fine?
Comment 15 Sergei Trofimovich (RETIRED) gentoo-dev 2021-01-01 20:51:25 UTC
(In reply to Albert Zeyer from comment #14)
> > Could it be that you explicitly used -lrt in LDFLAGS at some point?
> 
> No.
> 
> Btw, why do you think that libgd is the cause at all? Why do you think this
> comes from libgd?

It might come from somewhere else as well, like libpng or libz (both sound equally unlikely). You #c10 comment suggest rebuilding it might have a positive effect. That's a best pointer we have.

I don't remember of a similar being ever reported to gentoo bugtracker.

> Maybe the USE flag gd had some other effects on glibc which made it compile
> fine?

My understanding of USE=gd is to only enable memusagestat binary and link it against -lgd -lpng -lz -lm and nothing else: https://sourceware.org/git/?p=glibc.git;a=blob;f=malloc/Makefile;h=39ffaa7161d3027905d6eef349a32b12164e822f;hb=HEAD#l149. But maybe there was some subtle unintended side-effect.
Comment 16 Albert Zeyer 2021-01-01 22:51:20 UTC
In my #c10, I also already had the glibc-2.32-r3 installed (without gd) from before. Maybe that was relevant?

The diff between #c8 and #c9 is only that I used USE=-gd. So that definitely plays some role.

I don't have a good idea here. Maybe we can close this as not reproducible for now. I was already curious when I got the error that I did not find any similar report on the Internet. But now that it is posted here, maybe someone else stumbles upon it.
Comment 17 Sergei Trofimovich (RETIRED) gentoo-dev 2021-01-03 13:31:31 UTC
Yeah. Let's close it as obsolete and let people complain here if it's not true.

Then we'll try to investigate broken system in more detail.
Comment 18 Anthony Low 2021-03-16 20:34:02 UTC
(In reply to Sergei Trofimovich from comment #17)
> Yeah. Let's close it as obsolete and let people complain here if it's not
> true.
> 
> Then we'll try to investigate broken system in more detail.

I experienced this issue on a Funtoo system I administer rather than Gentoo, but it may still be a useful data point.  I was attempting to upgrade from glibc-2.29-r3 to glibc-2.33 with gd-2.3.0 and USE=gd.  In order:

USE=gd emerge =sys-libs/glibc-2.33 failed
emerge =medialibs/gd-2.3.0 succeeded
USE=gd emerge =sys-libs/glibc-2.33 failed
USE=-gd emerge =sys-libs/glibc-2.33 succeeded
emerge =medialibs/gd-2.3.0 succeeded
USE=gd emerge =sys-libs/glibc-2.33 succeeded

I unfortunately didn't read/think closely enough and didn't make binary backups of gd or glibc before attempting the workaround, but I do have build logs if they are necessary.

Investigating the librt dependency, libgd -> libXpm -> libX11 -> libxcb -> libXdmcp -> libbsd -> librt.  I have USE=xpm set, which affects gd.  I imagine that I could have re-emerged gd without the xpm dependency at step 2 and upgraded directly from glibc 2.29-r3 to 2.33.
Comment 19 Sergei Trofimovich (RETIRED) gentoo-dev 2021-03-16 21:49:43 UTC
(In reply to Anthony Low from comment #18)
> (In reply to Sergei Trofimovich from comment #17)
> > Yeah. Let's close it as obsolete and let people complain here if it's not
> > true.
> > 
> > Then we'll try to investigate broken system in more detail.
> 
> I experienced this issue on a Funtoo system I administer rather than Gentoo,
> but it may still be a useful data point.  I was attempting to upgrade from
> glibc-2.29-r3 to glibc-2.33 with gd-2.3.0 and USE=gd.  In order:
> 
> USE=gd emerge =sys-libs/glibc-2.33 failed
> emerge =medialibs/gd-2.3.0 succeeded
> USE=gd emerge =sys-libs/glibc-2.33 failed
> USE=-gd emerge =sys-libs/glibc-2.33 succeeded
> emerge =medialibs/gd-2.3.0 succeeded
> USE=gd emerge =sys-libs/glibc-2.33 succeeded
> 
> I unfortunately didn't read/think closely enough and didn't make binary
> backups of gd or glibc before attempting the workaround, but I do have build
> logs if they are necessary.
> 
> Investigating the librt dependency, libgd -> libXpm -> libX11 -> libxcb ->
> libXdmcp -> libbsd -> librt.  I have USE=xpm set, which affects gd.  I
> imagine that I could have re-emerged gd without the xpm dependency at step 2
> and upgraded directly from glibc 2.29-r3 to 2.33.

Yeah, build logs for all the steps above might be useful.
Comment 20 Anthony Low 2021-03-16 23:22:36 UTC
Created attachment 691884 [details]
#2 - gd with old glibc
Comment 21 Anthony Low 2021-03-16 23:24:05 UTC
Created attachment 691887 [details]
#3 - glibc with old gd and USE=gd
Comment 22 Anthony Low 2021-03-16 23:24:36 UTC
Created attachment 691890 [details]
#4 - glibc with old gd and USE=-gd
Comment 23 Anthony Low 2021-03-16 23:24:55 UTC
Created attachment 691893 [details]
#5 - gd with new glibc
Comment 24 Anthony Low 2021-03-16 23:25:23 UTC
Created attachment 691896 [details]
#6 - glibc with new gd and USE=gd
Comment 25 Anthony Low 2021-03-16 23:27:34 UTC
I've attached the build logs.  I omitted the first glibc build (#1) since it should be "identical" to the second glibc build (#3).
Comment 26 Sergei Trofimovich (RETIRED) gentoo-dev 2021-03-18 20:25:58 UTC
Thank you! I don't see anything unusual in the logs, but I think I now understand where the problem comes from. You might want to fix your environment though (see [1.] below).

A few observations:

1. 'tc-getREADELF' is not found.

  It's probably unrelated to the issue at hand but your new glibc build seems to use outdated toolchain-funcs.eclass:

  > /var/tmp/portage/sys-libs/glibc-2.33/temp/environment: line 1921: tc-getREADELF: command not found

  This means tour overlay is probably with glibc out-of-sync.

2. Identical 'gd' builds:
  Both gd build log file:
   - #2 - gd with old glibc
   - #5 - gd with new glibc 
  are identical. Which probably means they either did not change or some toolchain behaviour changed. Hard to say without a binary and a reproducer.

3. Identical 'glibc' builds:
  Both glibc with gd enabled are identical (un to an error):
   -  #3 - glibc with old gd and USE=gd 
   -  #6 - glibc with new gd and USE=gd
  Which is even more confusing.

I think this means that memusagestat links directly to bits of local and bits of installed libc:

"""
x86_64-pc-linux-gnu-gcc  -march=native -pipe -ggdb -O2 -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,--hash-style=gnu -Wl,-rpath-link=/var/tmp/portage/sys-libs/glibc-2.33/work/build-amd64-x86_64-pc-linux-gnu-nptl:/var/tmp/portage/sys-libs/glibc-2.33/work/build-amd64-x86_64-pc-linux-gnu-nptl/math:/var/tmp/portage/sys-libs/glibc-2.33/work/build-amd64-x86_64-pc-linux-gnu-nptl/elf:/var/tmp/portage/sys-libs/glibc-2.33/work/build-amd64-x86_64-pc-linux-gnu-nptl/dlfcn:/var/tmp/portage/sys-libs/glibc-2.33/work/build-amd64-x86_64-pc-linux-gnu-nptl/nss:/var/tmp/portage/sys-libs/glibc-2.33/work/build-amd64-x86_64-pc-linux-gnu-nptl/nis:/var/tmp/portage/sys-libs/glibc-2.33/work/build-amd64-x86_64-pc-linux-gnu-nptl/rt:/var/tmp/portage/sys-libs/glibc-2.33/work/build-amd64-x86_64-pc-linux-gnu-nptl/resolv:/var/tmp/portage/sys-libs/glibc-2.33/work/build-amd64-x86_64-pc-linux-gnu-nptl/mathvec:/var/tmp/portage/sys-libs/glibc-2.33/work/build-amd64-x86_64-pc-linux-gnu-nptl/support:/var/tmp/portage/sys-libs/glibc-2.33/work/build-amd64-x86_64-pc-linux-gnu-nptl/crypt:/var/tmp/portage/sys-libs/glibc-2.33/work/build-amd64-x86_64-pc-linux-gnu-nptl/nptl -pie -Wl,-O1 -nostdlib -nostartfiles -o /var/tmp/portage/sys-libs/glibc-2.33/work/build-amd64-x86_64-pc-linux-gnu-nptl/malloc/memusagestat  -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,--hash-style=gnu  -Wl,-z,combreloc -Wl,-z,relro  /var/tmp/portage/sys-libs/glibc-2.33/work/build-amd64-x86_64-pc-linux-gnu-nptl/csu/Scrt1.o /var/tmp/portage/sys-libs/glibc-2.33/work/build-amd64-x86_64-pc-linux-gnu-nptl/csu/crti.o `x86_64-pc-linux-gnu-gcc  -march=native -pipe -ggdb -O2 -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,--hash-style=gnu  --print-file-name=crtbeginS.o` /var/tmp/portage/sys-libs/glibc-2.33/work/build-amd64-x86_64-pc-linux-gnu-nptl/malloc/memusagestat.o  -lgd -lpng -lz -lm -Wl,-dynamic-linker=/lib64/ld-linux-x86-64.so.2 -Wl,-z,now /var/tmp/portage/sys-libs/glibc-2.33/work/build-amd64-x86_64-pc-linux-gnu-nptl/libc.so.6 /var/tmp/portage/sys-libs/glibc-2.33/work/build-amd64-x86_64-pc-linux-gnu-nptl/libc_nonshared.a -Wl,--as-needed /var/tmp/portage/sys-libs/glibc-2.33/work/build-amd64-x86_64-pc-linux-gnu-nptl/elf/ld.so -Wl,--no-as-needed -lgcc  `x86_64-pc-linux-gnu-gcc  -march=native -pipe -ggdb -O2 -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,--hash-style=gnu  --print-file-name=crtendS.o` /var/tmp/portage/sys-libs/glibc-2.33/work/build-amd64-x86_64-pc-linux-gnu-nptl/csu/crtn.o
"""

The important bit here is lacking set of -L... options that point to local libc (librt and friends). 

All the other tools glibc bulds never link to anything else than libc.so.6 and we don't see a problem.