This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] Fix build bustage with threads disabled
ClosedPublic

Authored by glandium on Mar 22 2023, 7:29 PM.

Details

Reviewers
philnik
Group Reviewers
Restricted Project
Commits
rG101cfe18f7b8: [libcxx] Fix build bustage with threads disabled
Summary

Building with -DLIBCXX_ENABLE_THREADS=OFF -DLIBCXXABI_ENABLE_THREADS=OFF
(like e.g. for wasm) fails after D146228 because of a misplaced std
namespace begin/end.

Diff Detail

Event Timeline

glandium created this revision.Mar 22 2023, 7:29 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 22 2023, 7:29 PM
glandium requested review of this revision.Mar 22 2023, 7:29 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 22 2023, 7:29 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
philnik requested changes to this revision.Mar 23 2023, 2:01 AM

Could you maybe give a few more specifics about what the problem is? Not opening the namespace shouldn't result in an error, and we do it this way in lots of places.

This revision now requires changes to proceed.Mar 23 2023, 2:01 AM
philnik accepted this revision.Mar 23 2023, 5:34 AM

I see the problem now. The #ifdef _LIBCPP_HAS_NO_THREADS is split in the middle of the file, which results in a function being defined in the global namespace instead of the standard one. LGTM.

This revision is now accepted and ready to land.Mar 23 2023, 5:34 AM
This revision was landed with ongoing or failed builds.Mar 23 2023, 10:31 AM
This revision was automatically updated to reflect the committed changes.