restrict linkage to platforms using ELF binaries

on windows and apple (which don't use ELF) we can't apply weak linkage
This commit is contained in:
Lokathor 2022-07-28 09:42:18 -06:00 committed by GitHub
parent 1070134a56
commit 8568a33255
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -22,7 +22,7 @@ intrinsics! {
// custom calling convention which can't be implemented using a normal Rust function.
#[naked]
#[cfg(not(target_env = "msvc"))]
#[linkage = "weak"]
#[cfg_attr(all(not(windows), not(target_vendor="apple")), linkage = "weak")]
pub unsafe extern "C" fn __aeabi_uidivmod() {
core::arch::asm!(
"push {{lr}}",
@ -37,7 +37,7 @@ intrinsics! {
}
#[naked]
#[linkage = "weak"]
#[cfg_attr(all(not(windows), not(target_vendor="apple")), linkage = "weak")]
pub unsafe extern "C" fn __aeabi_uldivmod() {
core::arch::asm!(
"push {{r4, lr}}",
@ -54,7 +54,7 @@ intrinsics! {
}
#[naked]
#[linkage = "weak"]
#[cfg_attr(all(not(windows), not(target_vendor="apple")), linkage = "weak")]
pub unsafe extern "C" fn __aeabi_idivmod() {
core::arch::asm!(
"push {{r0, r1, r4, lr}}",
@ -68,7 +68,7 @@ intrinsics! {
}
#[naked]
#[linkage = "weak"]
#[cfg_attr(all(not(windows), not(target_vendor="apple")), linkage = "weak")]
pub unsafe extern "C" fn __aeabi_ldivmod() {
core::arch::asm!(
"push {{r4, lr}}",