Skip to content

Commit

Permalink
fixes nim-lang#18146; fixes nim-lang#19372; disable tlsEmulation on w…
Browse files Browse the repository at this point in the history
…indows; static link pthreads with mingw (nim-lang#21668)

* fixes nim-lang#18146; disable tlsEmulation on windows; static link libwinthreads DLL

* whatever
  • Loading branch information
ringabout authored and bung87 committed Jul 29, 2023
1 parent 4bcbe9c commit 8dbce4f
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion compiler/nim.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ threads:off

@if windows:
cincludes: "$lib/wrappers/libffi/common"
tlsEmulation:off
@end

define:useStdoutAsStdmsg
Expand Down
2 changes: 1 addition & 1 deletion config/nim.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ nimblepath="$home/.nimble/pkgs/"
# Configuration for the GNU C/C++ compiler:
@if windows:
#gcc.path = r"$nim\dist\mingw\bin"
@if gcc or tcc:
@if tcc:
tlsEmulation:on
@end
@end
Expand Down
4 changes: 4 additions & 0 deletions lib/std/typedthreads.nim
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
##
## deinitLock(L)


when defined(windows) and defined(gcc) and (not compileOption("tlsEmulation")):
{.passl: "-Wl,-Bstatic -lpthread -Wl,-Bdynamic".}

import std/private/[threadtypes]
export Thread

Expand Down
2 changes: 0 additions & 2 deletions tests/config.nims
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ switch("define", "nimPreviewDotLikeOps")
switch("define", "nimPreviewJsonutilsHoleyEnum")
switch("define", "nimPreviewHashRef")
switch("define", "nimPreviewRangeDefault")
when defined(windows):
switch("tlsEmulation", "off")

switch("warningAserror", "UnnamedBreak")
switch("legacy", "verboseTypeMismatch")
2 changes: 0 additions & 2 deletions tests/ic/config.nims
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
when defined(windows):
--tlsEmulation:off
--mm:refc

0 comments on commit 8dbce4f

Please sign in to comment.