[haskell-llvm] dynamic linking
Henning Thielemann
lemming at henning-thielemann.de
Sun Dec 19 16:53:57 EST 2010
I have build LLVM with debugging output and since this becomes rather big,
I have only built the compiler target for my machine. This is no problem
with static linking in Haskell, but with dynamic linking the linker
complains about the missing shared object files of the target backends
that I have not built.
llvm/example$ ghc -Wall -optl -w -dynamic --make -o Vector.dynexe -main-is Vector.main Vector.hs
/home/thielema/.cabal/lib/llvm-0.9.0.1/ghc-6.12.3/libHSllvm-0.9.0.1-ghc6.12.3.so:
undefined reference to `LLVMInitializeSparcTarget'
/home/thielema/.cabal/lib/llvm-0.9.0.1/ghc-6.12.3/libHSllvm-0.9.0.1-ghc6.12.3.so:
undefined reference to `LLVMInitializeMSILTarget'
/home/thielema/.cabal/lib/llvm-0.9.0.1/ghc-6.12.3/libHSllvm-0.9.0.1-ghc6.12.3.so:
undefined reference to `LLVMInitializeMipsTargetInfo'
/home/thielema/.cabal/lib/llvm-0.9.0.1/ghc-6.12.3/libHSllvm-0.9.0.1-ghc6.12.3.so:
undefined reference to `LLVMInitializeARMTarget'
/home/thielema/.cabal/lib/llvm-0.9.0.1/ghc-6.12.3/libHSllvm-0.9.0.1-ghc6.12.3.so:
undefined reference to `LLVMInitializePIC16TargetInfo'
...
I have removed the according modules from the Other-Modules list in
llvm.cabal and then I get cute small running executables! Now I wonder how
the 'llvm' package could manage to automatically ignore non-existent
backends? Is it possible to check at runtime which backends are available
and load them on demand?
More information about the Haskell-llvm
mailing list