This is an archive of the discontinued LLVM Phabricator instance.

[libc++abi] Default to DLL annotations on Windows
ClosedPublic

Authored by smeenai on Sep 26 2016, 4:54 PM.

Details

Summary

__declspec(dllexport) and __declspec(dllimport) should only be used
when building libc++abi as a DLL, but that's the more common use case,
so default to adding the annotations and add an option to opt out.

Similar to r282449, which made the corresponding change for libc++.

Diff Detail

Repository
rL LLVM

Event Timeline

smeenai updated this revision to Diff 72585.Sep 26 2016, 4:54 PM
smeenai retitled this revision from to [libc++abi] Default to DLL annotations on Windows.
smeenai updated this object.
smeenai added reviewers: compnerd, EricWF, mclow.lists.
smeenai added a subscriber: cfe-commits.
EricWF accepted this revision.Sep 26 2016, 6:43 PM
EricWF edited edge metadata.

LGTM after addressing inline comments. Unfortunately libc++abi doesn't have a way to make _LIBCXXABI_DISABLE_DLL_IMPORT_EXPORT persistent, but this solution works for now.

CMakeLists.txt
255 ↗(On Diff #72585)

We probably want to define _LIBCXXABI_DISABLE_DLL_IMPORT_EXPORT on Windows when LIBCXXABI_ENABLE_SHARED=OFF and LIBCXXABI_ENABLE_STATIC=ON.

This revision is now accepted and ready to land.Sep 26 2016, 6:43 PM
smeenai updated this revision to Diff 72598.Sep 26 2016, 8:49 PM
smeenai edited edge metadata.

Addressing @EricWF's comment

smeenai marked an inline comment as done.Sep 26 2016, 8:49 PM
This revision was automatically updated to reflect the committed changes.