Skip to content

Commit

Permalink
Auto merge of #37392 - alexcrichton:more-disable-jemalloc, r=brson
Browse files Browse the repository at this point in the history
Disable jemalloc on aarch64/powerpc

Sounds like jemalloc is broken on systems which differ in page size than the
host it was compiled on (unless an option was passed). This unfortunately
reduces the portability of binaries created and can often make Rust segfault by
default. For now let's patch over this by disabling jemalloc until we can figure
out a better solution.

Closes #36994
Closes #37320
cc jemalloc/jemalloc#467
  • Loading branch information
bors authored Oct 30, 2016
2 parents 1238266 + de80670 commit aef5ca5
Show file tree
Hide file tree
Showing 12 changed files with 45 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/librustc_back/target/aarch64_unknown_linux_gnu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ use target::{Target, TargetOptions, TargetResult};
pub fn target() -> TargetResult {
let mut base = super::linux_base::opts();
base.max_atomic_width = Some(128);

// see #36994
base.exe_allocation_crate = "alloc_system".to_string();

Ok(Target {
llvm_target: "aarch64-unknown-linux-gnu".to_string(),
target_endian: "little".to_string(),
Expand Down
4 changes: 4 additions & 0 deletions src/librustc_back/target/mips64_unknown_linux_gnuabi64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ pub fn target() -> TargetResult {
cpu: "mips64r2".to_string(),
features: "+mips64r2".to_string(),
max_atomic_width: Some(64),

// see #36994
exe_allocation_crate: "alloc_system".to_string(),

..super::linux_base::opts()
},
})
Expand Down
4 changes: 4 additions & 0 deletions src/librustc_back/target/mips64el_unknown_linux_gnuabi64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ pub fn target() -> TargetResult {
cpu: "mips64r2".to_string(),
features: "+mips64r2".to_string(),
max_atomic_width: Some(64),

// see #36994
exe_allocation_crate: "alloc_system".to_string(),

..super::linux_base::opts()
},
})
Expand Down
4 changes: 4 additions & 0 deletions src/librustc_back/target/mips_unknown_linux_gnu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ pub fn target() -> TargetResult {
cpu: "mips32r2".to_string(),
features: "+mips32r2".to_string(),
max_atomic_width: Some(32),

// see #36994
exe_allocation_crate: "alloc_system".to_string(),

..super::linux_base::opts()
},
})
Expand Down
4 changes: 4 additions & 0 deletions src/librustc_back/target/mips_unknown_linux_musl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ pub fn target() -> TargetResult {
cpu: "mips32r2".to_string(),
features: "+mips32r2,+soft-float".to_string(),
max_atomic_width: Some(32),

// see #36994
exe_allocation_crate: "alloc_system".to_string(),

..super::linux_base::opts()
}
})
Expand Down
4 changes: 4 additions & 0 deletions src/librustc_back/target/mips_unknown_linux_uclibc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ pub fn target() -> TargetResult {
cpu: "mips32r2".to_string(),
features: "+mips32r2,+soft-float".to_string(),
max_atomic_width: Some(32),

// see #36994
exe_allocation_crate: "alloc_system".to_string(),

..super::linux_base::opts()
},
})
Expand Down
4 changes: 4 additions & 0 deletions src/librustc_back/target/mipsel_unknown_linux_gnu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ pub fn target() -> TargetResult {
cpu: "mips32".to_string(),
features: "+mips32".to_string(),
max_atomic_width: Some(32),

// see #36994
exe_allocation_crate: "alloc_system".to_string(),

..super::linux_base::opts()
},
})
Expand Down
4 changes: 4 additions & 0 deletions src/librustc_back/target/mipsel_unknown_linux_musl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ pub fn target() -> TargetResult {
cpu: "mips32".to_string(),
features: "+mips32,+soft-float".to_string(),
max_atomic_width: Some(32),

// see #36994
exe_allocation_crate: "alloc_system".to_string(),

..super::linux_base::opts()
}
})
Expand Down
4 changes: 4 additions & 0 deletions src/librustc_back/target/mipsel_unknown_linux_uclibc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ pub fn target() -> TargetResult {
cpu: "mips32".to_string(),
features: "+mips32,+soft-float".to_string(),
max_atomic_width: Some(32),

// see #36994
exe_allocation_crate: "alloc_system".to_string(),

..super::linux_base::opts()
},
})
Expand Down
3 changes: 3 additions & 0 deletions src/librustc_back/target/powerpc64_unknown_linux_gnu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ pub fn target() -> TargetResult {
base.pre_link_args.push("-m64".to_string());
base.max_atomic_width = Some(64);

// see #36994
base.exe_allocation_crate = "alloc_system".to_string();

Ok(Target {
llvm_target: "powerpc64-unknown-linux-gnu".to_string(),
target_endian: "big".to_string(),
Expand Down
3 changes: 3 additions & 0 deletions src/librustc_back/target/powerpc64le_unknown_linux_gnu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ pub fn target() -> TargetResult {
base.pre_link_args.push("-m64".to_string());
base.max_atomic_width = Some(64);

// see #36994
base.exe_allocation_crate = "alloc_system".to_string();

Ok(Target {
llvm_target: "powerpc64le-unknown-linux-gnu".to_string(),
target_endian: "little".to_string(),
Expand Down
3 changes: 3 additions & 0 deletions src/librustc_back/target/powerpc_unknown_linux_gnu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ pub fn target() -> TargetResult {
base.pre_link_args.push("-m32".to_string());
base.max_atomic_width = Some(32);

// see #36994
base.exe_allocation_crate = "alloc_system".to_string();

Ok(Target {
llvm_target: "powerpc-unknown-linux-gnu".to_string(),
target_endian: "big".to_string(),
Expand Down

0 comments on commit aef5ca5

Please sign in to comment.