Skip to content

Don't set `-fno-threadsafe-statics` on macOS as build option

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 so it has been present 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.

Checklist

Merge request reports

Loading