This is an archive of the discontinued LLVM Phabricator instance.

[CMake] Support alternative C++ ABI library
ClosedPublic

Authored by phosek on Feb 24 2019, 4:50 PM.

Details

Diff Detail

Repository
rL LLVM

Event Timeline

phosek created this revision.Feb 24 2019, 4:50 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 24 2019, 4:51 PM
smeenai added inline comments.Feb 24 2019, 9:56 PM
CMakeLists.txt
162 ↗(On Diff #188096)

What's the purpose of the leading semicolon?

165 ↗(On Diff #188096)

Why c++ instead of c++abi?

167 ↗(On Diff #188096)

Why stdc++ instead of supc++?

phosek marked 3 inline comments as done.Feb 25 2019, 12:13 AM
phosek added inline comments.
CMakeLists.txt
162 ↗(On Diff #188096)

TBH I don't really know, this is being used in compiler-rt CMake. AFAIK this is only needed for CMake GUI which I don't have any experience with, I'm fine omitting it.

165 ↗(On Diff #188096)

Not every platform ships separate C++ ABI library, e.g. in our toolchain we combine libc++abi and libc++ into a single library.

167 ↗(On Diff #188096)

The same as above, I'm fine keeping it as supc++ to match the current behavior, although stdc++ seems safer to me.

smeenai added inline comments.Feb 25 2019, 10:20 AM
CMakeLists.txt
162 ↗(On Diff #188096)

I would think it's allowing an empty string as one of the values, but I'm not sure why you'd want that? It's a GUI-only thing though and CMake doesn't enforce it, so I don't think it matters either way.

165 ↗(On Diff #188096)

Fair enough. Last I checked you'd run into issues if libc++ and libc++abi were separate static libraries, since you wouldn't get the linker script that links libc++abi as well as libc++ in that case, but I don't think many people use that setup.

167 ↗(On Diff #188096)

Yeah, I think I'd prefer to keep it as supc++ to match the existing behavior. I'm worried about the case where stdc++ is a static library and you need to link against supc++ separately, for example. (I'm not actually sure if that's a concern with libstdc++ or if they use a linker script even for their static libraries, but I know it's been an issue with libc++ in the past.)

phosek updated this revision to Diff 188236.Feb 25 2019, 12:12 PM
phosek marked 6 inline comments as done.
smeenai added inline comments.Feb 25 2019, 12:17 PM
CMakeLists.txt
165 ↗(On Diff #188096)

Sorry if I was unclear ... I was okay with this one being c++ for the reasons you stated (although the inconsistency with supc++ would be a bit strange). Is this still going to work for you, given you don't ship c++abi?

phosek marked an inline comment as done.Feb 25 2019, 2:13 PM
phosek added inline comments.
CMakeLists.txt
162 ↗(On Diff #188096)

It should work for us, we ship c++abi on Fuchsia, we don't ship c++abi in our Linux host runtime, but for that one I'll have to use TEST_SUITE_CXX_ABI in any case.

phosek marked an inline comment as done.Feb 25 2019, 2:13 PM
phosek added inline comments.
CMakeLists.txt
162 ↗(On Diff #188096)

More generally, I'm fine going with this, and re-evaluate it if it turns out we need c++.

smeenai accepted this revision.Feb 25 2019, 2:14 PM

LGTM, thanks!

This revision is now accepted and ready to land.Feb 25 2019, 2:14 PM
This revision was automatically updated to reflect the committed changes.