diff --git a/src/header/stdlib/cbindgen.toml b/src/header/stdlib/cbindgen.toml index 6de6a6fa4b..fb6dde8a17 100644 --- a/src/header/stdlib/cbindgen.toml +++ b/src/header/stdlib/cbindgen.toml @@ -6,6 +6,9 @@ style = "Type" no_includes = true cpp_compat = true +[defines] +"target_pointer_width=64" = "__LP64__" + [enum] prefix_with_name = true diff --git a/src/header/stdlib/mod.rs b/src/header/stdlib/mod.rs index 74d37af0a1..64ca259a87 100644 --- a/src/header/stdlib/mod.rs +++ b/src/header/stdlib/mod.rs @@ -100,6 +100,11 @@ pub unsafe extern "C" fn abort() -> ! { intrinsics::abort(); } +#[cfg(not(target_pointer_width = "64"))] +#[no_mangle] +static __stack_chk_guard: uintptr_t = 0x19fcadfe; + +#[cfg(target_pointer_width = "64")] #[no_mangle] static __stack_chk_guard: uintptr_t = 0xd048c37519fcadfe;