Skip to content

Commit c2a9124

Browse files
authored
restrict linkage to platforms using ELF binaries
on windows and apple (which don't use ELF) we can't apply weak linkage
1 parent ba57ca4 commit c2a9124

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/arm.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ intrinsics! {
2222
// custom calling convention which can't be implemented using a normal Rust function.
2323
#[naked]
2424
#[cfg(not(target_env = "msvc"))]
25-
#[linkage = "weak"]
25+
#[cfg_attr(all(not(windows), not(target_vendor="apple")), linkage = "weak")]
2626
pub unsafe extern "C" fn __aeabi_uidivmod() {
2727
core::arch::asm!(
2828
"push {{lr}}",
@@ -37,7 +37,7 @@ intrinsics! {
3737
}
3838

3939
#[naked]
40-
#[linkage = "weak"]
40+
#[cfg_attr(all(not(windows), not(target_vendor="apple")), linkage = "weak")]
4141
pub unsafe extern "C" fn __aeabi_uldivmod() {
4242
core::arch::asm!(
4343
"push {{r4, lr}}",
@@ -54,7 +54,7 @@ intrinsics! {
5454
}
5555

5656
#[naked]
57-
#[linkage = "weak"]
57+
#[cfg_attr(all(not(windows), not(target_vendor="apple")), linkage = "weak")]
5858
pub unsafe extern "C" fn __aeabi_idivmod() {
5959
core::arch::asm!(
6060
"push {{r0, r1, r4, lr}}",
@@ -68,7 +68,7 @@ intrinsics! {
6868
}
6969

7070
#[naked]
71-
#[linkage = "weak"]
71+
#[cfg_attr(all(not(windows), not(target_vendor="apple")), linkage = "weak")]
7272
pub unsafe extern "C" fn __aeabi_ldivmod() {
7373
core::arch::asm!(
7474
"push {{r4, lr}}",

0 commit comments

Comments
 (0)