Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only use llvm-config for library selection with USE_SYSTEM_LLVM #30459

Merged
merged 1 commit into from
Dec 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion base/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,15 @@ endif
endif # WINNT

symlink_libLLVM: $(build_private_libdir)/libLLVM.dylib
ifneq ($(USE_SYSTEM_LLVM),0)
LLVM_CONFIG_HOST_LIBS := $(shell $(LLVM_CONFIG_HOST) --libfiles)
# HACK: llvm-config doesn't correctly point to shared libs on all platforms
# https://github.com/JuliaLang/julia/issues/29981
else
LLVM_CONFIG_HOST_LIBS := $(shell $(LLVM_CONFIG_HOST) --libdir)/libLLVM.$(SHLIB_EXT)
endif
$(build_private_libdir)/libLLVM.dylib:
REALPATH=`$(LLVM_CONFIG_HOST) --libfiles` && \
REALPATH=$(LLVM_CONFIG_HOST_LIBS) && \
$(call resolve_path,REALPATH) && \
[ -e "$$REALPATH" ] && \
([ ! -e "$@" ] || rm "$@") && \
Expand Down
10 changes: 10 additions & 0 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,17 @@ endif
PUBLIC_HEADER_TARGETS := $(addprefix $(build_includedir)/julia/,$(notdir $(PUBLIC_HEADERS)) $(UV_HEADERS))

ifeq ($(JULIACODEGEN),LLVM)
ifneq ($(USE_SYSTEM_LLVM),0)
LLVMLINK += $(shell $(LLVM_CONFIG_HOST) --ldflags --libs --system-libs)
# HACK: llvm-config doesn't correctly point to shared libs on all platforms
# https://github.com/JuliaLang/julia/issues/29981
else
ifneq ($(USE_LLVM_SHLIB),1)
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)
else
LLVMLINK += $(shell $(LLVM_CONFIG_HOST) --ldflags) -lLLVM
endif
endif
ifeq ($(USE_LLVM_SHLIB),1)
FLAGS += -DLLVM_SHLIB
endif # USE_LLVM_SHLIB == 1
Expand Down