Skip to content

Commit 391f2dd

Browse files
authored
Merge pull request #29446 from eli-schwartz/system-nondefault-llvm
build: work correctly when linking to a system llvm which is not the default
2 parents f07d461 + d1fab72 commit 391f2dd

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

base/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ endif # WINNT
199199

200200
symlink_libLLVM: $(build_private_libdir)/libLLVM.dylib
201201
$(build_private_libdir)/libLLVM.dylib:
202-
REALPATH=`$(LLVM_CONFIG_HOST) --libdir`/libLLVM.$(SHLIB_EXT) && \
202+
REALPATH=`$(LLVM_CONFIG_HOST) --libfiles` && \
203203
$(call resolve_path,REALPATH) && \
204204
[ -e "$$REALPATH" ] && \
205205
([ ! -e "$@" ] || rm "$@") && \

src/Makefile

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,8 @@ endif
8989
PUBLIC_HEADER_TARGETS := $(addprefix $(build_includedir)/julia/,$(notdir $(PUBLIC_HEADERS)) $(UV_HEADERS))
9090

9191
ifeq ($(JULIACODEGEN),LLVM)
92-
# In LLVM < 3.4, --ldflags includes both options and libraries, so use it both before and after --libs
93-
# In LLVM >= 3.4, --ldflags has only options, and --system-libs has the libraries.
94-
ifneq ($(USE_LLVM_SHLIB),1)
95-
LLVMLINK += $(shell $(LLVM_CONFIG_HOST) --ldflags) $(shell $(LLVM_CONFIG_HOST) --libs $(LLVM_LIBS)) $(shell $(LLVM_CONFIG_HOST) --ldflags) $(shell $(LLVM_CONFIG_HOST) --system-libs 2> /dev/null)
96-
else
97-
LLVMLINK += $(shell $(LLVM_CONFIG_HOST) --ldflags) -lLLVM
92+
LLVMLINK += $(shell $(LLVM_CONFIG_HOST) --ldflags --libs --system-libs)
93+
ifeq ($(USE_LLVM_SHLIB),1)
9894
FLAGS += -DLLVM_SHLIB
9995
endif # USE_LLVM_SHLIB == 1
10096
endif

0 commit comments

Comments
 (0)