From dc16523d007e72b80c05b6a317542cf79d88dab6 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sat, 27 Jun 2015 19:39:39 +0200 Subject: [PATCH] Added patch to improve output of '--check-libs' on OSX. --- debian/changelog | 1 + ...rary-paths-for-check-libs-on-Mac-OS-.patch | 64 +++++++++++++++++++ patches/patchinstall.sh | 2 + 3 files changed, 67 insertions(+) create mode 100644 patches/Staging/0006-loader-Print-library-paths-for-check-libs-on-Mac-OS-.patch diff --git a/debian/changelog b/debian/changelog index 0d031466..00b5322b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,7 @@ wine-staging (1.7.46) UNRELEASED; urgency=low * Added patch to fix wineserver crash when pipe server object is destroyed before client (fixes Wine Staging Bug #393). * Added patches to improve crosscompiling Wine for other platforms. + * Added patch to improve output of '--check-libs' on OSX. * Updated kernel32-GetVolumePathName to fix several test failures. * Updated ntoskrnl-Emulator patchset to implement emulation of MOVZX instruction on x86_64. diff --git a/patches/Staging/0006-loader-Print-library-paths-for-check-libs-on-Mac-OS-.patch b/patches/Staging/0006-loader-Print-library-paths-for-check-libs-on-Mac-OS-.patch new file mode 100644 index 00000000..e8417035 --- /dev/null +++ b/patches/Staging/0006-loader-Print-library-paths-for-check-libs-on-Mac-OS-.patch @@ -0,0 +1,64 @@ +From b4a2543264f9eb91fc259a81dea872eee3c14aba Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sat, 27 Jun 2015 19:28:51 +0200 +Subject: loader: Print library paths for --check-libs on Mac OS X. + +--- + loader/main.c | 27 ++++++++++++++++++++++++++- + 1 file changed, 26 insertions(+), 1 deletion(-) + +diff --git a/loader/main.c b/loader/main.c +index 44804e1..4d9126e 100644 +--- a/loader/main.c ++++ b/loader/main.c +@@ -48,6 +48,7 @@ + #include "main.h" + + #ifdef __APPLE__ ++#include + + #ifndef __clang__ + __asm__(".zerofill WINE_DOS, WINE_DOS, ___wine_dos, 0x40000000"); +@@ -73,6 +74,26 @@ static inline void reserve_area( void *addr, size_t size ) + wine_mmap_add_reserved_area( addr, size ); + } + ++const char *get_macho_library_path( const char *libname ) ++{ ++ unsigned int path_len, libname_len = strlen( libname ); ++ uint32_t i, count = _dyld_image_count(); ++ ++ for (i = 0; i < count; i++) ++ { ++ const char *path = _dyld_get_image_name( i ); ++ if (!path) continue; ++ ++ path_len = strlen( path ); ++ if (path_len < libname_len + 1) continue; ++ if (path[path_len - libname_len - 1] != '/') continue; ++ if (strcmp( path + path_len - libname_len, libname )) continue; ++ ++ return path; ++ } ++ return NULL; ++} ++ + #else /* __APPLE__ */ + + /* the preloader will set this variable */ +@@ -181,7 +202,11 @@ static void check_command_line( int argc, char *argv[] ) + else + #endif + { +- printf( "%s: found\n", *wine_libs ); ++ const char *path = NULL; ++ #ifdef __APPLE__ ++ path = get_macho_library_path( *wine_libs ); ++ #endif ++ printf( "%s: %s\n", *wine_libs, path ? path : "found"); + } + wine_dlclose( lib_handle, NULL, 0 ); + } +-- +2.4.3 + diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 2054d1b0..ded08600 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -1984,12 +1984,14 @@ if test "$enable_Staging" -eq 1; then patch_apply Staging/0003-winelib-Append-Staging-at-the-end-of-the-version-s.patch patch_apply Staging/0004-loader-Add-commandline-option-patches-to-show-the-pa.patch patch_apply Staging/0005-loader-Add-commandline-option-check-libs.patch + patch_apply Staging/0006-loader-Print-library-paths-for-check-libs-on-Mac-OS-.patch ( echo '+ { "Sebastian Lackner", "kernel32: Add winediag message to show warning, that this isn'\''t vanilla wine.", 1 },'; echo '+ { "Sebastian Lackner", "winedbg: Change bug reporting URL to Wine Staging.", 1 },'; echo '+ { "Sebastian Lackner", "winelib: Append '\''(Staging)'\'' at the end of the version string.", 1 },'; echo '+ { "Sebastian Lackner", "loader: Add commandline option --patches to show the patch list.", 1 },'; echo '+ { "Michael Müller", "loader: Add commandline option --check-libs.", 1 },'; + echo '+ { "Michael Müller", "loader: Print library paths for --check-libs on Mac OS X.", 1 },'; ) >> "$patchlist" fi