Skip to content

Commit b8057f3

Browse files
authored
Don't hardcode LLVM version number (#49051)
1 parent 121dca6 commit b8057f3

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

base/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ BUILDDIR := .
33
JULIAHOME := $(abspath $(SRCDIR)/..)
44
include $(JULIAHOME)/Make.inc
55

6+
# import LLVM_SHARED_LIB_NAME
7+
include $(JULIAHOME)/deps/llvm-ver.make
8+
69
TAGGED_RELEASE_BANNER := ""
710

811
all: $(addprefix $(BUILDDIR)/,pcre_h.jl errno_h.jl build_h.jl.phony features_h.jl file_constants.jl uv_constants.jl version_git.jl.phony)
@@ -57,6 +60,7 @@ else
5760
@echo "const USE_GPL_LIBS = false" >> $@
5861
endif
5962
@echo "const libllvm_version_string = \"$$($(LLVM_CONFIG_HOST) --version)\"" >> $@
63+
@echo "const libllvm_name = \"$(LLVM_SHARED_LIB_NAME)\"" >> $@
6064
@echo "const VERSION_STRING = \"$(JULIA_VERSION)\"" >> $@
6165
@echo "const TAGGED_RELEASE_BANNER = \"$(TAGGED_RELEASE_BANNER)\"" >> $@
6266
ifeq ($(OS),WINNT)

base/binaryplatforms.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,7 @@ function detect_cxxstring_abi()
904904
end
905905

906906
function open_libllvm(f::Function)
907-
for lib_name in ("libLLVM-14jl", "libLLVM", "LLVM", "libLLVMSupport")
907+
for lib_name in (Base.libllvm_name, "libLLVM", "LLVM", "libLLVMSupport")
908908
hdl = Libdl.dlopen_e(lib_name)
909909
if hdl != C_NULL
910910
try

stdlib/libLLVM_jll/src/libLLVM_jll.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ libLLVM_handle = C_NULL
1919
libLLVM_path = ""
2020

2121
if Sys.iswindows()
22-
const libLLVM = "libLLVM-14jl.dll"
22+
const libLLVM = "$(Base.libllvm_name).dll"
2323
elseif Sys.isapple()
2424
const libLLVM = "@rpath/libLLVM.dylib"
2525
else
26-
const libLLVM = "libLLVM-14jl.so"
26+
const libLLVM = "$(Base.libllvm_name).so"
2727
end
2828

2929
function __init__()

0 commit comments

Comments
 (0)