Skip to content

Commit 9eb613d

Browse files
committed
---
yaml --- r: 150910 b: refs/heads/try2 c: 32a81d1 h: refs/heads/master v: v3
1 parent bd6710c commit 9eb613d

File tree

3 files changed

+26
-9
lines changed

3 files changed

+26
-9
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 30ff17f809869dec37d7b501fb532dc88fd47832
8+
refs/heads/try2: 32a81d1e161a8b4a498c88ddb79955775d18fbfd
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/configure

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -938,13 +938,15 @@ do
938938

939939
LLVM_CXX_64="ccache clang++ -Qunused-arguments"
940940
LLVM_CC_64="ccache clang -Qunused-arguments"
941+
LLVM_OPTS="$LLVM_OPTS --enable-libcpp"
941942
;;
942943
("clang")
943944
LLVM_CXX_32="clang++ -m32 -Qunused-arguments"
944945
LLVM_CC_32="clang -m32 -Qunused-arguments"
945946

946947
LLVM_CXX_64="clang++ -Qunused-arguments"
947948
LLVM_CC_64="clang -Qunused-arguments"
949+
LLVM_OPTS="$LLVM_OPTS --enable-libcpp"
948950
;;
949951
("ccache gcc")
950952
LLVM_CXX_32="ccache g++ -m32"

branches/try2/src/etc/mklldeps.py

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
f.write("#[cfg(" + ', '.join(cfg) + ")]\n")
5757

5858
# LLVM libs
59-
args = [llconfig, '--libs']
59+
args = [llconfig, '--libs', '--system-libs']
6060
args.extend(components)
6161
proc = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
6262
out, err = proc.communicate()
@@ -65,9 +65,13 @@
6565
print("failed to run llconfig: args = `{}`".format(args))
6666
sys.exit(1)
6767

68-
for lib in out.strip().split(' '):
69-
lib = lib[2:] # chop of the leading '-l'
70-
f.write("#[link(name = \"" + lib + "\", kind = \"static\")]\n")
68+
for lib in out.strip().replace("\n", ' ').split(' '):
69+
lib = lib.strip()[2:] # chop of the leading '-l'
70+
f.write("#[link(name = \"" + lib + "\"")
71+
# LLVM libraries are all static libraries
72+
if 'LLVM' in lib:
73+
f.write(", kind = \"static\"")
74+
f.write(")]\n")
7175

7276
# LLVM ldflags
7377
args = [llconfig, '--ldflags']
@@ -82,8 +86,19 @@
8286
if lib[:2] == "-l":
8387
f.write("#[link(name = \"" + lib[2:] + "\")]\n")
8488

85-
#extra
86-
f.write("#[link(name = \"stdc++\")]\n")
87-
if os == 'win32':
88-
f.write("#[link(name = \"imagehlp\")]\n")
89+
# C++ runtime library
90+
args = [llconfig, '--cxxflags']
91+
proc = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
92+
out, err = proc.communicate()
93+
94+
if err:
95+
print("failed to run llconfig: args = `{}`".format(args))
96+
sys.exit(1)
97+
98+
if 'stdlib=libc++' in out:
99+
f.write("#[link(name = \"c++\")]\n")
100+
else:
101+
f.write("#[link(name = \"stdc++\")]\n")
102+
103+
# Attach everything to an extern block
89104
f.write("extern {}\n")

0 commit comments

Comments
 (0)