Skip to content

Don't force system LLVM libs to be linked staticly #28327

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

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 1 addition & 1 deletion mk/llvm.mk
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ endif
LLVM_LINKAGE_PATH_$(1):=$$(abspath $$(RT_OUTPUT_DIR_$(1))/llvmdeps.rs)
$$(LLVM_LINKAGE_PATH_$(1)): $(S)src/etc/mklldeps.py $$(LLVM_CONFIG_$(1))
$(Q)$(CFG_PYTHON) "$$<" "$$@" "$$(LLVM_COMPONENTS)" "$$(CFG_ENABLE_LLVM_STATIC_STDCPP)" \
$$(LLVM_CONFIG_$(1))
"$$(CFG_LLVM_ROOT)" $$(LLVM_CONFIG_$(1))
endef

$(foreach host,$(CFG_HOST), \
Expand Down
5 changes: 3 additions & 2 deletions src/etc/mklldeps.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@

components = sys.argv[2].split() # splits on whitespace
enable_static = sys.argv[3]
llvm_config = sys.argv[4]
llvm_root = sys.argv[4]
llvm_config = sys.argv[5]

f.write("""// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
Expand Down Expand Up @@ -63,7 +64,7 @@ def run(args):
lib = lib.strip()[1:]
f.write("#[link(name = \"" + lib + "\"")
# LLVM libraries are all static libraries
if 'LLVM' in lib:
if llvm_root == '' and 'LLVM' in lib:
f.write(", kind = \"static\"")
f.write(")]\n")

Expand Down