[haskell-llvm] unknown symbol `DW.ref.__gxx_personality_v0'

Henning Thielemann lemming at henning-thielemann.de
Sun May 19 17:34:03 BST 2013


On Sun, 19 May 2013, Henning Thielemann wrote:

> I am trying to get llvm-base running with pkg-config. I already got HelloJIT 
> running both with static and dynamic linking. However when running ghci, I 
> get:
>
> examples> ghci-7.6.3 -Wall -package=llvm-tf-3.0.0.0.2 
> -package=llvm-base-3.0.0.2 HelloJIT.hs
> GHCi, version 7.6.3: http://www.haskell.org/ghc/  :? for help
> ...
> Loading package llvm-base-3.0.0.2 ... linking ... ghc: 
> /cabal/lib/llvm-base-3.0.0.2/ghc-7.6.3/HSllvm-base-3.0.0.2.o: unknown symbol 
> `DW.ref.__gxx_personality_v0'
> ghc: unable to load package `llvm-base-3.0.0.2'
>
>
> I suspect that it has to do with the call to LLVMInitializeNativeTarget in 
> extra.cpp. I have read that gxx_personality is for exception handling and can 
> be found in stdc++. I added 'extra-libraries: stdc++' to llvm-base.cabal, but 
> this does not help.
>
> Any idea how to solve that problem?

six hours later ...

I found the problem: It was the -fPIC option suggested by llvm-config:

$ llvm-config --cflags
-I/usr/lib/llvm-3.0/include -DNDEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -g -O2 -fomit-frame-pointer -fPIC

Without the -fPIC option everything works. However, now I don't know what 
to actually write into the Cflags of llvm.pc.



More information about the Haskell-llvm mailing list