Skip to content

Commit 0ebbcae

Browse files
committed
Enable the intrinsics program on thumb
1 parent afe5c71 commit 0ebbcae

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

ci/run.sh

+1-11
Original file line numberDiff line numberDiff line change
@@ -115,19 +115,9 @@ done
115115

116116
rm -f $path
117117

118-
# Verification of the `intrinsics` program doesn't work on thumb targets right
119-
# now.
120-
case $1 in
121-
thumb*)
122-
exit 0
123-
;;
124-
*)
125-
;;
126-
esac
127-
128118
# Verify that we haven't drop any intrinsic/symbol
129119
RUSTFLAGS="-C debug-assertions=no" \
130-
$cargo build --features "$INTRINSICS_FEATURES" --target $1 --example intrinsics
120+
$cargo build --features "$INTRINSICS_FEATURES" --target $1 --example intrinsics -v
131121

132122
# Verify that there are no undefined symbols to `panic` within our
133123
# implementations

examples/intrinsics.rs

+12-2
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@
1212
#![feature(core_float)]
1313
#![feature(lang_items)]
1414
#![feature(start)]
15-
#![feature(panic_unwind)]
1615
#![feature(i128_type)]
16+
#![cfg_attr(windows, feature(panic_unwind))]
1717
#![no_std]
1818

1919
#[cfg(not(thumb))]
2020
extern crate alloc_system;
2121
extern crate compiler_builtins;
22+
#[cfg(windows)]
2223
extern crate panic_unwind;
2324

2425
// NOTE cfg(not(thumbv6m)) means that the operation is not supported on ARMv6-M at all. Not even
@@ -444,7 +445,16 @@ pub fn __aeabi_unwind_cpp_pr0() {}
444445
#[no_mangle]
445446
pub fn __aeabi_unwind_cpp_pr1() {}
446447

447-
#[cfg(not(test))]
448+
#[cfg(not(windows))]
449+
#[allow(non_snake_case)]
450+
#[no_mangle]
451+
pub fn _Unwind_Resume() {}
452+
453+
#[cfg(not(windows))]
454+
#[lang = "eh_personality"]
455+
#[no_mangle]
456+
pub extern "C" fn eh_personality() {}
457+
448458
#[lang = "panic_fmt"]
449459
#[no_mangle]
450460
#[allow(private_no_mangle_fns)]

src/arm.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pub unsafe fn __aeabi_uldivmod() {
3737
#[cfg_attr(not(feature = "mangled-names"), no_mangle)]
3838
pub unsafe fn __aeabi_idivmod() {
3939
asm!("push {r0, r1, r4, lr}
40-
bl __divsi3
40+
bl __aeabi_idiv
4141
pop {r1, r2}
4242
muls r2, r2, r0
4343
subs r1, r1, r2

0 commit comments

Comments
 (0)