Bug#1023649: ghc: FTBFS haskell-random powerpc (ghc Segmentation fault)
John Paul Adrian Glaubitz
glaubitz at physik.fu-berlin.de
Sun Oct 15 20:01:32 BST 2023
Hello!
I have built a patched version 9.0.1 of GHC for powerpc with a forged 9.0.3 version
number and uploaded it to unreleased so that we have a working bootstrap compiler
to build 9.4.7 for powerpc once the bug has been fixed.
Unfortunately, we're running into another familiar problem which is a missing -latomic
when building hadrian using the bootstrap.py script which does not take any build flags,
the build of the »shake« package fails with the linker complaining about unresolved
references to 64-bit atomic helper functions:
Linking /home/glaubitz/ghc18/ghc-9.4.7/hadrian/_build/dists/shake-0.19.4/build/shake/shake ...
/usr/bin/ld: /usr/lib/ghc/rts/libHSrts_thr.a(STM.thr_o): in function `stmStartTransaction':
(.text.stmStartTransaction+0xe4): undefined reference to `__atomic_load_8'
/usr/bin/ld: (.text.stmStartTransaction+0xfc): undefined reference to `__atomic_store_8'
/usr/bin/ld: /usr/lib/ghc/rts/libHSrts_thr.a(STM.thr_o): in function `stmCommitTransaction':
(.text.stmCommitTransaction+0x40): undefined reference to `__atomic_load_8'
/usr/bin/ld: (.text.stmCommitTransaction+0x118): undefined reference to `__atomic_load_8'
/usr/bin/ld: /usr/lib/ghc/rts/libHSrts_thr.a(ThreadPaused.thr_o): in function `threadPaused':
(.text.threadPaused+0x314): undefined reference to `__atomic_load_8'
/usr/bin/ld: (.text.threadPaused+0x32c): undefined reference to `__atomic_store_8'
/usr/bin/ld: /usr/lib/ghc/rts/libHSrts_thr.a(Threads.thr_o): in function `tryWakeupThread':
(.text.tryWakeupThread+0x194): undefined reference to `__atomic_load_8'
/usr/bin/ld: (.text.tryWakeupThread+0x1a8): undefined reference to `__atomic_store_8'
/usr/bin/ld: (.text.tryWakeupThread+0x1c4): undefined reference to `__atomic_load_8'
(...)
/usr/bin/ld: (.text.throwToMsg+0x444): undefined reference to `__atomic_load_8'
/usr/bin/ld: (.text.throwToMsg+0x458): undefined reference to `__atomic_store_8'
/usr/bin/ld: (.text.throwToMsg+0x478): undefined reference to `__atomic_load_8'
/usr/bin/ld: (.text.throwToMsg+0x490): undefined reference to `__atomic_store_8'
/usr/bin/ld: /usr/lib/ghc/rts/libHSrts_thr.a(SpinLock.thr_o): in function `acquire_spin_lock_slow_path':
(.text.acquire_spin_lock_slow_path+0x64): undefined reference to `__atomic_fetch_add_8'
/usr/bin/ld: (.text.acquire_spin_lock_slow_path+0x80): undefined reference to `__atomic_fetch_add_8'
collect2: error: ld returned 1 exit status
`powerpc-linux-gnu-gcc' failed in phase `Linker'. (Exit code: 1)
When building hadrian with "./hadrian/build -j", it's possible to pass the necessary
"-latomic" with the help of "*.*.ghc.link.opts = -latomic". I assume, for the bootstrap
python script, will have to patch either the Haskell sources or the Python script.
Adrian
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
More information about the Pkg-haskell-maintainers
mailing list