From f1f40ebcbe7008d3619675ad758eeec196500480 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 8 Jan 2020 09:02:41 -0800 Subject: [PATCH] Fix compiletest with newer (local-rebuild) libtest Fix ARM EHABI unwinding --- ...est-bump-to-stage0-bootstrap-libtest.patch | 32 ++++++++++++ ...ier-cache-during-ARM-EHABI-unwinding.patch | 52 +++++++++++++++++++ ...-67242-ignore-arm-foreign-exceptions.patch | 10 ---- rust.spec | 17 ++++-- 4 files changed, 97 insertions(+), 14 deletions(-) create mode 100644 0001-Compiletest-bump-to-stage0-bootstrap-libtest.patch create mode 100644 0001-Update-the-barrier-cache-during-ARM-EHABI-unwinding.patch delete mode 100644 rust-issue-67242-ignore-arm-foreign-exceptions.patch diff --git a/0001-Compiletest-bump-to-stage0-bootstrap-libtest.patch b/0001-Compiletest-bump-to-stage0-bootstrap-libtest.patch new file mode 100644 index 0000000..c8062bf --- /dev/null +++ b/0001-Compiletest-bump-to-stage0-bootstrap-libtest.patch @@ -0,0 +1,32 @@ +From f6832adadb84364ce0c81fa02910b3706f441abc Mon Sep 17 00:00:00 2001 +From: Mark Rousskov +Date: Wed, 6 Nov 2019 15:17:02 -0500 +Subject: [PATCH] Compiletest bump to stage0 bootstrap libtest + +--- + src/tools/compiletest/src/main.rs | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/tools/compiletest/src/main.rs b/src/tools/compiletest/src/main.rs +index 34435819a2c4..b115539b4af3 100644 +--- a/src/tools/compiletest/src/main.rs ++++ b/src/tools/compiletest/src/main.rs +@@ -568,6 +568,7 @@ pub fn test_opts(config: &Config) -> test::TestOpts { + skip: vec![], + list: false, + options: test::Options::new(), ++ time_options: None, + } + } + +@@ -703,6 +704,7 @@ pub fn make_test(config: &Config, testpaths: &TestPaths) -> Vec +Date: Wed, 1 Jan 2020 17:11:45 +0100 +Subject: [PATCH] Update the barrier cache during ARM EHABI unwinding + +--- + src/libpanic_unwind/gcc.rs | 8 +++++++- + src/libunwind/libunwind.rs | 2 ++ + 2 files changed, 9 insertions(+), 1 deletion(-) + +diff --git a/src/libpanic_unwind/gcc.rs b/src/libpanic_unwind/gcc.rs +index 4f572fe21b30..328d0d4ce7be 100644 +--- a/src/libpanic_unwind/gcc.rs ++++ b/src/libpanic_unwind/gcc.rs +@@ -187,7 +187,13 @@ cfg_if::cfg_if! { + match eh_action { + EHAction::None | + EHAction::Cleanup(_) => return continue_unwind(exception_object, context), +- EHAction::Catch(_) => return uw::_URC_HANDLER_FOUND, ++ EHAction::Catch(_) => { ++ // EHABI requires the personality routine to update the ++ // SP value in the barrier cache of the exception object. ++ (*exception_object).private[5] = ++ uw::_Unwind_GetGR(context, uw::UNWIND_SP_REG); ++ return uw::_URC_HANDLER_FOUND; ++ } + EHAction::Terminate => return uw::_URC_FAILURE, + } + } else { +diff --git a/src/libunwind/libunwind.rs b/src/libunwind/libunwind.rs +index 0b39503c0d03..30658ce328d8 100644 +--- a/src/libunwind/libunwind.rs ++++ b/src/libunwind/libunwind.rs +@@ -23,6 +23,7 @@ pub type _Unwind_Word = uintptr_t; + pub type _Unwind_Ptr = uintptr_t; + pub type _Unwind_Trace_Fn = extern "C" fn(ctx: *mut _Unwind_Context, arg: *mut c_void) + -> _Unwind_Reason_Code; ++ + #[cfg(target_arch = "x86")] + pub const unwinder_private_data_size: usize = 5; + +@@ -151,6 +152,7 @@ if #[cfg(all(any(target_os = "ios", target_os = "netbsd", not(target_arch = "arm + use _Unwind_VRS_DataRepresentation::*; + + pub const UNWIND_POINTER_REG: c_int = 12; ++ pub const UNWIND_SP_REG: c_int = 13; + pub const UNWIND_IP_REG: c_int = 15; + + #[cfg_attr(all(feature = "llvm-libunwind", +-- +2.24.1 + diff --git a/rust-issue-67242-ignore-arm-foreign-exceptions.patch b/rust-issue-67242-ignore-arm-foreign-exceptions.patch deleted file mode 100644 index 127c435..0000000 --- a/rust-issue-67242-ignore-arm-foreign-exceptions.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- rustc-beta-src/src/test/run-make-fulldeps/foreign-exceptions/Makefile.orig 2019-12-07 18:36:56.000000000 -0800 -+++ rustc-beta-src/src/test/run-make-fulldeps/foreign-exceptions/Makefile 2019-12-12 15:49:24.655515206 -0800 -@@ -1,3 +1,7 @@ -+# ignore-arm -+# ignore-armeb -+# https://github.com/rust-lang/rust/issues/67242 -+ - -include ../tools.mk - - all: foo diff --git a/rust.spec b/rust.spec index 3813405..3bd2f3e 100644 --- a/rust.spec +++ b/rust.spec @@ -49,7 +49,7 @@ Name: rust Version: 1.40.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) # ^ written as: (rust itself) and (bundled libraries) @@ -71,9 +71,13 @@ Patch1: rust-pr57840-llvm7-debuginfo-variants.patch # https://github.com/rust-lang/rust/pull/66317 Patch2: rust-pr66317-bindir-relative.patch -# ARM loops when C++ tries to catch and rethrow a Rust exception -# https://github.com/rust-lang/rust/issues/67242 -Patch3: rust-issue-67242-ignore-arm-foreign-exceptions.patch +# Fix compiletest with newer (local-rebuild) libtest +# https://github.com/rust-lang/rust/pull/66156/commits/f6832adadb84364ce0c81fa02910b3706f441abc +Patch3: 0001-Compiletest-bump-to-stage0-bootstrap-libtest.patch + +# Fix ARM unwinding for foreign-exceptions +# https://github.com/rust-lang/rust/pull/67779 +Patch4: 0001-Update-the-barrier-cache-during-ARM-EHABI-unwinding.patch # Get the Rust triple for any arch. %{lua: function rust_triple(arch) @@ -407,6 +411,7 @@ test -f '%{local_rust_root}/bin/rustc' %patch1 -p1 -R %patch2 -p1 %patch3 -p1 +%patch4 -p1 %if "%{python}" == "python3" sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure @@ -713,6 +718,10 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* %changelog +* Tue Jan 07 2020 Josh Stone - 1.40.0-2 +- Fix compiletest with newer (local-rebuild) libtest +- Fix ARM EHABI unwinding + * Thu Dec 19 2019 Josh Stone - 1.40.0-1 - Update to 1.40.0.