This is an archive of the discontinued LLVM Phabricator instance.

[Support] Use HAVE_DLOPEN to guard dlopen(3) usage
ClosedPublic

Authored by labath on Nov 10 2016, 7:21 AM.

Details

Summary

The usage was previously guarded by HAVE_DLFCN. This breaks on Android with
LLVM_BUILD_STATIC as the platform does not provide a static version of libdl.
Using HAVE_DLOPEN fixes it as the code will only get used if we are actually able
to link an executable using dlopen.

Diff Detail

Repository
rL LLVM

Event Timeline

labath updated this revision to Diff 77483.Nov 10 2016, 7:21 AM
labath retitled this revision from to [Support] Use HAVE_DLOPEN to guard dlopen(3) usage.
labath updated this object.
labath added reviewers: rafael, beanz.
labath added a subscriber: llvm-commits.

Do you have any objections to this going in? (If I chose the wrong reviewers, let me know).

joerg added a subscriber: joerg.Nov 29 2016, 4:49 AM

Please use #if defined(HAVE_DLFCN_H) && defined(HAVE_DLOPEN) in both places, otherwise LGTM.

labath updated this revision to Diff 79572.Nov 29 2016, 8:01 AM

Thank you for checking this out.

HAVE_DLOPEN is defined only if HAVE_DLFCN_H is detected, but I suppose it doesn't hurt to be explicit.

This revision was automatically updated to reflect the committed changes.