This is an archive of the discontinued LLVM Phabricator instance.

[libcxxabi] Build all of libcxxabi with _LIBCPP_BUILDING_LIBRARY defined
ClosedPublic

Authored by mstorsjo on Oct 30 2020, 10:16 AM.

Details

Summary

Various definitions from libcxx need to be set in the same way as if building libcxx itself.

Split out from D90021 as requested by @ldionne.

The comment/define in fallback_malloc.cpp seems to be a bit stale; it was added in 4b47cbccd453c089f0a1d1699dd80718943986d0, but lost its current effect in 42f9868cd80d2e09c75f4642e0a66c7ecd38cf18 and the comment was reworded in 51fbb2e70ae8a2a8df24845f7b6fdf4a1aebce4f without touching the define. - @EricWF

This change in itself shouldn't have any effect on that aspect in fallback_malloc.cpp (whether it works as intended or not) as we still define _LIBCPP_BUILDING_LIBRARY, just defined projectwide now.

Diff Detail

Event Timeline

mstorsjo created this revision.Oct 30 2020, 10:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 30 2020, 10:16 AM
Herald added 1 blocking reviewer(s): Restricted Project. · View Herald Transcript
Herald added a subscriber: mgorny. · View Herald Transcript
mstorsjo requested review of this revision.Oct 30 2020, 10:16 AM

This is definitely a good cleanup IMO. I wonder if this should be taken a step further and use the "standard" (well, as far as CMake is concerned) standard macros of LIBCXX_EXPORTS. Of course, that is probably done better in a subsequent change.

This is definitely a good cleanup IMO. I wonder if this should be taken a step further and use the "standard" (well, as far as CMake is concerned) standard macros of LIBCXX_EXPORTS. Of course, that is probably done better in a subsequent change.

IIRC, we used to rely on this at some point, and then libc++ changed to use a common object library for both the static and shared libraries, at which point you couldn't rely on CMake to define that. I think we we build the static and shared libraries as separate libraries again rather than using the object library (to get PIC right), so the default export macro should be available to us again.

ldionne accepted this revision.Nov 2 2020, 3:35 PM
This revision is now accepted and ready to land.Nov 2 2020, 3:35 PM
This revision was landed with ongoing or failed builds.Nov 2 2020, 11:33 PM
This revision was automatically updated to reflect the committed changes.