This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] Support LIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY + LIBCXX_ENABLE_ABI_LINKER_SCRIPT
ClosedPublic

Authored by nikic on Sep 26 2022, 6:48 AM.

Details

Summary

Currently if both LIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY (only applies to static library) and LIBCXX_ENABLE_ABI_LINKER_SCRIPT (only applies to shared library) are enabled, the former will be silently ignored. The shared library will use a linker script, while the static library fails to link libc++abi.a entirely.

This is caused by what appears to be an implementation bug: The LIBCXX_STATICALLY_LINK_ABI_IN_*_LIBRARY options are declared as dependent options of LIBCXX_ENABLE_STATIC_ABI_LIBRARY, rather than simply using it as the default value.

Of course, the combination of LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY and LIBCXX_ENABLE_ABI_LINKER_SCRIPT still results in a cmake error, because these would be conflicting requests for the shared library.

Diff Detail

Event Timeline

nikic created this revision.Sep 26 2022, 6:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 26 2022, 6:48 AM
nikic requested review of this revision.Sep 26 2022, 6:48 AM
nikic added a reviewer: Restricted Project.
nikic added inline comments.
libcxx/CMakeLists.txt
384

Dropped this entirely, as python is no longer used for this purpose, as far as I know. This is now handled via object targets.

ldionne accepted this revision.Sep 26 2022, 8:50 AM
ldionne added a subscriber: ldionne.

This makes sense to me regardless of the direction we end up taking with D125683.

This revision is now accepted and ready to land.Sep 26 2022, 8:50 AM
This revision was landed with ongoing or failed builds.Sep 27 2022, 1:05 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptSep 27 2022, 1:05 AM