jberryman / unagi-chan

A haskell library implementing fast and scalable concurrent queues for x86, with a Chan-like API
BSD 3-Clause "New" or "Revised" License
127 stars 15 forks source link

AArch64 build error #28

Open ggardet opened 6 years ago

ggardet commented 6 years ago

On AArch64, the builds end on a linker error:

[  507s] /usr/bin/ghc -shared -dynamic '-dynload deploy' -optl-Wl,-rpath,/usr/lib64/ghc-8.0.2/atomic-primops-0.8.0.4-FvFLsKpDYPjGSQUM1RkO57 -optl-Wl,-rpath,/usr/lib64/ghc-8.0.2/base-4.9.1.0 -optl-Wl,-rpath,/usr/lib64/ghc-8.0.2/ghc-prim-0.5.0.0 -optl-Wl,-rpath,/usr/lib64/ghc-8.0.2/integer-gmp-1.0.0.1 -optl-Wl,-rpath,/usr/lib64/ghc-8.0.2/primitive-0.6.2.0-4578caNkWQ54Gt1mxLF2Yh -optl-Wl,-rpath,/usr/lib64/ghc-8.0.2/rts -optl-Wl,-rpath,/usr/lib64/ghc-8.0.2/transformers-0.5.2.0 -hide-all-packages -no-auto-link-packages -no-user-package-db -package-db dist/package.conf.inplace -package-id atomic-primops-0.8.0.4-FvFLsKpDYPjGSQUM1RkO57 -package-id base-4.9.1.0 -package-id ghc-prim-0.5.0.0 -package-id primitive-0.6.2.0-4578caNkWQ54Gt1mxLF2Yh dist/build/Control/Concurrent/Chan/Unagi.dyn_o dist/build/Control/Concurrent/Chan/Unagi/Unboxed.dyn_o dist/build/Control/Concurrent/Chan/Unagi/Bounded.dyn_o dist/build/Control/Concurrent/Chan/Unagi/NoBlocking.dyn_o dist/build/Control/Concurrent/Chan/Unagi/NoBlocking/Unboxed.dyn_o dist/build/Control/Concurrent/Chan/Unagi/Internal.dyn_o dist/build/Control/Concurrent/Chan/Unagi/Unboxed/Internal.dyn_o dist/build/Control/Concurrent/Chan/Unagi/Bounded/Internal.dyn_o dist/build/Control/Concurrent/Chan/Unagi/NoBlocking/Internal.dyn_o dist/build/Control/Concurrent/Chan/Unagi/NoBlocking/Types.dyn_o dist/build/Control/Concurrent/Chan/Unagi/NoBlocking/Unboxed/Internal.dyn_o dist/build/Control/Concurrent/Chan/Unagi/Constants.dyn_o dist/build/Utilities.dyn_o dist/build/Data/Atomics/Counter/Fat.dyn_o -o dist/build/libHSunagi-chan-0.4.0.0-5jpOsOJF9IVIuLemdLMVEv-ghc8.0.2.so
[  509s] /usr/bin/ld.gold: error: dist/build/Control/Concurrent/Chan/Unagi/NoBlocking/Unboxed.dyn_o: multiple definition of 'write_barrier'
[  509s] /usr/bin/ld.gold: dist/build/Control/Concurrent/Chan/Unagi/NoBlocking.dyn_o: previous definition here
[  509s] /usr/bin/ld.gold: error: dist/build/Control/Concurrent/Chan/Unagi/Unboxed/Internal.dyn_o: multiple definition of 'load_load_barrier'
[  509s] /usr/bin/ld.gold: dist/build/Control/Concurrent/Chan/Unagi/Internal.dyn_o: previous definition here
[  509s] /usr/bin/ld.gold: error: dist/build/Control/Concurrent/Chan/Unagi/Bounded/Internal.dyn_o: multiple definition of 'load_load_barrier'
[  509s] /usr/bin/ld.gold: dist/build/Control/Concurrent/Chan/Unagi/Internal.dyn_o: previous definition here
[  509s] /usr/bin/ld.gold: error: dist/build/Control/Concurrent/Chan/Unagi/NoBlocking/Internal.dyn_o: multiple definition of 'write_barrier'
[  509s] /usr/bin/ld.gold: dist/build/Control/Concurrent/Chan/Unagi/NoBlocking.dyn_o: previous definition here
[  509s] /usr/bin/ld.gold: error: dist/build/Control/Concurrent/Chan/Unagi/NoBlocking/Internal.dyn_o: multiple definition of 'load_load_barrier'
[  509s] /usr/bin/ld.gold: dist/build/Control/Concurrent/Chan/Unagi/Internal.dyn_o: previous definition here
[  509s] /usr/bin/ld.gold: error: dist/build/Control/Concurrent/Chan/Unagi/NoBlocking/Unboxed/Internal.dyn_o: multiple definition of 'write_barrier'
[  509s] /usr/bin/ld.gold: dist/build/Control/Concurrent/Chan/Unagi/NoBlocking.dyn_o: previous definition here
[  509s] /usr/bin/ld.gold: error: dist/build/Control/Concurrent/Chan/Unagi/NoBlocking/Unboxed/Internal.dyn_o: multiple definition of 'load_load_barrier'
[  509s] /usr/bin/ld.gold: dist/build/Control/Concurrent/Chan/Unagi/Internal.dyn_o: previous definition here
[  509s] collect2: error: ld returned 1 exit status
[  509s] `gcc' failed in phase `Linker'. (Exit code: 1)

Any idea to fix it?

jberryman commented 6 years ago

Hm, unfortunately I don't have a way to debug this. What happens when you try to create a project and depend on the same version of atomic-primops you tried here and use writeBarrier or loadLoadBarrier? What happens if you try a newer version of atomic-primops?

ggardet commented 6 years ago

I use the latest version of atomic-primops (0.8.2), so I cannot try a newer version.