This is an archive of the discontinued LLVM Phabricator instance.

[clang][WebAssembly] Imply -fno-threadsafe-static when threading is disabled
ClosedPublic

Authored by sbc100 on Jan 30 2022, 11:08 AM.

Details

Summary

When we don't enable atomics we completely disabled threading in
which case there is no point in generating thread safe code for
static initialization.

This should always be safe because, in WebAssembly, it is not
possible to link object compiled without the atomics feature into a
mutli-threaded program.

See https://github.com/emscripten-core/emscripten/pull/16152

Diff Detail

Event Timeline

sbc100 created this revision.Jan 30 2022, 11:08 AM
sbc100 requested review of this revision.Jan 30 2022, 11:08 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 30 2022, 11:08 AM
sbc100 updated this revision to Diff 404402.Jan 30 2022, 11:10 AM
  • revert unrelated line
tlively accepted this revision.Jan 31 2022, 11:35 AM
This revision is now accepted and ready to land.Jan 31 2022, 11:35 AM
This revision was landed with ongoing or failed builds.Jan 31 2022, 2:30 PM
This revision was automatically updated to reflect the committed changes.