Skip to content

Commit 60b987d

Browse files
authored
Rollup merge of rust-lang#47554 - EdSchouten:cloudabi-jemalloc, r=nikomatsakis
Make liballoc_jemalloc work on CloudABI. The automated builds for CloudABI in dist-various-2 don't use --disable-jemalloc, even though my original container image did. Instead of setting that flag, let's go the extra mile of making jemalloc work. CloudABI's C library already uses jemalloc and now exposes the API extensions used by us. This makes the CloudABI dist work out of the box.
2 parents 658ccae + 66d53ca commit 60b987d

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/liballoc_jemalloc/build.rs

+10-3
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,20 @@ fn main() {
2929
// for targets like emscripten, even if we don't use it.
3030
let target = env::var("TARGET").expect("TARGET was not set");
3131
let host = env::var("HOST").expect("HOST was not set");
32-
if target.contains("bitrig") || target.contains("cloudabi") || target.contains("emscripten") ||
33-
target.contains("fuchsia") || target.contains("msvc") || target.contains("openbsd") ||
34-
target.contains("redox") || target.contains("rumprun") || target.contains("wasm32") {
32+
if target.contains("bitrig") || target.contains("emscripten") || target.contains("fuchsia") ||
33+
target.contains("msvc") || target.contains("openbsd") || target.contains("redox") ||
34+
target.contains("rumprun") || target.contains("wasm32") {
3535
println!("cargo:rustc-cfg=dummy_jemalloc");
3636
return;
3737
}
3838

39+
// CloudABI ships with a copy of jemalloc that has been patched to
40+
// work well with sandboxing. Don't attempt to build our own copy,
41+
// as it won't build.
42+
if target.contains("cloudabi") {
43+
return;
44+
}
45+
3946
if target.contains("android") {
4047
println!("cargo:rustc-link-lib=gcc");
4148
} else if !target.contains("windows") && !target.contains("musl") {

0 commit comments

Comments
 (0)