| Issue |
87438
|
| Summary |
Failed to build gprofng in binutils with lld
|
| Labels |
lld
|
| Assignees |
|
| Reporter |
5c4lar
|
ld.lld cannot build gprofng in binutils successfully
```
/bin/bash ./libtool --tag=CC --mode=link /usr/bin/clang -Wall -Wno-nonnull-compare -g -O2 -module -avoid-version -Wl,--version-script,../../../gprofng/libcollector/libgprofng.ver -Wl,--no-as-needed -Wl,-lrt -Wl,-ldl -o libgp-collector.la -rpath /usr/local/lib/gprofng libgp_collector_la-gethrtime.lo libgp_collector_la-dispatcher.lo libgp_collector_la-iolib.lo libgp_collector_la-mmaptrace.lo libgp_collector_la-memmgr.lo libgp_collector_la-tsd.lo libgp_collector_la-profile.lo libgp_collector_la-envmgmt.lo libgp_collector_la-linetrace.lo libgp_collector_la-libcol_hwcdrv.lo libgp_collector_la-libcol_hwcfuncs.lo libgp_collector_la-libcol-i386-dis.lo libgp_collector_la-hwprofile.lo libgp_collector_la-jprofile.lo libgp_collector_la-unwind.lo libgp_collector_la-libcol_util.lo libgp_collector_la-collector.lo
libtool: link: /usr/bin/clang -shared -fPIC -DPIC .libs/libgp_collector_la-gethrtime.o .libs/libgp_collector_la-dispatcher.o .libs/libgp_collector_la-iolib.o .libs/libgp_collector_la-mmaptrace.o .libs/libgp_collector_la-memmgr.o .libs/libgp_collector_la-tsd.o .libs/libgp_collector_la-profile.o .libs/libgp_collector_la-envmgmt.o .libs/libgp_collector_la-linetrace.o .libs/libgp_collector_la-libcol_hwcdrv.o .libs/libgp_collector_la-libcol_hwcfuncs.o .libs/libgp_collector_la-libcol-i386-dis.o .libs/libgp_collector_la-hwprofile.o .libs/libgp_collector_la-jprofile.o .libs/libgp_collector_la-unwind.o .libs/libgp_collector_la-libcol_util.o .libs/libgp_collector_la-collector.o -Wl,--version-script -Wl,../../../gprofng/libcollector/libgprofng.ver -Wl,--no-as-needed -Wl,-lrt -Wl,-ldl -Wl,-soname -Wl,libgp-collector.so -o .libs/libgp-collector.so
ld: error: version script assignment of 'GLIBC_2.0' to symbol 'fclose' failed: symbol not defined
ld: error: version script assignment of 'GLIBC_2.0' to symbol 'fdopen' failed: symbol not defined
ld: error: version script assignment of 'GLIBC_2.0' to symbol 'fgetpos' failed: symbol not defined
ld: error: version script assignment of 'GLIBC_2.0' to symbol 'fopen' failed: symbol not defined
ld: error: version script assignment of 'GLIBC_2.0' to symbol 'fsetpos' failed: symbol not defined
ld: error: version script assignment of 'GLIBC_2.0' to symbol 'pthread_cond_timedwait' failed: symbol not defined
ld: error: version script assignment of 'GLIBC_2.0' to symbol 'pthread_cond_wait' failed: symbol not defined
ld: error: version script assignment of 'GLIBC_2.0' to symbol 'pthread_join' failed: symbol not defined
ld: error: version script assignment of 'GLIBC_2.0' to symbol 'sem_wait' failed: symbol not defined
ld: warning: attempt to reassign symbol 'dlopen' of version 'GLIBC_2.0' to version 'GLIBC_2.1'
ld: error: version script assignment of 'GLIBC_2.1' to symbol 'fclose' failed: symbol not defined
ld: error: version script assignment of 'GLIBC_2.1' to symbol 'fdopen' failed: symbol not defined
ld: error: version script assignment of 'GLIBC_2.1' to symbol 'fgetpos64' failed: symbol not defined
ld: error: version script assignment of 'GLIBC_2.1' to symbol 'fopen' failed: symbol not defined
ld: error: version script assignment of 'GLIBC_2.1' to symbol 'fsetpos64' failed: symbol not defined
ld: warning: attempt to reassign symbol 'popen' of version 'GLIBC_2.0' to version 'GLIBC_2.1'
ld: warning: attempt to reassign symbol 'pthread_create' of version 'GLIBC_2.0' to version 'GLIBC_2.1'
ld: error: version script assignment of 'GLIBC_2.1' to symbol 'sem_wait' failed: symbol not defined
ld: error: version script assignment of 'GLIBC_2.2' to symbol 'fgetpos' failed: symbol not defined
ld: error: version script assignment of 'GLIBC_2.2' to symbol 'fgetpos64' failed: symbol not defined
ld: error: version script assignment of 'GLIBC_2.2' to symbol 'fsetpos' failed: symbol not defined
ld: error: version script assignment of 'GLIBC_2.2' to symbol 'fsetpos64' failed: symbol not defined
ld: error: version script assignment of 'GLIBC_2.2' to symbol 'open64' failed: symbol not defined
ld: error: too many errors emitted, stopping now (use --error-limit=0 to see all errors)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[5]: *** [Makefile:567: libgp-collector.la] Error 1
```
Steps to Reproduce:
- Download binutils-2.42
- Configure and build
```
mkdir build
../configure CC=/usr/bin/clang CXX=/usr/bin/clang++ --with-ld=/usr/bin/ld.lld
cd build
make
```
Both the latest 18.1.2 and previous version 14.0.0 shipped with ubuntu have this problem.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs