Skip to content

Commit f401052

Browse files
Make sycl/test/tools/abi_check_positive work with lld linker (#5994)
$ clang --driver-mode=g++ -D_GLIBCXX_ASSERTIONS=1 abi_check_positive.cpp ; nm a.out | grep _dl_relocate_static_pie 0000000000401050 T _dl_relocate_static_pie $ clang -fuse-ld=ld.lld --driver-mode=g++ -D_GLIBCXX_ASSERTIONS=1 abi_check_positive.cpp ; nm a.out | grep _dl_relocate_static_pie 00000000002015e0 t _dl_relocate_static_pie Note, that in order to reproduce it, one has to enable lld as the default linker on the system and just LLVM_ENABLE_LLD=ON/LLVM_USE_LINKER=LLD isn't enough as that doesn't change how the linker is invoked inside the test. Also, relatively recent version of LLD is needed to pass the ABI checks in the built libsycl.so, e.g. LLD-10 doesn't mark aliases produced via linker script (abi_replacements_linux.txt) with Function type. LLD-12 doesn't have that issue.
1 parent b8e6d23 commit f401052

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
__libc_csu_fini
22
__libc_csu_init
3-
_dl_relocate_static_pie
43
_start
54
_Z3foov
65
main

sycl/tools/abi_check.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ def check_symbols(ref_path, target_path):
102102
readobj_out = subprocess.check_output([get_llvm_bin_path()+"llvm-readobj",
103103
readobj_opts, target_path])
104104
symbols = parse_readobj_output(readobj_out)
105+
# Presence of _dl_relocate_static_pie depends on whether ld.gold or ld.lld
106+
# is used. Ignore it for the purpose of the library ABI check.
107+
ignore_symbols = ["_dl_relocate_static_pie"]
108+
symbols = [s for s in symbols if s not in ignore_symbols]
105109

106110
missing_symbols, new_symbols = compare_results(ref_symbols, symbols)
107111

0 commit comments

Comments
 (0)