llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.69k stars 11.87k forks source link

it should be possible to build LLVM without dlopen() support #6178

Open edwintorok opened 14 years ago

edwintorok commented 14 years ago
Bugzilla Link 5806
Version trunk
OS Linux

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.

edwintorok commented 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.