xxhash icon indicating copy to clipboard operation
xxhash copied to clipboard

linking failure against ghc-8.10.1

Open l29ah opened this issue 4 years ago • 2 comments

As it has some xxhash bundled:

xxhash ‰ cabal bench
Build profile: -w ghc-8.10.1 -O1
In order, the following will be built (use -v for more details):
 - xxhash-0.0.2 (bench:bench) (first run)
Preprocessing benchmark 'bench' for xxhash-0.0.2..
Building benchmark 'bench' for xxhash-0.0.2..
Linking /tmp/xxhash/dist-newstyle/build/x86_64-linux/ghc-8.10.1/xxhash-0.0.2/b/bench/build/bench/bench ...
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib64/ghc-8.10.1/rts/libHSrts.a(xxhash.o): in function `XXH32':

/var/tmp/portage/dev-lang/ghc-8.10.1/work/ghc-8.10.1/rts/xxhash.c:321:0: error:
     multiple definition of `XXH32'; /tmp/xxhash/dist-newstyle/build/x86_64-linux/ghc-8.10.1/xxhash-0.0.2/build/libHSxxhash-0.0.2-inplace.a(xxhash.o):xxhash.c:(.text+0x0): first defined here
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib64/ghc-8.10.1/rts/libHSrts.a(xxhash.o): in function `XXH32_update':

/var/tmp/portage/dev-lang/ghc-8.10.1/work/ghc-8.10.1/rts/xxhash.c:437:0: error:
     multiple definition of `XXH32_update'; /tmp/xxhash/dist-newstyle/build/x86_64-linux/ghc-8.10.1/xxhash-0.0.2/build/libHSxxhash-0.0.2-inplace.a(xxhash.o):xxhash.c:(.text+0x1e0): first defined here
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib64/ghc-8.10.1/rts/libHSrts.a(xxhash.o): in function `XXH32_digest_endian':

/var/tmp/portage/dev-lang/ghc-8.10.1/work/ghc-8.10.1/rts/xxhash.c:451:0: error:
     multiple definition of `XXH32_digest'; /tmp/xxhash/dist-newstyle/build/x86_64-linux/ghc-8.10.1/xxhash-0.0.2/build/libHSxxhash-0.0.2-inplace.a(xxhash.o):xxhash.c:(.text+0x460): first defined here
collect2: error: ld returned 1 exit status
`x86_64-pc-linux-gnu-gcc' failed in phase `Linker'. (Exit code: 1)

l29ah avatar Jul 25 '20 07:07 l29ah

ghc bundled it in https://gitlab.haskell.org/ghc/ghc/-/merge_requests/4248

This could be considered a ghc bug I think; it could rename the functions to avoid breaking linking to xxhash3.

joeyh avatar Dec 15 '20 20:12 joeyh

Interesting, I guess these versions don't need the dependency which is weird. Not sure how to handle this and I don't use this library anymore so won't be working on it. Good luck.

christian-marie avatar Jul 26 '21 23:07 christian-marie