Skip to content

Commit

Permalink
build: Don't set -fno-threadsafe-statics on macOS
Browse files Browse the repository at this point in the history
This flag is not set on other platforms so it can produce inconsistent
behaviour across platforms. For example, if you build an async node
add-on which uses statics you can get race conditions due to static
not supporting threads if the node add-on inherits from the Node
common.gypi config. It is not disabled on other platforms such as
Linux, it is not disabled by default in Xcode or clang.

This setting has been there since the initial commit that introduces
`common.gypi` and thus has been there since the start, it doesn't seem
to be have added for any particular reason other than to potentially
match the Xcode defaults at the time.

PR-URL: #22198
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
kylef authored and targos committed Sep 3, 2018
1 parent 887c43f commit efe71e9
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,6 @@
'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
'PREBINDING': 'NO', # No -Wl,-prebind
'MACOSX_DEPLOYMENT_TARGET': '10.7', # -mmacosx-version-min=10.7
'USE_HEADERMAP': 'NO',
Expand Down

0 comments on commit efe71e9

Please sign in to comment.