Skip to content

Commit

Permalink
llvm: Disable pthread on mingw
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
klutzy committed Dec 18, 2013
1 parent bf30a21 commit 1890290
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 494 deletions.
6 changes: 4 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -910,9 +910,11 @@ do
# Try to have LLVM pull in as few dependencies as possible (#9397)
LLVM_OPTS="$LLVM_OPTS --disable-zlib --disable-libffi"

# pthreads works badly on mingw-w64 systems: #8996
# Use win32 native thread/lock apis instead of pthread wrapper.
# (llvm's configure tries to find pthread first, so we have to disable it explicitly.)
# Also note that pthreads works badly on mingw-w64 systems: #8996
case "$CFG_BUILD" in
(*w64-mingw32)
(*-mingw32)
LLVM_OPTS="$LLVM_OPTS --disable-pthreads"
;;
esac
Expand Down
1 change: 0 additions & 1 deletion src/etc/mklldeps.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,5 @@
lib = lib[2:] # chop of the leading '-l'
print "#[link(name = \"" + lib + "\", kind = \"static\")]"
if os == 'win32':
print "#[link(name = \"pthread\")]"
print "#[link(name = \"imagehlp\")]"
print "extern {}"
3 changes: 1 addition & 2 deletions src/etc/snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ def scrub(b):
}

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

def parse_line(n, line):
global snapshotfile
Expand Down
Loading

0 comments on commit 1890290

Please sign in to comment.