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

Bug 732992

Summary: dev-libs/libtpms fails to compile
Product: Gentoo Linux Reporter: Agostino Sarubbo <ago>
Component: Current packagesAssignee: Christopher Byrne <salah.coronya>
Status: RESOLVED CANTFIX    
Severity: normal CC: llvm, proxy-maint
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build.log
other.tar.bz2
My build.log

Description Agostino Sarubbo gentoo-dev 2020-07-17 06:04:54 UTC
https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/

Issue: dev-libs/libtpms fails to compile.
Discovered on: amd64 (internal ref: tinderbox)

NOTE:
This machine uses a clang/LLVM toolchain.
If you think that this issue is strictly related to clang/LLVM please block bug 408963. If you think that this issue isstrictly related to the LLD linker, please block bug 731004.
Comment 1 Agostino Sarubbo gentoo-dev 2020-07-17 06:05:00 UTC
Created attachment 649624 [details]
build.log

build log and emerge --info
Comment 2 Agostino Sarubbo gentoo-dev 2020-07-17 06:05:04 UTC
Created attachment 649626 [details]
other.tar.bz2

other logs
Comment 3 Christopher Byrne 2020-07-18 17:51:45 UTC
Created attachment 649768 [details]
My build.log

I can't replicate this using clang/lld. The original link error looks  suspicious:

bin/sh ../libtool  --tag=CC   --mode=link x86_64-pc-linux-gnu-gcc -include tpm_library_conf.h -I../include/libtpms -I../include/libtpms -fstack-protector-strong    -O2 -pipe -march=native -frecord-gcc-switches -fno-diagnostics-color -DUSE_OPENSSL_FUNCTIONS_SYMMETRIC=1 -DUSE_OPENSSL_FUNCTIONS_EC=1 -DUSE_OPENSSL_FUNCTIONS_ECDSA=1 -DUSE_OPENSSL_FUNCTIONS_RSA=1  -Wall -Werror -Wreturn-type -Wsign-compare -Wno-self-assign -version-info 7:2:7 -no-undefined -Wl,--version-script=./libtpms.syms -Wl,-O1 -Wl,--as-needed -fuse-ld=lld -Wl,--defsym=__gentoo_check_ldflags__=0  -Wl,-z,relro  -Wl,-z,now    -o libtpms.la -rpath /usr/lib64 libtpms_la-tpm_library.lo libtpms_tpm12.la libtpms_tpm2.la -lcrypto -lcrypto -lcrypto -lcrypto -lcrypto -lcrypto -lcrypto -lcrypto -lcrypto -lcrypto -lcrypto -lcrypto -lcrypto -lcrypto -lcrypto -lcrypto -lcrypto -lcrypto -lcrypto -lcrypto -lcrypto -lcrypto -lcrypto -lcrypto -lcrypto -lcrypto -lcrypto -lcrypto -lcrypto 
libtool: link: x86_64-pc-linux-gnu-gcc -shared  -fPIC -DPIC  .libs/libtpms_la-tpm_library.o  -Wl,--whole-archive ./.libs/libtpms_tpm12.a ./.libs/libtpms_tpm2.a -Wl,--no-whole-archive  -Wl,--as-needed -lcrypto  -fstack-protector-strong -O2 -march=native -Wl,--version-script=./libtpms.syms -Wl,-O1 -fuse-ld=lld -Wl,--defsym=__gentoo_check_ldflags__=0 -Wl,-z -Wl,relro -Wl,-z -Wl,now   -Wl,-soname -Wl,libtpms.so.0 -o .libs/libtpms.so.0.7.2
ld.lld: /var/tmp/portage/sys-devel/lld-10.0.0/work/lld/ELF/Arch/X86_64.cpp:426: virtual lld::elf::RelExpr lld::elf::(anonymous namespace)::X86_64::adjustRelaxExpr(lld::elf::RelType, const uint8_t *, lld::elf::RelExpr) const: Assertion `type == R_X86_64_REX_GOTPCRELX' failed.
Stack dump:
0.	Program arguments: /usr/bin/ld.lld -plugin /usr/libexec/gcc/x86_64-pc-linux-gnu/10.1.0/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/x86_64-pc-linux-gnu/10.1.0/lto-wrapper -plugin-opt=-fresolution=/var/tmp/portage/dev-libs/libtpms-0.7.2/temp/ccX1l90T.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --eh-frame-hdr -m elf_x86_64 -shared -o .libs/libtpms.so.0.7.2 /usr/lib/gcc/x86_64-pc-linux-gnu/10.1.0/../../../../lib64/crti.o /usr/lib/gcc/x86_64-pc-linux-gnu/10.1.0/crtbeginS.o -L/usr/lib/gcc/x86_64-pc-linux-gnu/10.1.0 -L/usr/lib/gcc/x86_64-pc-linux-gnu/10.1.0/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-pc-linux-gnu/10.1.0/../../../../x86_64-pc-linux-gnu/lib -L/usr/lib/gcc/x86_64-pc-linux-gnu/10.1.0/../../.. .libs/libtpms_la-tpm_library.o --whole-archive ./.libs/libtpms_tpm12.a ./.libs/libtpms_tpm2.a --no-whole-archive --as-needed -lcrypto --version-script=./libtpms.syms -O1 --defsym=__gentoo_check_ldflags__=0 -z relro -z now -soname libtpms.so.0 -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/x86_64-pc-linux-gnu/10.1.0/crtendS.o /usr/lib/gcc/x86_64-pc-linux-gnu/10.1.0/../../../../lib64/crtn.o 
 #0 0x00007fbf86a1337f llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/usr/lib/llvm/10/lib64/libLLVM-10.so+0x16de37f)
 #1 0x00007fbf86a11222 llvm::sys::RunSignalHandlers() (/usr/lib/llvm/10/lib64/libLLVM-10.so+0x16dc222)
 #2 0x00007fbf86a138e5 (/usr/lib/llvm/10/lib64/libLLVM-10.so+0x16de8e5)
 #3 0x00007fbf8877f700 __restore_rt (/lib64/libpthread.so.0+0x13700)
 #4 0x00007fbf84f3cf71 raise (/lib64/libc.so.6+0x38f71)
 #5 0x00007fbf84f26537 abort (/lib64/libc.so.6+0x22537)
 #6 0x00007fbf84f2640f (/lib64/libc.so.6+0x2240f)
 #7 0x00007fbf84f353e2 (/lib64/libc.so.6+0x313e2)
 #8 0x00000000004d9ecc (/usr/bin/ld.lld+0x4d9ecc)
 #9 0x000000000053110f (/usr/bin/ld.lld+0x53110f)
#10 0x00000000005213ca (/usr/bin/ld.lld+0x5213ca)
#11 0x00000000004fb1b0 (/usr/bin/ld.lld+0x4fb1b0)
#12 0x00000000003c0015 (/usr/bin/ld.lld+0x3c0015)
#13 0x00000000003b53e6 (/usr/bin/ld.lld+0x3b53e6)
#14 0x00000000003b3a66 (/usr/bin/ld.lld+0x3b3a66)
#15 0x000000000030828a (/usr/bin/ld.lld+0x30828a)
#16 0x00007fbf84f27caa __libc_start_main (/lib64/libc.so.6+0x23caa)
#17 0x0000000000307a7a (/usr/bin/ld.lld+0x307a7a)
collect2: fatal error: ld terminated with signal 6 [Aborted], core dumped
compilation terminated.
make[2]: *** [Makefile:1354: libtpms.la] Error 1
make[2]: Leaving directory '/var/tmp/portage/dev-libs/libtpms-0.7.2/work/libtpms-0.7.2/src'
make[1]: *** [Makefile:515: all-recursive] Error 1
make[1]: Leaving directory '/var/tmp/portage/dev-libs/libtpms-0.7.2/work/libtpms-0.7.2'
make: *** [Makefile:422: all] Error 2
Comment 4 Agostino Sarubbo gentoo-dev 2020-07-18 19:42:20 UTC
it looks like an lld crash.
Comment 5 Christopher Byrne 2021-06-20 21:54:47 UTC
I can't replicate this. Its probably no longer an issue, if it ever was one, since we're now up to lld-12, so I'm closing this. If anyone can replicate feel free to reopen.