From: Pavel Labath Date: Wed, 30 Nov 2016 15:34:29 +0000 (+0000) Subject: [Support] Use HAVE_DLOPEN to guard dlopen(3) usage X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=731473a9e88f6d097dc7e3ec405a1775cd95dd1e;p=llvm [Support] Use HAVE_DLOPEN to guard dlopen(3) usage 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. Reviewers: rafael, beanz Subscribers: tberghammer, danalbert, llvm-commits Differential Revision: https://reviews.llvm.org/D26504 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288246 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Support/DynamicLibrary.cpp b/lib/Support/DynamicLibrary.cpp index 9a7aeb50a21..ced21e46afe 100644 --- a/lib/Support/DynamicLibrary.cpp +++ b/lib/Support/DynamicLibrary.cpp @@ -41,7 +41,7 @@ char llvm::sys::DynamicLibrary::Invalid = 0; #else -#if HAVE_DLFCN_H +#if defined(HAVE_DLFCN_H) && defined(HAVE_DLOPEN) #include using namespace llvm; using namespace llvm::sys; @@ -119,7 +119,7 @@ void* DynamicLibrary::SearchForAddressOfSymbol(const char *symbolName) { return i->second; } -#if HAVE_DLFCN_H +#if defined(HAVE_DLFCN_H) && defined(HAVE_DLOPEN) // Now search the libraries. if (OpenedHandles) { for (DenseSet::iterator I = OpenedHandles->begin(),