This is an archive of the discontinued LLVM Phabricator instance.

[libcxxabi] Unbreak `LLVM_ENABLE_RUNTIMES=libcxxabi` build v2
Needs RevisionPublic

Authored by Ericson2314 on Aug 23 2022, 8:37 PM.

Details

Reviewers
ldionne
phosek
Group Reviewers
Restricted Project
Summary

New version of D132298.

There is no more fragile IN_LIST. CMake code dealing with libc++ is
pulled out into a (libcxxabi-only) HandleLibCXX module.

I tested this with my distro packaging, replacing D132298. It moves more
code around, but does less because with -DLIBCXXABI_INCLUDE_TESTS=OFF
I don't need to worry about LIBCXXABI_TEST_DEPS containing the other
libraries.

Diff Detail

Event Timeline

Ericson2314 created this revision.Aug 23 2022, 8:37 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 23 2022, 8:37 PM
Herald added a subscriber: mgorny. · View Herald Transcript
Ericson2314 requested review of this revision.Aug 23 2022, 8:37 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 23 2022, 8:37 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
phosek added inline comments.Aug 23 2022, 11:35 PM
libcxxabi/CMakeLists.txt
75

This option is defined after the include(HandleLibCXX) statement but you use its value inside HandleLibCXX.cmake, isn't that always going to evaluate as falsy?

Ericson2314 marked an inline comment as done.Aug 24 2022, 7:12 AM
Ericson2314 added inline comments.
libcxxabi/CMakeLists.txt
75

Oops good point. I was setting that manually so didn't catch.

libcxxabi/cmake/Modules/HandleLibCXX.cmake
5–7

My TARGET cxx-headers trick didn't work because that target isn't defined until afterwords, since libcxx mostly depends on`libcxxabi`.

phosek added inline comments.Sep 3 2022, 9:10 PM
libcxxabi/cmake/Modules/HandleLibCXX.cmake
5–7

Could we use LIBCXXABI_LIBCXX_INCLUDE instead of introducing another option? That is, if LIBCXXABI_LIBCXX_INCLUDE is not empty, it implies using prebuilt libc++ headers.

Ericson2314 marked an inline comment as done.Sep 11 2022, 12:30 PM
Ericson2314 added inline comments.
libcxxabi/cmake/Modules/HandleLibCXX.cmake
5–7

I suppose so, should we rename it something like LIBCXXABI_LIBCXX_INCLUDE_PREBUILT if so?

Per the TODO deprecated libcxxabi/test/lit.site.cfg.in uses this variable and I am not sure why. So that gave me some trepidation about changing things more.

phosek added inline comments.Sep 21 2022, 1:10 AM
libcxxabi/cmake/Modules/HandleLibCXX.cmake
5–7

How about something like LIBCXXABI_EXTERNAL_LIBCXX_INCLUDES?

ldionne requested changes to this revision.Dec 20 2022, 3:50 PM

Taking a step back, is there a reason why we don't simply require libcxx from being in LLVM_ENABLE_RUNTIMES when libcxxabi is in it? After all, libcxxabi has always been an implementation detail of libc++, and while it makes sense to use libc++ without libc++abi, the reverse doesn't make sense.

In other words, I question the use case of passing LLVM_ENABLE_RUNTIMES=libcxxabi without libcxx. Can you expand on this?

libcxxabi/cmake/Modules/HandleLibCXX.cmake
2–3

This should not be customizeable. We're in the monorepo, so we can hardcode the path of libc++ from libc++abi.

5–7

Per the TODO deprecated libcxxabi/test/lit.site.cfg.in

Is that still relevant? I can't find it anymore.

6
This revision now requires changes to proceed.Dec 20 2022, 3:50 PM