Skip to content

Commit

Permalink
contrib: rav1e: avoid linking error on win32
Browse files Browse the repository at this point in the history
Workaround for rust-lang/rust#79609
  • Loading branch information
tmatth authored and Rémi Denis-Courmont committed Feb 26, 2022
1 parent c5dcc7c commit 0b82f2d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
3 changes: 3 additions & 0 deletions contrib/src/rav1e/rules.mak
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ RAV1E_FEATURES=--features=asm

rav1e: rav1e-$(RAV1E_VERSION).tar.gz .sum-rav1e .rav1e-vendor
$(UNPACK)
ifdef HAVE_WIN32
$(APPLY) $(SRC)/rav1e/unwind-resume-stub.patch
endif
$(CARGO_VENDOR_SETUP)
$(MOVE)

Expand Down
27 changes: 27 additions & 0 deletions contrib/src/rav1e/unwind-resume-stub.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
From 30b9e63817bf60c3cab0bc6cebb073ee2344ac34 Mon Sep 17 00:00:00 2001
From: Tristan Matthews <[email protected]>
Date: Fri, 25 Feb 2022 12:30:01 -0500
Subject: [PATCH 1/1] lib: workaround for
https://github.com/rust-lang/rust/issues/79609

This avoids to broken linking on some mingw32 versions. The function
will never be called since we set `-C panic=abort`.
---
src/lib.rs | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/src/lib.rs b/src/lib.rs
index 63afa2d5..412bb0e0 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -389,3 +389,7 @@ pub mod bench {

#[cfg(fuzzing)]
pub mod fuzzing;
+
+#[no_mangle]
+#[allow(non_snake_case)]
+fn _Unwind_Resume() {}
--
2.32.0

0 comments on commit 0b82f2d

Please sign in to comment.