Skip to content

Commit 7509d77

Browse files
If LLVM is linked into a single library shared object, don't force static linkage, but do so for other cases.
1 parent dca2667 commit 7509d77

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/etc/mklldeps.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ def run(args):
4949
# LLVM libs
5050
args = [llvm_config, '--libs', '--system-libs']
5151

52+
llvm_shared = len(run([llvm_config, '--libs']).strip().split(' ')) == 1
53+
5254
args.extend(components)
5355
out = run(args)
5456
for lib in out.strip().replace("\n", ' ').split(' '):
@@ -63,6 +65,8 @@ def run(args):
6365
elif lib[0] == '-':
6466
lib = lib.strip()[1:]
6567
f.write("#[link(name = \"" + lib + "\"")
68+
if not llvm_shared:
69+
f.write(", kind = \"static\"")
6670
f.write(")]\n")
6771

6872
# LLVM ldflags

0 commit comments

Comments
 (0)