This is an archive of the discontinued LLVM Phabricator instance.

Default to linking lldb-server statically for Android.
ClosedPublic

Authored by chaoren on Jun 30 2015, 6:10 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

chaoren updated this revision to Diff 28835.Jun 30 2015, 6:10 PM
chaoren retitled this revision from to Default to linking lldb-server statically for Android..
chaoren updated this object.
chaoren edited the test plan for this revision. (Show Details)
chaoren added reviewers: tberghammer, vharron.
chaoren added a subscriber: Unknown Object (MLST).
tberghammer added inline comments.Jul 1 2015, 2:17 AM
cmake/platforms/Android.cmake
98–102 ↗(On Diff #28835)

Who will specify the "-pie" flag for API 21+? Without it lldb-server won't work in those API levels.

-pie is not compatible with -static. lldb-server can work on any API if
linked statically.

tberghammer accepted this revision.Jul 1 2015, 10:17 AM
tberghammer edited edge metadata.

Thanks for the explanation.

This revision is now accepted and ready to land.Jul 1 2015, 10:17 AM

What is the implication of this change in terms of the size of lldb-server?

You are linking statically against the system libraries (such as libc, libm, libdl) what might not be a portable solution if they are depending on features only present in some device / kernel.

labath added a subscriber: labath.Jul 2 2015, 2:45 AM

You are linking statically against the system libraries (such as libc, libm, libdl) what might not be a portable solution if they are depending on features only present in some device / kernel.

The platforms should be backward compatible. A binary which works on an older device (statically linked or not) should work on newer devices as well, so I don't anticipate problems of this sort. However, libc is pretty big, so the size question is valid imho.

chaoren added a subscriber: chaoren.Jul 2 2015, 9:45 AM

The resulting binary size is almost identical to the one that's dynamically
linked.

chaoren updated this revision to Diff 29106.Jul 6 2015, 11:04 AM
chaoren edited edge metadata.
  • Add comment for rational.
This revision was automatically updated to reflect the committed changes.