Page MenuHomePhabricator

[CMake] Option to select C++ library for runtimes that use it

Authored by phosek on Jun 17 2022, 2:00 AM.



We currently have an option to select C++ ABI and C++ library for tests
but there are runtimes that use C++ library, specifically ORC and XRay,
which aren't covered by existing options. This change introduces a new
option to control the use of C++ libray for these runtimes.

Ideally, this option should become the default way to select C++ library
for all of compiler-rt replacing the existing options (the C++ ABI
option could remain as a hidden internal option).

Diff Detail

Event Timeline

phosek created this revision.Jun 17 2022, 2:00 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 17 2022, 2:00 AM
phosek requested review of this revision.Jun 17 2022, 2:00 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJun 17 2022, 2:00 AM
Herald added subscribers: Restricted Project, cfe-commits. · View Herald Transcript

I'm aware of the duplication of logic for handling of COMPILER_RT_CXX_LIBRARY and SANITIZER_TEST_CXX_LIBNAME. Right now my goal is to make the use of in-tree libc++ in compiler-rt explicit, and then cleaning up the handling logic in follow up changes.

mstorsjo added inline comments.Jun 17 2022, 2:06 AM

Does this mean that if you set COMPILER_RT_CXX_LIBRARY=libcxx, it's assumed that you're actually _building_ that same libcxx in the same cmake invocation?

I'm currently building compiler-rt in a standalone cmake invocation, separate from all the others, with -DSANITIZER_CXX_ABI=libc++. Building them all at once might be something I could consider at some point, but I wouldn't want to force that situation right now, if it could be avoided?

mstorsjo accepted this revision.Jun 17 2022, 2:20 AM



Oh right, there was such an option too. Right, that'd work fine yeah - sorry for overlooking it.

This revision is now accepted and ready to land.Jun 17 2022, 2:20 AM
This revision was landed with ongoing or failed builds.Jul 8 2022, 3:10 PM
This revision was automatically updated to reflect the committed changes.