Skip to content

Commit 005fd2f

Browse files
topolarityKristofferC
authored and
KristofferC
committed
make: use readelf for LLVM symbol version detection (#54713)
Apparently on some distributions `nm --with-symbol-versions` does not report symbol versions, despite the flag. `readelf` should be a more reliable alternative which is also part of binutils. See spack/spack#44534 (comment) for more information (cherry picked from commit d0f165f)
1 parent 9fac394 commit 005fd2f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ ifeq ($(JULIACODEGEN),LLVM)
119119
ifneq ($(USE_SYSTEM_LLVM),0)
120120
# USE_SYSTEM_LLVM != 0
121121
CG_LLVMLINK += $(LLVM_LDFLAGS) $(shell $(LLVM_CONFIG_HOST) --libs --system-libs)
122-
LLVM_SHLIB_SYMBOL_VERSION := $(shell nm -D --with-symbol-versions $(shell $(LLVM_CONFIG_HOST) --libfiles --link-shared | awk '{print $1; exit}') | \
122+
LLVM_SHLIB_SYMBOL_VERSION := $(shell readelf -W --dyn-syms $(shell $(LLVM_CONFIG_HOST) --libfiles --link-shared | awk '{print $1; exit}') | \
123123
grep _ZN4llvm3Any6TypeId | head -n 1 | sed -ne 's/.*@//p')
124124

125125
# HACK: llvm-config doesn't correctly point to shared libs on all platforms

0 commit comments

Comments
 (0)