[PATCH] D26504: [Support] Use HAVE_DLOPEN to guard dlopen(3) usage

Pavel Labath via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 10 07:22:01 PST 2016


labath created this revision.
labath added reviewers: rafael, beanz.
labath added a subscriber: llvm-commits.
Herald added subscribers: danalbert, tberghammer.

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.


https://reviews.llvm.org/D26504

Files:
  lib/Support/DynamicLibrary.cpp


Index: lib/Support/DynamicLibrary.cpp
===================================================================
--- lib/Support/DynamicLibrary.cpp
+++ lib/Support/DynamicLibrary.cpp
@@ -41,7 +41,7 @@
 
 #else
 
-#if HAVE_DLFCN_H
+#if HAVE_DLOPEN
 #include <dlfcn.h>
 using namespace llvm;
 using namespace llvm::sys;
@@ -119,7 +119,7 @@
       return i->second;
   }
 
-#if HAVE_DLFCN_H
+#if HAVE_DLOPEN
   // Now search the libraries.
   if (OpenedHandles) {
     for (DenseSet<void *>::iterator I = OpenedHandles->begin(),


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26504.77483.patch
Type: text/x-patch
Size: 519 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161110/aaad6f9d/attachment.bin>


More information about the llvm-commits mailing list