This is an archive of the discontinued LLVM Phabricator instance.

[cmake] Move LLVM_BUILD_STATIC check to an earlier point
ClosedPublic

Authored by labath on Nov 9 2016, 9:55 AM.

Details

Summary

The motivation for this is to enable correct detection of dlopen() on Android.
Android does not provide a static version of libdl, so if we add the -static flag
after performing the check, it will succeed even though subsequent link steps
will fail. With this change we correctly detect the absence of libdl in a
LLVM_BUILD_STATIC build on Android.

The link itself still does not succeed because the code does not check the result
of this check properly, but I plan to fix that in a separate change.

Diff Detail

Repository
rL LLVM

Event Timeline

labath updated this revision to Diff 77369.Nov 9 2016, 9:55 AM
labath retitled this revision from to [cmake] Move LLVM_BUILD_STATIC check to an earlier point.
labath updated this object.
labath added a reviewer: beanz.
labath added subscribers: llvm-commits, tberghammer, srhines.

@beanz, could you give this a quick look?

beanz accepted this revision.Nov 16 2016, 3:57 PM
beanz edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Nov 16 2016, 3:57 PM
This revision was automatically updated to reflect the committed changes.