-
Notifications
You must be signed in to change notification settings - Fork 116
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
jemalloc-sys fails to build with musl on Ubuntu 16.04 #124
Comments
cc @alexcrichton Is this related to rust-lang/rust#59411? |
See also: BurntSushi/ripgrep#1268 |
@BurntSushi can you test compiling with |
For comparison, our build jobs do not show the "configure: WARNING: using cross tools not prefixed with host triplet" warning: https://travis-ci.com/gnzlbg/jemallocator/jobs/195415085#L665 |
I tried simply removing Keeping PCRE2 disabled, I then tried using And re-enabling PCRE2 with Here is the So this seems like quite a thorny problem. There are multiple variables at play here:
I've never used cross before, but the normal Cargo builds worked with musl when Rust was bundling jemalloc. |
jemalloc does not support that target anymore, so if you want to use jemalloc there you'd have to patch jemalloc itself |
This is necessary because jemalloc + musl + Ubuntu 16.04 is apparently broken. Moreover, jemalloc doesn't support i686, so we accept the performance regression there. See also: gnzlbg/jemallocator#124
From inspecting that, it errors at line 75 of the build.rs: https://github.com/BurntSushi/rust-pcre2/blob/master/pcre2-sys/build.rs#L75 Either |
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 |
This is necessary because jemalloc + musl + Ubuntu 16.04 is apparently broken. Moreover, jemalloc doesn't support i686, so we accept the performance regression there. See also: gnzlbg/jemallocator#124
So I suspect that your cross-compilation toolchain for C might not be set up appropriately for compiling jemalloc. I think it might be better to try compiling jemalloc from source first and see if that succeeds. Basically:
But the autoconf / makefile environment variables (CC, CXX, TARGET, HOST, ... ) need to be set properly for that to work. If that works, but |
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. |
Emitting better diagnostic when somebody attempts to build the i686 musl target is being tracked here in case you want to follow that: #106 |
I built jemalloc with x86_64-pc-linux-musl target on Ubuntu successfully by changing /usr/bin/musl-gcc from #!/bin/sh
exec "${REALGCC:-cc}" "$@" -specs /usr/share/dpkg/no-pie-compile.specs -specs /usr/share/dpkg/no-pie-link.specs -specs "/usr/l
ib/x86_64-linux-musl/musl-gcc.specs" into #!/bin/sh
exec "${REALGCC:-gcc}" "$@" -specs "/usr/lib/x86_64-linux-musl/musl-gcc.specs" |
Is this a bug in the jemalloc makefiles / configure script ? If so it might be best to report this upstream. |
I think it's not a bug in jemaloc. Ubuntu package mantainer patched musl-gcc to disable PIE linking with some reason.
|
So is this an ubuntu bug ? |
Sort of, It seems like the maintainer disable PIE on purpose to fix another bug And the bug was fixed in 1.1.20
|
It is apparently incompatible with jemalloc. See gnzlbg/jemallocator#124
I'm not sure what the error means, but the relevant portion is here:
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.)
The text was updated successfully, but these errors were encountered: