Skip to content

Commit

Permalink
Don't hardcode LLVM version number (#49051)
Browse files Browse the repository at this point in the history
  • Loading branch information
vchuravy committed Apr 1, 2023
1 parent 121dca6 commit b8057f3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions base/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ BUILDDIR := .
JULIAHOME := $(abspath $(SRCDIR)/..)
include $(JULIAHOME)/Make.inc

# import LLVM_SHARED_LIB_NAME
include $(JULIAHOME)/deps/llvm-ver.make

TAGGED_RELEASE_BANNER := ""

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)
Expand Down Expand Up @@ -57,6 +60,7 @@ else
@echo "const USE_GPL_LIBS = false" >> $@
endif
@echo "const libllvm_version_string = \"$$($(LLVM_CONFIG_HOST) --version)\"" >> $@
@echo "const libllvm_name = \"$(LLVM_SHARED_LIB_NAME)\"" >> $@
@echo "const VERSION_STRING = \"$(JULIA_VERSION)\"" >> $@
@echo "const TAGGED_RELEASE_BANNER = \"$(TAGGED_RELEASE_BANNER)\"" >> $@
ifeq ($(OS),WINNT)
Expand Down
2 changes: 1 addition & 1 deletion base/binaryplatforms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ function detect_cxxstring_abi()
end

function open_libllvm(f::Function)
for lib_name in ("libLLVM-14jl", "libLLVM", "LLVM", "libLLVMSupport")
for lib_name in (Base.libllvm_name, "libLLVM", "LLVM", "libLLVMSupport")
hdl = Libdl.dlopen_e(lib_name)
if hdl != C_NULL
try
Expand Down
4 changes: 2 additions & 2 deletions stdlib/libLLVM_jll/src/libLLVM_jll.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ libLLVM_handle = C_NULL
libLLVM_path = ""

if Sys.iswindows()
const libLLVM = "libLLVM-14jl.dll"
const libLLVM = "$(Base.libllvm_name).dll"
elseif Sys.isapple()
const libLLVM = "@rpath/libLLVM.dylib"
else
const libLLVM = "libLLVM-14jl.so"
const libLLVM = "$(Base.libllvm_name).so"
end

function __init__()
Expand Down

0 comments on commit b8057f3

Please sign in to comment.