Open edwintorok opened 14 years ago
Currently when LLVM is built on *nix, it requires dlopen(). However there may be cases when the dlopen() support is completely unused in a program that uses LLVM (i.e. DisableSymbolSearching, no plugins, etc.).
In that case dlopen() adds additional complications (need to pass -ldl on Linux, nothing and FreeBSD, and who knows what on HP-UX, etc.). Since dlopen is not needed, that seems like unnecessary complication.
Also EngineBuilder::create returns NULL if it can't dlopen self. However the JIT works just fine w/o dlopen.
I suggest LLVM to have a ./configure --disable-dlopen to disable dlopen support, in which case EngineBuilder should still work, and in DynamicLibrary.cpp it should return NULL/error when trying to dlopen something.
Also the backtrace code that uses dladdr should be disabled in this case.
Extended Description
Currently when LLVM is built on *nix, it requires dlopen(). However there may be cases when the dlopen() support is completely unused in a program that uses LLVM (i.e. DisableSymbolSearching, no plugins, etc.).
In that case dlopen() adds additional complications (need to pass -ldl on Linux, nothing and FreeBSD, and who knows what on HP-UX, etc.). Since dlopen is not needed, that seems like unnecessary complication.
Also EngineBuilder::create returns NULL if it can't dlopen self. However the JIT works just fine w/o dlopen.
I suggest LLVM to have a ./configure --disable-dlopen to disable dlopen support, in which case EngineBuilder should still work, and in DynamicLibrary.cpp it should return NULL/error when trying to dlopen something.