Disable dlopen in LLVM, we don't use it.

0.96
Török Edvin 16 years ago
parent ec32c565ba
commit 0b337a2483
  1. 5
      libclamav/c++/llvm/lib/ExecutionEngine/ExecutionEngine.cpp
  2. 5
      libclamav/c++/llvm/lib/ExecutionEngine/JIT/JIT.cpp
  3. 14
      libclamav/c++/llvm/lib/System/DynamicLibrary.cpp

@ -423,8 +423,9 @@ EngineBuilder::EngineBuilder(Module *m) : MP(new ExistingModuleProvider(m)) {
ExecutionEngine *EngineBuilder::create() {
// Make sure we can resolve symbols in the program as well. The zero arg
// to the function tells DynamicLibrary to load the program, not a library.
if (sys::DynamicLibrary::LoadLibraryPermanently(0, ErrorStr))
return 0;
/* CLAMAV LOCAL: allow for no dlopen */
// if (sys::DynamicLibrary::LoadLibraryPermanently(0, ErrorStr))
// return 0;
// If the user specified a memory manager but didn't specify which engine to
// create, we assume they only want the JIT, and we fail if they only want

@ -211,8 +211,9 @@ ExecutionEngine *JIT::createJIT(ModuleProvider *MP,
CodeModel::Model CMM) {
// Make sure we can resolve symbols in the program as well. The zero arg
// to the function tells DynamicLibrary to load the program, not a library.
if (sys::DynamicLibrary::LoadLibraryPermanently(0, ErrorStr))
return 0;
/* CLAMAV LOCAL: no dlopen */
// if (sys::DynamicLibrary::LoadLibraryPermanently(0, ErrorStr))
// return 0;
// Pick a target either via -march or by guessing the native arch.
TargetMachine *TM = JIT::selectTarget(MP, ErrorStr);

@ -44,6 +44,17 @@ void llvm::sys::DynamicLibrary::AddSymbol(const char* symbolName,
#else
#if 1
/* CLAMAV LOCAL: no plugins */
bool llvm::sys::DynamicLibrary::LoadLibraryPermanently(const char *Filename,
std::string *ErrMsg) {
if (ErrMsg) *ErrMsg = "dlopen disabled";
return true;
}
void* llvm::sys::DynamicLibrary::SearchForAddressOfSymbol(const char* symbolName) {
return 0;
}
#else
#include <dlfcn.h>
using namespace llvm;
using namespace llvm::sys;
@ -55,7 +66,6 @@ using namespace llvm::sys;
static std::vector<void *> *OpenedHandles = 0;
bool DynamicLibrary::LoadLibraryPermanently(const char *Filename,
std::string *ErrMsg) {
void *H = dlopen(Filename, RTLD_LAZY|RTLD_GLOBAL);
@ -161,5 +171,5 @@ void* DynamicLibrary::SearchForAddressOfSymbol(const char* symbolName) {
return 0;
}
#endif // LLVM_ON_WIN32
#endif

Loading…
Cancel
Save