From 6c70ccd388509ff07622bf16e91752bdf99c3ddf Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sat, 13 Jun 2015 17:39:10 +0200 Subject: [PATCH] Added patch to properly check existence for libunwind before linking against it. --- README.md | 3 +- debian/changelog | 2 + ...nfigure-Add-libunwind-configure-flag.patch | 112 ++++++++++++++++++ patches/configure-libunwind/definition | 1 + patches/patchinstall.sh | 97 +++++++++------ ...-initial-stub-for-pulseaudio-support.patch | 4 +- 6 files changed, 176 insertions(+), 43 deletions(-) create mode 100644 patches/configure-libunwind/0001-configure-Add-libunwind-configure-flag.patch create mode 100644 patches/configure-libunwind/definition diff --git a/README.md b/README.md index 1560cb27..3fcd5b33 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ Wine. All those differences are also documented on the Included bug fixes and improvements ----------------------------------- -**Bug fixes and features included in the next upcoming release [21]:** +**Bug fixes and features included in the next upcoming release [22]:** * Add implementation for kernel32.GetNumaProcessorNode ([Wine Bug #38660](https://bugs.winehq.org/show_bug.cgi?id=38660)) * Add semi-stub for FileFsVolumeInformation information class ([Wine Bug #21466](https://bugs.winehq.org/show_bug.cgi?id=21466)) @@ -56,6 +56,7 @@ Included bug fixes and improvements * Initialize System\CurrentControlSet\Control\TimeZoneInformation registry keys * Multiple applications needs better NtQueryInformationJobObject stub * Only send WM_DROPFILES when OLE dnd fails ([Wine Bug #29081](https://bugs.winehq.org/show_bug.cgi?id=29081)) +* Properly check existence of libunwind before linking against it ([Wine Bug #38713](https://bugs.winehq.org/show_bug.cgi?id=38713)) * Return proper status codes when NtReadFile/NtWriteFile is called on closed (but not disconnected) pipe * Set NamedPipeState to FILE_PIPE_CLOSING_STATE on broken pipe in NtQueryInformationFile * Support for AT_ROUND_TO_PAGE flag in NtMapViewOfSection diff --git a/debian/changelog b/debian/changelog index 4e2fc51c..4cefdf1e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -46,6 +46,8 @@ wine-staging (1.7.45) UNRELEASED; urgency=low * Added patch with stub for winscard.SCardListReadersA/W. * Added patch to implement fallback to system ping command when CAP_NET_RAW is not available. + * Added patch to properly check existence of libunwind before linking against + it. * Removed patch to handle '\r' as whitespace in wbemprox queries (accepted upstream). * Removed patch to make sure OpenClipboard with current owner doesn't fail diff --git a/patches/configure-libunwind/0001-configure-Add-libunwind-configure-flag.patch b/patches/configure-libunwind/0001-configure-Add-libunwind-configure-flag.patch new file mode 100644 index 00000000..c527f3e1 --- /dev/null +++ b/patches/configure-libunwind/0001-configure-Add-libunwind-configure-flag.patch @@ -0,0 +1,112 @@ +From b016d38d184be47fd5ba396925f3f1f1c4514bd2 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Fri, 12 Jun 2015 15:52:40 -0600 +Subject: configure: Add libunwind configure flag. + +Based on a patch by Erich E. Hoover and Ken Thomases. +--- + configure.ac | 28 ++++++++++++++++++++++++++++ + dlls/ntdll/Makefile.in | 2 +- + dlls/ntdll/signal_x86_64.c | 8 ++++---- + 3 files changed, 33 insertions(+), 5 deletions(-) + +diff --git a/configure.ac b/configure.ac +index df28b27..78e5558 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -75,4 +75,6 @@ AC_ARG_WITH(pthread, AS_HELP_STRING([--without-pthread],[do not use the pthrea + AC_ARG_WITH(sane, AS_HELP_STRING([--without-sane],[do not use SANE (scanner support)])) + AC_ARG_WITH(tiff, AS_HELP_STRING([--without-tiff],[do not use TIFF])) ++AC_ARG_WITH(unwind, AS_HELP_STRING([--without-unwind],[do not use libunwind]), ++ [if test "x$withval" = "xno"; then ac_cv_header_libunwind_h=no; fi]) + AC_ARG_WITH(v4l, AS_HELP_STRING([--without-v4l],[do not use v4l1 (v4l support)])) + AC_ARG_WITH(xcomposite,AS_HELP_STRING([--without-xcomposite],[do not use the Xcomposite extension]), +@@ -1084,6 +1086,32 @@ WINE_ERROR_WITH(pthread,[test "x$ac_cv_func_pthread_create" != xyes -a "x$PTHREA + [pthread ${notice_platform}development files not found. + Wine cannot support threads without libpthread.]) + ++dnl **** Check for libunwind **** ++ ++if test "x$enable_win64" = "xyes" ++then ++ if test "$ac_cv_header_libunwind_h" = "yes" ++ then ++ ac_save_LIBS="$LIBS" ++ AC_MSG_CHECKING([for libunwind]) ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define UNW_LOCAL_ONLY ++ #include ]], [[unw_context_t u; unw_cursor_t c; unw_getcontext(&u); unw_init_local(&c, &u);]])], ++ [AC_MSG_RESULT([yes, without linking]) ++ AC_DEFINE(HAVE_LIBUNWIND, 1, [Define to 1 if you have libunwind])], ++ [LIBS="$LIBS -lunwind" ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define UNW_LOCAL_ONLY ++ #include ]], [[unw_context_t u; unw_cursor_t c; unw_getcontext(&u); unw_init_local(&c, &u);]])], ++ [AC_MSG_RESULT([yes, with linking]) ++ AC_SUBST(UNWIND_LIBS,"-lunwind") ++ AC_DEFINE(HAVE_LIBUNWIND, 1, [Define to 1 if you have libunwind])], ++ [AC_MSG_RESULT([no]) ++ ac_cv_header_libunwind_h=no])]) ++ LIBS="$ac_save_LIBS" ++ fi ++ WINE_NOTICE_WITH(unwind,[test "x$ac_cv_header_libunwind_h" != xyes], ++ [libunwind ${notice_platform}development files not found.]) ++fi ++ + dnl **** Check for X11 **** + + AC_PATH_XTRA +diff --git a/dlls/ntdll/Makefile.in b/dlls/ntdll/Makefile.in +index ed4bb94..08f094a 100644 +--- a/dlls/ntdll/Makefile.in ++++ b/dlls/ntdll/Makefile.in +@@ -2,7 +2,7 @@ EXTRADEFS = -D_NTSYSTEM_ + MODULE = ntdll.dll + IMPORTLIB = ntdll + IMPORTS = winecrt0 +-EXTRALIBS = $(IOKIT_LIBS) $(RT_LIBS) $(PTHREAD_LIBS) ++EXTRALIBS = $(IOKIT_LIBS) $(RT_LIBS) $(PTHREAD_LIBS) $(UNWIND_LIBS) + EXTRADLLFLAGS = -nodefaultlibs -Wl,--image-base,0x7bc00000 + + C_SRCS = \ +diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c +index 9b98894..a4aa269 100644 +--- a/dlls/ntdll/signal_x86_64.c ++++ b/dlls/ntdll/signal_x86_64.c +@@ -51,7 +51,7 @@ + #ifdef HAVE_SYS_UCONTEXT_H + # include + #endif +-#ifdef HAVE_LIBUNWIND_H ++#ifdef HAVE_LIBUNWIND + # define UNW_LOCAL_ONLY + # include + #endif +@@ -1431,7 +1431,7 @@ static NTSTATUS dwarf_virtual_unwind( ULONG64 ip, ULONG64 *frame,CONTEXT *contex + } + + +-#if HAVE_LIBUNWIND_H ++#if HAVE_LIBUNWIND + /*********************************************************************** + * libunwind_set_cursor_from_context + */ +@@ -2341,7 +2341,7 @@ static NTSTATUS call_stack_handlers( EXCEPTION_RECORD *rec, CONTEXT *orig_contex + if (status != STATUS_SUCCESS) return status; + got_info = TRUE; + } +-#if HAVE_LIBUNWIND_H ++#if HAVE_LIBUNWIND + else + { + status = libunwind_virtual_unwind( context.Rip, &got_info, &dispatch.EstablisherFrame, &new_context, +@@ -3369,7 +3369,7 @@ void WINAPI RtlUnwindEx( PVOID end_frame, PVOID target_ip, EXCEPTION_RECORD *rec + if (status != STATUS_SUCCESS) raise_status( status, rec ); + got_info = TRUE; + } +-#if HAVE_LIBUNWIND_H ++#if HAVE_LIBUNWIND + else + { + status = libunwind_virtual_unwind( context->Rip, &got_info, &dispatch.EstablisherFrame, &new_context, +-- +2.4.2 + diff --git a/patches/configure-libunwind/definition b/patches/configure-libunwind/definition new file mode 100644 index 00000000..281cae5e --- /dev/null +++ b/patches/configure-libunwind/definition @@ -0,0 +1 @@ +Fixes: [38713] Properly check existence of libunwind before linking against it diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 756a4b68..f9b733b6 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -85,6 +85,7 @@ patch_enable_all () enable_combase_String="$1" enable_comctl32_LoadIconMetric="$1" enable_configure_Absolute_RPATH="$1" + enable_configure_libunwind="$1" enable_crypt32_CMS_Certificates="$1" enable_d3d11_D3D11CreateDeviceAndSwapChain="$1" enable_d3d9_DesktopWindow="$1" @@ -336,6 +337,9 @@ patch_enable () configure-Absolute_RPATH) enable_configure_Absolute_RPATH="$2" ;; + configure-libunwind) + enable_configure_libunwind="$2" + ;; crypt32-CMS_Certificates) enable_crypt32_CMS_Certificates="$2" ;; @@ -2163,6 +2167,21 @@ if test "$enable_configure_Absolute_RPATH" -eq 1; then ) >> "$patchlist" fi +# Patchset configure-libunwind +# | +# | This patchset fixes the following Wine bugs: +# | * [#38713] Properly check existence of libunwind before linking against it +# | +# | Modified files: +# | * configure.ac, dlls/ntdll/Makefile.in, dlls/ntdll/signal_x86_64.c +# | +if test "$enable_configure_libunwind" -eq 1; then + patch_apply configure-libunwind/0001-configure-Add-libunwind-configure-flag.patch + ( + echo '+ { "Sebastian Lackner", "configure: Add libunwind configure flag.", 1 },'; + ) >> "$patchlist" +fi + # Patchset crypt32-CMS_Certificates # | # | This patchset fixes the following Wine bugs: @@ -5077,6 +5096,45 @@ if test "$enable_wined3d_CSMT_Helper" -eq 1; then ) >> "$patchlist" fi +# Patchset wined3d-Multisampling +# | +# | This patchset fixes the following Wine bugs: +# | * [#12652] Allow to override number of quality levels for D3DMULTISAMPLE_NONMASKABLE. +# | +# | Modified files: +# | * dlls/wined3d/directx.c, dlls/wined3d/wined3d_main.c, dlls/wined3d/wined3d_private.h +# | +if test "$enable_wined3d_Multisampling" -eq 1; then + patch_apply wined3d-Multisampling/0001-wined3d-Allow-to-specify-multisampling-AA-quality-le.patch + ( + echo '+ { "Austin English", "wined3d: Allow to specify multisampling AA quality levels via registry.", 1 },'; + ) >> "$patchlist" +fi + +# Patchset wined3d-UnhandledBlendFactor +# | +# | Modified files: +# | * dlls/wined3d/state.c +# | +if test "$enable_wined3d_UnhandledBlendFactor" -eq 1; then + patch_apply wined3d-UnhandledBlendFactor/0001-wined3d-Silence-repeated-Unhandled-blend-factor-0-me.patch + ( + echo '+ { "Sebastian Lackner", "wined3d: Silence repeated '\''Unhandled blend factor 0'\'' messages.", 1 },'; + ) >> "$patchlist" +fi + +# Patchset wined3d-wined3d_swapchain_present +# | +# | Modified files: +# | * dlls/wined3d/swapchain.c +# | +if test "$enable_wined3d_wined3d_swapchain_present" -eq 1; then + patch_apply wined3d-wined3d_swapchain_present/0001-wined3d-Silence-repeated-wined3d_swapchain_present-F.patch + ( + echo '+ { "Sebastian Lackner", "wined3d: Silence repeated wined3d_swapchain_present FIXME.", 1 },'; + ) >> "$patchlist" +fi + # Patchset wined3d-Revert_PixelFormat # | # | This patchset fixes the following Wine bugs: @@ -5123,45 +5181,6 @@ if test "$enable_wined3d_resource_check_usage" -eq 1; then ) >> "$patchlist" fi -# Patchset wined3d-UnhandledBlendFactor -# | -# | Modified files: -# | * dlls/wined3d/state.c -# | -if test "$enable_wined3d_UnhandledBlendFactor" -eq 1; then - patch_apply wined3d-UnhandledBlendFactor/0001-wined3d-Silence-repeated-Unhandled-blend-factor-0-me.patch - ( - echo '+ { "Sebastian Lackner", "wined3d: Silence repeated '\''Unhandled blend factor 0'\'' messages.", 1 },'; - ) >> "$patchlist" -fi - -# Patchset wined3d-wined3d_swapchain_present -# | -# | Modified files: -# | * dlls/wined3d/swapchain.c -# | -if test "$enable_wined3d_wined3d_swapchain_present" -eq 1; then - patch_apply wined3d-wined3d_swapchain_present/0001-wined3d-Silence-repeated-wined3d_swapchain_present-F.patch - ( - echo '+ { "Sebastian Lackner", "wined3d: Silence repeated wined3d_swapchain_present FIXME.", 1 },'; - ) >> "$patchlist" -fi - -# Patchset wined3d-Multisampling -# | -# | This patchset fixes the following Wine bugs: -# | * [#12652] Allow to override number of quality levels for D3DMULTISAMPLE_NONMASKABLE. -# | -# | Modified files: -# | * dlls/wined3d/directx.c, dlls/wined3d/wined3d_main.c, dlls/wined3d/wined3d_private.h -# | -if test "$enable_wined3d_Multisampling" -eq 1; then - patch_apply wined3d-Multisampling/0001-wined3d-Allow-to-specify-multisampling-AA-quality-le.patch - ( - echo '+ { "Austin English", "wined3d: Allow to specify multisampling AA quality levels via registry.", 1 },'; - ) >> "$patchlist" -fi - # Patchset wined3d-CSMT_Main # | # | This patchset fixes the following Wine bugs: diff --git a/patches/winepulse-PulseAudio_Support/0001-winepulse-Add-initial-stub-for-pulseaudio-support.patch b/patches/winepulse-PulseAudio_Support/0001-winepulse-Add-initial-stub-for-pulseaudio-support.patch index 025f35c7..ae42c83c 100644 --- a/patches/winepulse-PulseAudio_Support/0001-winepulse-Add-initial-stub-for-pulseaudio-support.patch +++ b/patches/winepulse-PulseAudio_Support/0001-winepulse-Add-initial-stub-for-pulseaudio-support.patch @@ -18,14 +18,12 @@ diff --git a/configure.ac b/configure.ac index d23227a..76aed78 100644 --- a/configure.ac +++ b/configure.ac -@@ -72,6 +72,7 @@ AC_ARG_WITH(pcap, AS_HELP_STRING([--without-pcap],[do not use the Packet Ca - AC_ARG_WITH(png, AS_HELP_STRING([--without-png],[do not use PNG])) +@@ -73,4 +73,5 @@ AC_ARG_WITH(png, AS_HELP_STRING([--without-png],[do not use PNG])) AC_ARG_WITH(pthread, AS_HELP_STRING([--without-pthread],[do not use the pthread library]), [if test "x$withval" = "xno"; then ac_cv_header_pthread_h=no; fi]) +AC_ARG_WITH(pulse, AC_HELP_STRING([--without-pulse],[do not use PulseAudio sound support])) AC_ARG_WITH(sane, AS_HELP_STRING([--without-sane],[do not use SANE (scanner support)])) AC_ARG_WITH(tiff, AS_HELP_STRING([--without-tiff],[do not use TIFF])) - AC_ARG_WITH(v4l, AS_HELP_STRING([--without-v4l],[do not use v4l1 (v4l support)])) @@ -1548,6 +1549,30 @@ then [GetText ${notice_platform}development files not found (or too old), po files can't be rebuilt.]) fi