jemallocator: jemalloc-sys fails to build with musl on Ubuntu 16.04
I’m not sure what the error means, but the relevant portion is here:
configure: WARNING: using cross tools not prefixed with host triplet
ar: `u' modifier ignored since `D' is the default (see `U')
/usr/bin/ld: /usr/lib/x86_64-linux-musl/libc.a(sysconf.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/lib/x86_64-linux-musl/libc.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make: *** [lib/libjemalloc.so.2] Error 1
make: *** Waiting for unfinished jobs....
ar: `u' modifier ignored since `D' is the default (see `U')
thread 'main' panicked at 'command did not execute successfully: "make" "srcroot=../jemalloc/" "-j" "2"
expected success, got: exit code: 2', /home/travis/.cargo/registry/src/github.com-1ecc6299db9ec823/jemalloc-sys-0.3.0/build.rs:370:9
You can see the full build failure here: https://travis-ci.org/BurntSushi/ripgrep/jobs/524197138
musl version is 1.1.9.
Any ideas on what’s wrong? I can’t reproduce this on my local system. (But I’m using musl 1.1.21 locally.)
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 16 (8 by maintainers)
Commits related to this issue
- ci: use cross for musl x86_64 builds This is necessary because jemalloc + musl + Ubuntu 16.04 is apparently broken. Moreover, jemalloc doesn't support i686, so we accept the performance regression t... — committed to BurntSushi/ripgrep by BurntSushi 5 years ago
- ci: use cross for musl x86_64 builds This is necessary because jemalloc + musl + Ubuntu 16.04 is apparently broken. Moreover, jemalloc doesn't support i686, so we accept the performance regression t... — committed to BurntSushi/ripgrep by BurntSushi 5 years ago
- Fix build of deb i386 It is apparently incompatible with jemalloc. See https://github.com/gnzlbg/jemallocator/issues/124 — committed to fbecart/zinoma by fbecart 4 years ago
I built jemalloc with x86_64-pc-linux-musl target on Ubuntu successfully by changing /usr/bin/musl-gcc from
into
I think it’s not a bug in jemaloc. Ubuntu package mantainer patched musl-gcc to disable PIE linking with some reason.
crossexists to save you from having to know about this, so if that works for you I would call it a day and worry more about it when you hit “the next issue”.Emitting better diagnostic when somebody attempts to build the i686 musl target is being tracked here in case you want to follow that: https://github.com/gnzlbg/jemallocator/issues/106
Now that I have builds working again with cross, I’m not sure if or when I’ll be debugging jemalloc compilation unfortunately. I’m not particularly experienced with configuring cross compilation toolchains, and I don’t have an easy way to test an Ubuntu 16.04 box at the moment, so it would probably be a lot of work for me. If I get some spare time I’ll see about looking into it.
I expect this is likely to bite people who are producing static binaries with musl using Travis CI if and when they notice that musl’s allocator is dog slow and want to switch back to jemalloc.
Yeah, I fixed that. You can see a passing build with cross + jemalloc + Ubuntu 16.04 + musl + x86_64 here: https://travis-ci.org/BurntSushi/ripgrep/jobs/524515554
So it sounds like
crossis working OK. But the normalcargo build --target x86_64-unknown-linux-muslstill fails.