From 0ebbcaede47fe814051919847dbf95760c62405c Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Sun, 25 Jun 2017 09:25:54 -0700 Subject: [PATCH] Enable the `intrinsics` program on thumb --- ci/run.sh | 12 +----------- examples/intrinsics.rs | 14 ++++++++++++-- src/arm.rs | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ci/run.sh b/ci/run.sh index d285b36..9562b7f 100755 --- a/ci/run.sh +++ b/ci/run.sh @@ -115,19 +115,9 @@ done rm -f $path -# Verification of the `intrinsics` program doesn't work on thumb targets right -# now. -case $1 in - thumb*) - exit 0 - ;; - *) - ;; -esac - # Verify that we haven't drop any intrinsic/symbol RUSTFLAGS="-C debug-assertions=no" \ - $cargo build --features "$INTRINSICS_FEATURES" --target $1 --example intrinsics + $cargo build --features "$INTRINSICS_FEATURES" --target $1 --example intrinsics -v # Verify that there are no undefined symbols to `panic` within our # implementations diff --git a/examples/intrinsics.rs b/examples/intrinsics.rs index 7db241e..e7c55e8 100644 --- a/examples/intrinsics.rs +++ b/examples/intrinsics.rs @@ -12,13 +12,14 @@ #![feature(core_float)] #![feature(lang_items)] #![feature(start)] -#![feature(panic_unwind)] #![feature(i128_type)] +#![cfg_attr(windows, feature(panic_unwind))] #![no_std] #[cfg(not(thumb))] extern crate alloc_system; extern crate compiler_builtins; +#[cfg(windows)] extern crate panic_unwind; // 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() {} #[no_mangle] pub fn __aeabi_unwind_cpp_pr1() {} -#[cfg(not(test))] +#[cfg(not(windows))] +#[allow(non_snake_case)] +#[no_mangle] +pub fn _Unwind_Resume() {} + +#[cfg(not(windows))] +#[lang = "eh_personality"] +#[no_mangle] +pub extern "C" fn eh_personality() {} + #[lang = "panic_fmt"] #[no_mangle] #[allow(private_no_mangle_fns)] diff --git a/src/arm.rs b/src/arm.rs index 81e0afd..389bf9a 100644 --- a/src/arm.rs +++ b/src/arm.rs @@ -37,7 +37,7 @@ pub unsafe fn __aeabi_uldivmod() { #[cfg_attr(not(feature = "mangled-names"), no_mangle)] pub unsafe fn __aeabi_idivmod() { asm!("push {r0, r1, r4, lr} - bl __divsi3 + bl __aeabi_idiv pop {r1, r2} muls r2, r2, r0 subs r1, r1, r2