From 2bb5c034ea9e0b6c9ff0df7d37707e0472fc3c0d Mon Sep 17 00:00:00 2001 From: Ionen Wolkens Date: Mon, 12 Sep 2022 21:47:02 -0400 Subject: app-emulation/wine-vanilla: fix clang + USE=-llvm-libunwind build _Unwind_Find_FDE doesn't exist in libunwind but does in gcc's rtlib, clang instead expects it from llvm-libunwind which leads to undefined references even with USE=-unwind. Messy but add extra guards around it. Signed-off-by: Ionen Wolkens --- .../files/wine-vanilla-7.0-llvm-libunwind.patch | 9 ----- .../files/wine-vanilla-7.0-unwind.patch | 40 ++++++++++++++++++++++ .../wine-vanilla/wine-vanilla-7.0-r3.ebuild | 2 +- .../wine-vanilla/wine-vanilla-7.17.ebuild | 2 +- .../wine-vanilla/wine-vanilla-9999.ebuild | 2 +- 5 files changed, 43 insertions(+), 12 deletions(-) delete mode 100644 app-emulation/wine-vanilla/files/wine-vanilla-7.0-llvm-libunwind.patch create mode 100644 app-emulation/wine-vanilla/files/wine-vanilla-7.0-unwind.patch (limited to 'app-emulation') diff --git a/app-emulation/wine-vanilla/files/wine-vanilla-7.0-llvm-libunwind.patch b/app-emulation/wine-vanilla/files/wine-vanilla-7.0-llvm-libunwind.patch deleted file mode 100644 index eaec4d898b98..000000000000 --- a/app-emulation/wine-vanilla/files/wine-vanilla-7.0-llvm-libunwind.patch +++ /dev/null @@ -1,9 +0,0 @@ -Note the dodgy _CONFIG_H_ check can be removed when >=llvm-libunwind-15 -(which adds _VERSION) is well established: https://reviews.llvm.org/D121015 ---- a/dlls/ntdll/unix/signal_x86_64.c -+++ b/dlls/ntdll/unix/signal_x86_64.c -@@ -1359,3 +1359,3 @@ - --#ifdef __APPLE__ -+#if defined(__APPLE__) || defined(_LIBUNWIND_VERSION) || defined(____LIBUNWIND_CONFIG_H__) - rc = unw_getcontext( &unw_context ); diff --git a/app-emulation/wine-vanilla/files/wine-vanilla-7.0-unwind.patch b/app-emulation/wine-vanilla/files/wine-vanilla-7.0-unwind.patch new file mode 100644 index 000000000000..74f22362ea9b --- /dev/null +++ b/app-emulation/wine-vanilla/files/wine-vanilla-7.0-unwind.patch @@ -0,0 +1,40 @@ +Fix build with llvm-libunwind, and also fix for non-llvm libunwind +when using clang+bfd given clang doesn't have _Unwind_Find_FDE in +its rtlib and expects it from llvm-libunwind. + +The _CONFIG_H_ check is for Rip - 1), &bases ); + + if (fde) + return dwarf_virtual_unwind( context->Rip, &dispatch->EstablisherFrame, context, fde, + &bases, &dispatch->LanguageHandler, &dispatch->HandlerData ); ++#endif + #ifdef HAVE_LIBUNWIND + return libunwind_virtual_unwind( context->Rip, &dispatch->EstablisherFrame, context, + &dispatch->LanguageHandler, &dispatch->HandlerData ); diff --git a/app-emulation/wine-vanilla/wine-vanilla-7.0-r3.ebuild b/app-emulation/wine-vanilla/wine-vanilla-7.0-r3.ebuild index 8aef3c25fdd6..7a2564b15a56 100644 --- a/app-emulation/wine-vanilla/wine-vanilla-7.0-r3.ebuild +++ b/app-emulation/wine-vanilla/wine-vanilla-7.0-r3.ebuild @@ -123,8 +123,8 @@ IDEPEND="app-eselect/eselect-wine" QA_TEXTRELS="usr/lib/*/wine/i386-unix/*.so" # uses -fno-PIC -Wl,-z,notext PATCHES=( - "${FILESDIR}"/${PN}-7.0-llvm-libunwind.patch "${FILESDIR}"/${PN}-7.0-noexecstack.patch + "${FILESDIR}"/${PN}-7.0-unwind.patch ) pkg_pretend() { diff --git a/app-emulation/wine-vanilla/wine-vanilla-7.17.ebuild b/app-emulation/wine-vanilla/wine-vanilla-7.17.ebuild index a04742503154..f0f96f49dcfd 100644 --- a/app-emulation/wine-vanilla/wine-vanilla-7.17.ebuild +++ b/app-emulation/wine-vanilla/wine-vanilla-7.17.ebuild @@ -122,8 +122,8 @@ IDEPEND="app-eselect/eselect-wine" QA_TEXTRELS="usr/lib/*/wine/i386-unix/*.so" # uses -fno-PIC -Wl,-z,notext PATCHES=( - "${FILESDIR}"/${PN}-7.0-llvm-libunwind.patch "${FILESDIR}"/${PN}-7.0-noexecstack.patch + "${FILESDIR}"/${PN}-7.0-unwind.patch ) pkg_pretend() { diff --git a/app-emulation/wine-vanilla/wine-vanilla-9999.ebuild b/app-emulation/wine-vanilla/wine-vanilla-9999.ebuild index a04742503154..f0f96f49dcfd 100644 --- a/app-emulation/wine-vanilla/wine-vanilla-9999.ebuild +++ b/app-emulation/wine-vanilla/wine-vanilla-9999.ebuild @@ -122,8 +122,8 @@ IDEPEND="app-eselect/eselect-wine" QA_TEXTRELS="usr/lib/*/wine/i386-unix/*.so" # uses -fno-PIC -Wl,-z,notext PATCHES=( - "${FILESDIR}"/${PN}-7.0-llvm-libunwind.patch "${FILESDIR}"/${PN}-7.0-noexecstack.patch + "${FILESDIR}"/${PN}-7.0-unwind.patch ) pkg_pretend() { -- cgit v1.2.3-65-gdbad