mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-22 04:34:51 +00:00
Rollup merge of #32686 - mneumann:dragonfly_jemalloc_prefix, r=alexcrichton
Prefix jemalloc on DragonFly to prevent segfaults. Similar to commitsed015456a1
(iOS) ande3b414d861
(Android)
This commit is contained in:
commit
37cadec16e
2
mk/rt.mk
2
mk/rt.mk
@ -157,6 +157,8 @@ else ifeq ($(findstring android, $(OSTYPE_$(1))), android)
|
|||||||
# If the test suite passes, however, without symbol prefixes then we should be
|
# If the test suite passes, however, without symbol prefixes then we should be
|
||||||
# good to go!
|
# good to go!
|
||||||
JEMALLOC_ARGS_$(1) := --disable-tls --with-jemalloc-prefix=je_
|
JEMALLOC_ARGS_$(1) := --disable-tls --with-jemalloc-prefix=je_
|
||||||
|
else ifeq ($(findstring dragonfly, $(OSTYPE_$(1))), dragonfly)
|
||||||
|
JEMALLOC_ARGS_$(1) := --with-jemalloc-prefix=je_
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef CFG_ENABLE_DEBUG_JEMALLOC
|
ifdef CFG_ENABLE_DEBUG_JEMALLOC
|
||||||
|
@ -86,6 +86,8 @@ fn main() {
|
|||||||
// should be good to go!
|
// should be good to go!
|
||||||
cmd.arg("--with-jemalloc-prefix=je_");
|
cmd.arg("--with-jemalloc-prefix=je_");
|
||||||
cmd.arg("--disable-tls");
|
cmd.arg("--disable-tls");
|
||||||
|
} else if target.contains("dragonfly") {
|
||||||
|
cmd.arg("--with-jemalloc-prefix=je_");
|
||||||
}
|
}
|
||||||
|
|
||||||
if cfg!(feature = "debug-jemalloc") {
|
if cfg!(feature = "debug-jemalloc") {
|
||||||
|
@ -42,22 +42,27 @@ use libc::{c_int, c_void, size_t};
|
|||||||
extern {}
|
extern {}
|
||||||
|
|
||||||
// Note that the symbols here are prefixed by default on OSX (we don't
|
// Note that the symbols here are prefixed by default on OSX (we don't
|
||||||
// explicitly request it), and on Android we explicitly request it as
|
// explicitly request it), and on Android and DragonFly we explicitly request
|
||||||
// unprefixing cause segfaults (mismatches in allocators).
|
// it as unprefixing cause segfaults (mismatches in allocators).
|
||||||
extern {
|
extern {
|
||||||
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios"),
|
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios",
|
||||||
|
target_os = "dragonfly"),
|
||||||
link_name = "je_mallocx")]
|
link_name = "je_mallocx")]
|
||||||
fn mallocx(size: size_t, flags: c_int) -> *mut c_void;
|
fn mallocx(size: size_t, flags: c_int) -> *mut c_void;
|
||||||
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios"),
|
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios",
|
||||||
|
target_os = "dragonfly"),
|
||||||
link_name = "je_rallocx")]
|
link_name = "je_rallocx")]
|
||||||
fn rallocx(ptr: *mut c_void, size: size_t, flags: c_int) -> *mut c_void;
|
fn rallocx(ptr: *mut c_void, size: size_t, flags: c_int) -> *mut c_void;
|
||||||
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios"),
|
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios",
|
||||||
|
target_os = "dragonfly"),
|
||||||
link_name = "je_xallocx")]
|
link_name = "je_xallocx")]
|
||||||
fn xallocx(ptr: *mut c_void, size: size_t, extra: size_t, flags: c_int) -> size_t;
|
fn xallocx(ptr: *mut c_void, size: size_t, extra: size_t, flags: c_int) -> size_t;
|
||||||
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios"),
|
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios",
|
||||||
|
target_os = "dragonfly"),
|
||||||
link_name = "je_sdallocx")]
|
link_name = "je_sdallocx")]
|
||||||
fn sdallocx(ptr: *mut c_void, size: size_t, flags: c_int);
|
fn sdallocx(ptr: *mut c_void, size: size_t, flags: c_int);
|
||||||
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios"),
|
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios",
|
||||||
|
target_os = "dragonfly"),
|
||||||
link_name = "je_nallocx")]
|
link_name = "je_nallocx")]
|
||||||
fn nallocx(size: size_t, flags: c_int) -> size_t;
|
fn nallocx(size: size_t, flags: c_int) -> size_t;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user