Skip to content

Commit 1890290

Browse files
committed
llvm: Disable pthread on mingw
llvm supports both win32 native threads and pthread, but configure tries to find pthread first. This manually disables pthread to use native api. This removes libpthreads-2.dll dependency on librustc.
1 parent bf30a21 commit 1890290

File tree

6 files changed

+6
-494
lines changed

6 files changed

+6
-494
lines changed

configure

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -910,9 +910,11 @@ do
910910
# Try to have LLVM pull in as few dependencies as possible (#9397)
911911
LLVM_OPTS="$LLVM_OPTS --disable-zlib --disable-libffi"
912912

913-
# pthreads works badly on mingw-w64 systems: #8996
913+
# Use win32 native thread/lock apis instead of pthread wrapper.
914+
# (llvm's configure tries to find pthread first, so we have to disable it explicitly.)
915+
# Also note that pthreads works badly on mingw-w64 systems: #8996
914916
case "$CFG_BUILD" in
915-
(*w64-mingw32)
917+
(*-mingw32)
916918
LLVM_OPTS="$LLVM_OPTS --disable-pthreads"
917919
;;
918920
esac

src/etc/mklldeps.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,5 @@
5353
lib = lib[2:] # chop of the leading '-l'
5454
print "#[link(name = \"" + lib + "\", kind = \"static\")]"
5555
if os == 'win32':
56-
print "#[link(name = \"pthread\")]"
5756
print "#[link(name = \"imagehlp\")]"
5857
print "extern {}"

src/etc/snapshot.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ def scrub(b):
3232
}
3333

3434
winnt_runtime_deps = ["libgcc_s_dw2-1.dll",
35-
"libstdc++-6.dll",
36-
"libpthread-2.dll"]
35+
"libstdc++-6.dll"]
3736

3837
def parse_line(n, line):
3938
global snapshotfile

0 commit comments

Comments
 (0)