RTS linker doesn't support R_X86_64_TPOFF32 (type 23) relocation
- The jvm package uses template haskell and depends on the jni package.
- The jni package uses thread local storage for some JNI environment
- The RTS linker barfs on the
R_X86_64_TPOFF32
relocation:
ghc: .../jni-0.6.1/install/lib/x86_64-linux-ghc-8.6.2/jni-0.6.1-16CB7DVfGUQ9LINnojRASO/HSjni-0.6.1-16CB7DVfGUQ9LINnojRASO.o: unhandled ELF relocation(RelA) type 23
ghc: unable to load package `jni-0.6.1'
Some references
- https://github.com/hjl-tools/x86-psABI/wiki/X86-psABI
- thread local storage extension: https://akkadia.org/drepper/tls.pdf (some kind of definition for
R_X86_64_TPOFF32
available here) - bug report against haskell-ide-engine: https://github.com/haskell/haskell-ide-engine/issues/957
- another missing relocation ticket: #12147 (closed)
Steps to reproduce
Build the jvm package with a static ghc.
Environment
- GHC 8.6.2 built with DYNAMIC_GHC_PROGRAMS=NO
- Operating System: linux (rh6)
- System Architecture: x86-64?
ghc --info
$ ghc --info [("Project name","The Glorious Glasgow Haskell Compilation System") ,("GCC extra via C opts"," -fwrapv -fno-builtin") ,("C compiler command","gcc") ,("C compiler flags"," -fno-stack-protector") ,("C compiler link flags"," -fuse-ld=gold") ,("C compiler supports -no-pie","YES") ,("Haskell CPP command","gcc") ,("Haskell CPP flags","-E -undef -traditional") ,("ld command","ld.gold") ,("ld flags","") ,("ld supports compact unwind","YES") ,("ld supports build-id","YES") ,("ld supports filelist","NO") ,("ld is GNU ld","YES") ,("ar command","ar") ,("ar flags","q") ,("ar supports at file","YES") ,("ranlib command","") ,("touch command","touch") ,("dllwrap command","/bin/false") ,("windres command","/bin/false") ,("libtool command","libtool") ,("perl command","/usr/bin/perl") ,("cross compiling","NO") ,("target os","OSLinux") ,("target arch","ArchX86_64") ,("target word size","8") ,("target has GNU nonexec stack","True") ,("target has .ident directive","True") ,("target has subsections via symbols","False") ,("target has RTS linker","YES") ,("Unregisterised","NO") ,("LLVM llc command","llc") ,("LLVM opt command","opt") ,("LLVM clang command","clang") ,("Project version","8.6.2") ,("Project Git commit id","9448fdce111137bf96e4313b6e23fa45264c0443") ,("Booter version","8.6.3") ,("Stage","2") ,("Build platform","x86_64-unknown-linux") ,("Host platform","x86_64-unknown-linux") ,("Target platform","x86_64-unknown-linux") ,("Have interpreter","YES") ,("Object splitting supported","YES") ,("Have native code generator","YES") ,("Support SMP","YES") ,("Tables next to code","YES") ,("RTS ways","l debug thr thr_debug thr_l thr_p dyn debug_dyn thr_dyn thr_debug_dyn l_dyn thr_l_dyn") ,("RTS expects libdw","NO") ,("Support dynamic-too","YES") ,("Support parallel --make","YES") ,("Support reexported-modules","YES") ,("Support thinning and renaming package flags","YES") ,("Support Backpack","YES") ,("Requires unified installed package IDs","YES") ,("Uses package keys","YES") ,("Uses unit IDs","YES") ,("Dynamic by default","NO") ,("GHC Dynamic","NO") ,("GHC Profiled","NO") ,("Leading underscore","NO") ,("Debug on","False") ,("LibDir",".../lib/ghc-8.6.2") ,("Global Package DB",".../lib/ghc-8.6.2/package.conf.d") ]