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

Bug 743862

Summary: sys-libs/glibc-2.32-r3: /usr/libexec/gcc/x86_64-multilib-linux-gnu/ld: .../sys-libs/glibc-2.32-r3/work/build-x86-x86_64-multilib-linux-gnu- nptl/libc_pic.os: in function `imaxdiv': (.text+0x1bad2): undefined reference to `__divmoddi4'
Product: Gentoo Linux Reporter: Aisha Tammy <gentoo>
Component: Current packagesAssignee: Gentoo Crossdev team <crossdev>
Status: RESOLVED FIXED    
Severity: normal CC: herrtimson, toolchain
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: x86_64-gentoo-linux-gnu-emerge _--info.txt
emerge_--info.txt
package_environment.txt
build_log_snippet.txt
build.log
x86_64-multilib-linux-gnu-emerge --info
emerge --info.txt
package_environment.txt

Description Aisha Tammy 2020-09-21 00:03:34 UTC
The error was while creating a crossdev build for x86_64-gentoo-linux-gnu on a x86_64-pc-linux-gnu machine.

I have verified multilib support on the CBUILD machine.

Relevant snippet (full files attached) - 

 * Package:    sys-libs/glibc-2.32-r1                                                                                                                   [0/1910]
 * Repository: gentoo
 * Maintainer: toolchain@gentoo.org
 * USE:        abi_x86_64 amd64 crypt elibc_glibc kernel_linux multiarch multilib ssp static-libs userland_GNU
 * FEATURES:   ccache network-sandbox preserve-libs sandbox userpriv usersandbox
 * Using python3.8 to build
>>> Unpacking source...
 * Checking that IA32 emulation is enabled in the running kernel ...
/usr/libexec/gcc/x86_64-gentoo-linux-gnu/ld: skipping incompatible /usr/lib/gcc/x86_64-gentoo-linux-gnu/10.2.0/libgcc.a when searching for -lgcc
/usr/libexec/gcc/x86_64-gentoo-linux-gnu/ld: cannot find -lgcc
/usr/libexec/gcc/x86_64-gentoo-linux-gnu/ld: skipping incompatible /usr/lib/gcc/x86_64-gentoo-linux-gnu/10.2.0/libgcc_s.so.1 when searching for libgcc_s.so.1
/usr/libexec/gcc/x86_64-gentoo-linux-gnu/ld: cannot find libgcc_s.so.1
/usr/libexec/gcc/x86_64-gentoo-linux-gnu/ld: skipping incompatible /usr/lib/gcc/x86_64-gentoo-linux-gnu/10.2.0/libgcc.a when searching for -lgcc
/usr/libexec/gcc/x86_64-gentoo-linux-gnu/ld: cannot find -lgcc
collect2: error: ld returned 1 exit status
 * Failed to compile the ABI test. Broken host glibc?
 [ ok ]
 * Checking gcc for __thread support ...
 [ ok ]
 * Checking linux-headers version (5.8.0 >= 3.2.0) ...
 [ ok ]
>>> Unpacking gcc-multilib-bootstrap-20180511.tar.xz to /usr/x86_64-gentoo-linux-gnu/var/tmp/portage/sys-libs/glibc-2.32-r1/work
 *   Manual CFLAGS:   -march=znver1 --param l1-cache-line-size=64 --param l1-cache-size=32 -O2 -pipe
 * strip-flags: CFLAGS: changed '-march=znver1 --param l1-cache-line-size=64 --param l1-cache-size=32 -O2 -pipe' to '-march=znver1 -O2 -pipe'
 * strip-flags: CXXFLAGS: changed '-march=znver1 --param l1-cache-line-size=64 --param l1-cache-size=32 -O2 -pipe' to '-march=znver1 -O2 -pipe'
 * strip-flags: FFLAGS: changed '-march=znver1 --param l1-cache-line-size=64 --param l1-cache-size=32 -O2 -pipe' to '-march=znver1 -O2 -pipe'
 * strip-flags: FCFLAGS: changed '-march=znver1 --param l1-cache-line-size=64 --param l1-cache-size=32 -O2 -pipe' to '-march=znver1 -O2 -pipe'
 *       Manual CC:   x86_64-gentoo-linux-gnu-gcc -m64
>>> Unpacking glibc-2.32.tar.xz to /usr/x86_64-gentoo-linux-gnu/var/tmp/portage/sys-libs/glibc-2.32-r1/work
>>> Unpacking glibc-2.32-patches-1.tar.xz to /usr/x86_64-gentoo-linux-gnu/var/tmp/portage/sys-libs/glibc-2.32-r1/work
>>> Unpacking locale-gen-2.10.tar.gz to /usr/x86_64-gentoo-linux-gnu/var/tmp/portage/sys-libs/glibc-2.32-r1/work
>>> Source unpacked in /usr/x86_64-gentoo-linux-gnu/var/tmp/portage/sys-libs/glibc-2.32-r1/work
>>> Preparing source in /usr/x86_64-gentoo-linux-gnu/var/tmp/portage/sys-libs/glibc-2.32-r1/work/glibc-2.32 ...
.
.
.
Comment 1 Aisha Tammy 2020-09-21 00:06:45 UTC
Created attachment 661716 [details]
x86_64-gentoo-linux-gnu-emerge _--info.txt
Comment 2 Aisha Tammy 2020-09-21 00:08:27 UTC
Created attachment 661719 [details]
emerge_--info.txt

CBUILD emerge --info
Comment 3 Aisha Tammy 2020-09-21 00:08:48 UTC
Comment on attachment 661716 [details]
x86_64-gentoo-linux-gnu-emerge _--info.txt

CHOST emerge --info
Comment 4 Aisha Tammy 2020-09-21 00:11:18 UTC
Created attachment 661722 [details]
package_environment.txt

contents of /usr/x86_64-gentoo-linux-gnu/var/tmp/portage/sys-libs/glibc-2.32-r1/temp/environment
Comment 5 Aisha Tammy 2020-09-21 00:25:01 UTC
Full build.log is present in url - https://openpgpkey.epsilonknot.xyz/build.log

Relevant snippet has been attached here
Comment 6 Aisha Tammy 2020-09-21 00:25:31 UTC
Created attachment 661725 [details]
build_log_snippet.txt

start and end part of build.log
Comment 7 Sergei Trofimovich (RETIRED) gentoo-dev 2020-09-21 07:52:39 UTC
Reproduced locally as:
# crossdev x86_64-gentoo-linux-gnu
# PORTAGE_CONFIGROOT=/usr/x86_64-gentoo-linux-gnu eselect profile set default/linux/amd64/17.1
# x86_64-gentoo-linux-gnu-emerge -v1 glibc

The relevant failure is:

"""
/usr/libexec/gcc/x86_64-gentoo-linux-gnu/ld: /usr/x86_64-gentoo-linux-gnu/var/tmp/portage/sys-libs/glibc-2.32-r1/work/build-x86-x86_64-gentoo-linux-gnu-nptl/libc_pic.os: in function `imaxdiv':
(.text+0x1bad2): undefined reference to `__divmoddi4'
collect2: error: ld returned 1 exit status
"""

Our bundled libgcc.a (part of https://dev.gentoo.org/~dilfridge/distfiles/gcc-multilib-bootstrap-${GCC_BOOTSTRAP_VER}.tar.xz) is outdated and does not contain fresh helpers for _Float128 and _Int128. It needs to be updated.
Comment 8 Aisha Tammy 2020-12-08 10:47:20 UTC
Updated logs and attachments for sys-libs/glibc-2.32-r3
Comment 9 Aisha Tammy 2020-12-08 10:47:54 UTC
Created attachment 677215 [details]
build.log
Comment 10 Aisha Tammy 2020-12-08 10:48:58 UTC
Created attachment 677218 [details]
x86_64-multilib-linux-gnu-emerge --info
Comment 11 Aisha Tammy 2020-12-08 10:49:37 UTC
Created attachment 677221 [details]
emerge --info.txt
Comment 12 Aisha Tammy 2020-12-08 10:51:09 UTC
Created attachment 677224 [details]
package_environment.txt