Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't build benchmarks #203

Closed
kuk0 opened this issue Oct 29, 2017 · 2 comments
Closed

Can't build benchmarks #203

kuk0 opened this issue Oct 29, 2017 · 2 comments

Comments

@kuk0
Copy link
Contributor

kuk0 commented Oct 29, 2017

When trying to build benchmarks, I get a linker error, as the cbits.c from the text i have installed clash with the cbits.c from the text source code i'm currently working on and which i'm trying to benchmark.

Linking dist/build/text-benchmarks/text-benchmarks ...
/home/kuko/.cabal/lib/x86_64-linux-ghc-8.0.2/text-1.2.2.2-KC7dWoG09dA1F6jKj5GSqh/libHStext-1.2.2.2-KC7dWoG09dA1F6jKj5GSqh.a(cbits.o): In function `_hs_text_memcmp':
(.text+0x20): multiple definition of `_hs_text_memcmp'
dist/build/text-benchmarks/text-benchmarks-tmp/../cbits/cbits.o:cbits.c:(.text+0x0): first defined here
/home/kuko/.cabal/lib/x86_64-linux-ghc-8.0.2/text-1.2.2.2-KC7dWoG09dA1F6jKj5GSqh/libHStext-1.2.2.2-KC7dWoG09dA1F6jKj5GSqh.a(cbits.o): In function `_hs_text_decode_utf8_state':
(.text+0xe0): multiple definition of `_hs_text_decode_utf8_state'
dist/build/text-benchmarks/text-benchmarks-tmp/../cbits/cbits.o:cbits.c:(.text+0x20): first defined here
/home/kuko/.cabal/lib/x86_64-linux-ghc-8.0.2/text-1.2.2.2-KC7dWoG09dA1F6jKj5GSqh/libHStext-1.2.2.2-KC7dWoG09dA1F6jKj5GSqh.a(cbits.o): In function `_hs_text_decode_utf8':
(.text+0x2a0): multiple definition of `_hs_text_decode_utf8'
dist/build/text-benchmarks/text-benchmarks-tmp/../cbits/cbits.o:cbits.c:(.text+0x150): first defined here
collect2: error: ld returned 1 exit status

The problem is, that criterion has text as a dependency.

Currently, as a workaround, I just rename the functions in cbits.c, then cabal build just works.

@hvr
Copy link
Member

hvr commented Oct 29, 2017

@kuk0 actually I might have a way to have cbits symbols automatically mangled uniquely for each package... lemme try something

@ethercrow
Copy link
Contributor

This was fixed by migrating from criterion to tasty-bench.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants