This is an archive of the discontinued LLVM Phabricator instance.

Only export public symbols with the cmake build.
ClosedPublic

Authored by brucem on Sep 3 2015, 7:40 AM.

Details

Summary

This also moves the xcode support files to be near or the same
as the ones used for cmake.

The source/API/liblldb.xcodes.exports differs from the
source/API/liblldb.exports in that one contains the actual
symbol names (_ prefixed) while the other contains the symbol
names as they are in the code. The liblldb.exports file is
preprocessed by the cmake scripts into the correct per-platform
file needed (like a linker script on Linux).

This is not enabled on Windows as Windows doesn't use the same
name mangling and so it won't be valid there. Also, this is handled
already in a different way on Windows (via dll exports).

Diff Detail

Repository
rL LLVM

Event Timeline

brucem updated this revision to Diff 33942.Sep 3 2015, 7:40 AM
brucem retitled this revision from to Only export public symbols with the cmake build..
brucem updated this object.
brucem added reviewers: emaste, clayborg, labath, chaoren.
brucem added a subscriber: lldb-commits.
brucem added a comment.Sep 3 2015, 7:41 AM

This uses some machinery from LLVM's cmake scripts.

I'm not sure what happens with this on FreeBSD, NetBSD, etc.

labath edited edge metadata.Sep 3 2015, 7:49 AM

The linux parts are ok. This reduces the size of liblldb by about 13%. Good work. :)

tfiala added a subscriber: tfiala.Sep 3 2015, 10:11 AM

The linux parts are ok. This reduces the size of liblldb by about 13%. Good work. :)

13% size decrease sounds nice! Was that with a DebugAsserts build, optimized, or what?

clayborg accepted this revision.Sep 3 2015, 12:00 PM
clayborg edited edge metadata.

Looks fine.

This revision is now accepted and ready to land.Sep 3 2015, 12:00 PM
brucem added a comment.Sep 3 2015, 5:00 PM

tfiala, on Mac OS X with this change, the liblldb.dylib went from 58468408 to 53626572 bytes (release build).

This revision was automatically updated to reflect the committed changes.
labath added a comment.Sep 4 2015, 1:47 AM

13% size decrease sounds nice! Was that with a DebugAsserts build, optimized, or what?

This was a release build (-O3 -DNDEBUG). Size went down from ~58 to ~51 MB.

tfiala, on Mac OS X with this change, the liblldb.dylib went from 58468408 to 53626572 bytes (release build).

Note that this applies to the cmake build on OSX. XCode build uses this already so the size should not be affected.

lldb/trunk/lldb.xcodeproj/project.pbxproj