From 2101e29194436c3c2be272ff13cd4d1f7669c215 Mon Sep 17 00:00:00 2001 From: Michael Cronenworth Date: Mon, 16 Feb 2015 10:15:03 -0600 Subject: [PATCH] Patch for RtlUnwindEx fix and systemd binfmt macros --- wine-staging-rtlunwindex.patch | 76 ++++++++++++++++++++++++++++++++++ wine.spec | 34 +++++++++++---- 2 files changed, 101 insertions(+), 9 deletions(-) create mode 100644 wine-staging-rtlunwindex.patch diff --git a/wine-staging-rtlunwindex.patch b/wine-staging-rtlunwindex.patch new file mode 100644 index 0000000..ad00f08 --- /dev/null +++ b/wine-staging-rtlunwindex.patch @@ -0,0 +1,76 @@ +diff --git a/debian/changelog b/debian/changelog +index bf71cad..9293125 100644 +--- a/debian/changelog ++++ b/debian/changelog +@@ -1,3 +1,7 @@ ++wine-staging (1.7.36-1) UNRELEASED; urgency=low ++ * Update patchset for RtlUnwindEx on x86_64 and fix a second bug. ++ -- Sebastian Lackner Sun, 15 Feb 2015 22:24:13 +0100 ++ + wine-staging (1.7.36) unstable; urgency=low + * Fix an incompatibility of patchinstall.sh with non-bash shells under specific situations. + * Improve dinput-Events patch to be compatible with applications which do not explicitly poll for input. +diff --git a/patches/ntdll-RtlUnwindEx/0001-ntdll-Fix-check-for-end_frame-in-RtlUnwindEx-on-x86_.patch b/patches/ntdll-RtlUnwindEx/0001-ntdll-Fix-check-for-end_frame-in-RtlUnwindEx-on-x86_.patch +index 455a7fc..c5e8903 100644 +--- a/patches/ntdll-RtlUnwindEx/0001-ntdll-Fix-check-for-end_frame-in-RtlUnwindEx-on-x86_.patch ++++ b/patches/ntdll-RtlUnwindEx/0001-ntdll-Fix-check-for-end_frame-in-RtlUnwindEx-on-x86_.patch +@@ -1,18 +1,32 @@ +-From 7dd7631b611976b237acc63386b26866e5b4b253 Mon Sep 17 00:00:00 2001 ++From 3c89d2a189c2cc869c7ce81293ab752e3fa57708 Mon Sep 17 00:00:00 2001 + From: Sebastian Lackner + Date: Sun, 25 Jan 2015 15:46:05 +0100 +-Subject: ntdll: Fix check for end_frame in RtlUnwindEx on x86_64. ++Subject: ntdll: Fix check for end_frame in RtlUnwindEx on x86_64. (rev 2) + ++Changes in v2: ++* Calling wine internal handlers should not mess up the EstablisherFrame. + --- +- dlls/ntdll/signal_x86_64.c | 2 +- +- 1 file changed, 1 insertion(+), 1 deletion(-) ++ dlls/ntdll/signal_x86_64.c | 5 +++-- ++ 1 file changed, 3 insertions(+), 2 deletions(-) + + diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c +-index 05581c2..e739cdb 100644 ++index 05581c2..7072569 100644 + --- a/dlls/ntdll/signal_x86_64.c + +++ b/dlls/ntdll/signal_x86_64.c +-@@ -3178,7 +3178,7 @@ void WINAPI RtlUnwindEx( PVOID end_frame, PVOID target_ip, EXCEPTION_RECORD *rec +- dispatch.EstablisherFrame = new_context.Rsp; ++@@ -3167,6 +3167,7 @@ void WINAPI RtlUnwindEx( PVOID end_frame, PVOID target_ip, EXCEPTION_RECORD *rec ++ } ++ else /* hack: call builtin handlers registered in the tib list */ ++ { +++ DWORD64 backup_frame = dispatch.EstablisherFrame; ++ while ((ULONG64)teb_frame < new_context.Rsp && (ULONG64)teb_frame < (ULONG64)end_frame) ++ { ++ TRACE( "found builtin frame %p handler %p\n", teb_frame, teb_frame->Handler ); ++@@ -3175,10 +3176,10 @@ void WINAPI RtlUnwindEx( PVOID end_frame, PVOID target_ip, EXCEPTION_RECORD *rec ++ teb_frame = __wine_pop_frame( teb_frame ); ++ } ++ if ((ULONG64)teb_frame == (ULONG64)end_frame && (ULONG64)end_frame < new_context.Rsp) break; ++- dispatch.EstablisherFrame = new_context.Rsp; +++ dispatch.EstablisherFrame = backup_frame; + } + + - if (context->Rsp == (ULONG64)end_frame) break; +@@ -21,5 +35,5 @@ index 05581c2..e739cdb 100644 + } + + -- +-2.2.1 ++2.2.2 + +diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh +index b1ac228..9f8a0fa 100755 +--- a/patches/patchinstall.sh ++++ b/patches/patchinstall.sh +@@ -2228,7 +2228,7 @@ fi + if test "$enable_ntdll_RtlUnwindEx" -eq 1; then + patch_apply ntdll-RtlUnwindEx/0001-ntdll-Fix-check-for-end_frame-in-RtlUnwindEx-on-x86_.patch + ( +- echo '+ { "Sebastian Lackner", "ntdll: Fix check for end_frame in RtlUnwindEx on x86_64.", 1 },'; ++ echo '+ { "Sebastian Lackner", "ntdll: Fix check for end_frame in RtlUnwindEx on x86_64.", 2 },'; + ) >> "$patchlist" + fi + diff --git a/wine.spec b/wine.spec index 970316a..a559556 100644 --- a/wine.spec +++ b/wine.spec @@ -9,9 +9,17 @@ %global compholio 1 %endif # 0%{?fedora} +# binfmt macros for RHEL +%if 0%{?fedora} <= 20 || 0%{?rhel} == 7 +%_binfmtdir /usr/lib/binfmt.d +%binfmt_apply() \ +/usr/lib/systemd/systemd-binfmt %{?*} >/dev/null 2>&1 || : \ +%{nil} +%endif + Name: wine Version: 1.7.36 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A compatibility layer for windows applications Group: Applications/Emulators @@ -62,6 +70,9 @@ Patch511: wine-cjk.patch # pulseaudio-patch is covered by that patch-set, too. Source900: https://github.com/compholio/wine-compholio/archive/v%{version}.tar.gz#/wine-staging-%{version}.tar.gz +# https://bugs.wine-staging.com/show_bug.cgi?id=68 +Patch900: wine-staging-rtlunwindex.patch + %if !%{?no64bit} ExclusiveArch: %{ix86} x86_64 %{arm} %else @@ -292,7 +303,7 @@ Provides: wine-wow = %{version}-%{release} %description core Wine core package includes the basic wine stuff needed by all other packages. -%if 0%{?fedora} >= 15 +%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7 %package systemd Summary: Systemd config for the wine binfmt handler Group: Applications/Emulators @@ -340,7 +351,7 @@ Requires(preun): /sbin/chkconfig, /sbin/service Requires(postun): desktop-file-utils >= 0.8 Requires: wine-core = %{version}-%{release} Requires: wine-common = %{version}-%{release} -%if 0%{?fedora} >= 15 +%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7 Requires: wine-systemd = %{version}-%{release} %endif Requires: hicolor-icon-theme @@ -605,6 +616,7 @@ This package adds the opencl driver for wine. # since the pulse patch is included in the compholio patches use it from # there gzip -dc %{SOURCE900} | tar -xf - --strip-components=1 +%patch900 -p1 -b.rtlunwindex %if 0%{?compholio} %{__make} -C patches DESTDIR="`pwd`" install @@ -685,9 +697,9 @@ mkdir -p %{buildroot}%{_sysconfdir}/wine # Allow users to launch Windows programs by just clicking on the .exe file... mkdir -p %{buildroot}%{_initrddir} install -p -c -m 755 %{SOURCE1} %{buildroot}%{_initrddir}/wine -%if 0%{?fedora} >= 15 -mkdir -p %{buildroot}%{_usr}/lib/binfmt.d -install -p -c -m 644 %{SOURCE2} %{buildroot}%{_usr}/lib/binfmt.d/wine.conf +%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7 +mkdir -p %{buildroot}%{_binfmtdir} +install -p -c -m 644 %{SOURCE2} %{buildroot}%{_binfmtdir}/wine.conf %endif # add wine dir to desktop @@ -868,7 +880,7 @@ if [ $1 -eq 0 ]; then fi %post systemd -/bin/systemctl try-restart systemd-binfmt.service +%binfmt_apply wine.conf %postun systemd if [ $1 -eq 0 ]; then @@ -1733,9 +1745,9 @@ fi %{_datadir}/icons/hicolor/scalable/apps/*svg %endif -%if 0%{?fedora} >= 15 +%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7 %files systemd -%config %{_usr}/lib/binfmt.d/wine.conf +%config %{_binfmtdir}/wine.conf %files sysvinit %endif @@ -1802,6 +1814,10 @@ fi %{_libdir}/wine/opencl.dll.so %changelog +* Mon Feb 16 2015 Michael Cronenworth - 1.7.36-2 +- Patch for RtlUnwindEx fix (staging bz #68) +- Use new systemd macros for binfmt handling + * Sun Feb 08 2015 Michael Cronenworth - 1.7.36-1 - version upgrade