This is an archive of the discontinued LLVM Phabricator instance.

[libcxxabi] Use an explicit list to export symbols from the dylib
ClosedPublic

Authored by ldionne on Jun 14 2019, 10:20 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

ldionne created this revision.Jun 14 2019, 10:20 AM

I couldn't find an equivalent to -exported_symbols_lists on GNU ld, but I'm all ears.

thakis added a subscriber: thakis.Jun 14 2019, 10:25 AM

add_llvm_symbol_exports in the LLVM CMake files have a cross-platform way of doing export files: http://llvm-cs.pcc.me.uk/cmake/modules/AddLLVM.cmake#71

It compiles to exported_symbols_list on mac, creates a linker script on posix, and creates a def file on Windows.

add_llvm_symbol_exports in the LLVM CMake files have a cross-platform way of doing export files: http://llvm-cs.pcc.me.uk/cmake/modules/AddLLVM.cmake#71

It compiles to exported_symbols_list on mac, creates a linker script on posix, and creates a def file on Windows.

Interesting, thanks for the heads up. It looks like it supports multiple calls with different export lists for the same target, too, right?

However, we'd have to either drop support for the standalone libc++ build or copy the function to libc++'s CMake modules. @EricWF Does this seem okay until we're fully on the monorepo and the standalone libc++ build is no more?

EricWF accepted this revision.Jun 16 2019, 5:11 AM

add_llvm_symbol_exports in the LLVM CMake files have a cross-platform way of doing export files: http://llvm-cs.pcc.me.uk/cmake/modules/AddLLVM.cmake#71

It compiles to exported_symbols_list on mac, creates a linker script on posix, and creates a def file on Windows.

Interesting, thanks for the heads up. It looks like it supports multiple calls with different export lists for the same target, too, right?

However, we'd have to either drop support for the standalone libc++ build or copy the function to libc++'s CMake modules. @EricWF Does this seem okay until we're fully on the monorepo and the standalone libc++ build is no more?

I don't know how well we build w/o an LLVM source dir at the moment, so I would be OK with requiring it. But let's not hold this change up.

This LGTM. Thanks for working on this.

This revision is now accepted and ready to land.Jun 16 2019, 5:11 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJun 27 2019, 1:20 PM