Added patch to implement preloader for Mac OS.

This commit is contained in:
Sebastian Lackner 2017-06-12 00:50:05 +02:00
parent 5392d42292
commit b5d451ae12
4 changed files with 811 additions and 0 deletions

View File

@ -0,0 +1,49 @@
From 3174d46a02a1112d2f31a16ad895731fbbaddf21 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Mon, 12 Jun 2017 00:18:37 +0200
Subject: libs/wine: Do not restrict base address of main thread on 64 bit mac
os.
---
libs/wine/loader.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libs/wine/loader.c b/libs/wine/loader.c
index e362a1d1939..5f37dc978ba 100644
--- a/libs/wine/loader.c
+++ b/libs/wine/loader.c
@@ -700,6 +700,7 @@ struct apple_stack_info
* Callback for wine_mmap_enum_reserved_areas to allocate space for
* the secondary thread's stack.
*/
+#ifndef _WIN64
static int apple_alloc_thread_stack( void *base, size_t size, void *arg )
{
struct apple_stack_info *info = arg;
@@ -716,6 +717,7 @@ static int apple_alloc_thread_stack( void *base, size_t size, void *arg )
info->desired_size, PROT_READ|PROT_WRITE, MAP_FIXED );
return (info->stack != (void *)-1);
}
+#endif
/***********************************************************************
* apple_create_wine_thread
@@ -733,6 +735,7 @@ static void apple_create_wine_thread( void *init_func )
if (!pthread_attr_init( &attr ))
{
+#ifndef _WIN64
struct apple_stack_info info;
/* Try to put the new thread's stack in the reserved area. If this
@@ -744,6 +747,7 @@ static void apple_create_wine_thread( void *init_func )
wine_mmap_remove_reserved_area( info.stack, info.desired_size, 0 );
pthread_attr_setstackaddr( &attr, (char*)info.stack + info.desired_size );
}
+#endif
if (!pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_JOINABLE ) &&
!pthread_create( &thread, &attr, init_func, NULL ))
--
2.13.1

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,3 @@
Fixes: [33159] Implement preloader for Mac OS
Depends: Staging
Depends: configure-Absolute_RPATH

View File

@ -203,6 +203,7 @@ patch_enable_all ()
enable_krnl386_exe16__lclose16="$1"
enable_libs_Debug_Channel="$1"
enable_libs_Unicode_Collation="$1"
enable_loader_OSX_Preloader="$1"
enable_makedep_PARENTSPEC="$1"
enable_mmsystem_dll16_MIDIHDR_Refcount="$1"
enable_mountmgr_DosDevices="$1"
@ -846,6 +847,9 @@ patch_enable ()
libs-Unicode_Collation)
enable_libs_Unicode_Collation="$2"
;;
loader-OSX_Preloader)
enable_loader_OSX_Preloader="$2"
;;
makedep-PARENTSPEC)
enable_makedep_PARENTSPEC="$2"
;;
@ -2477,6 +2481,17 @@ if test "$enable_ntdll_ApiSetMap" -eq 1; then
enable_ntdll_ThreadTime=1
fi
if test "$enable_loader_OSX_Preloader" -eq 1; then
if test "$enable_Staging" -gt 1; then
abort "Patchset Staging disabled, but loader-OSX_Preloader depends on that."
fi
if test "$enable_configure_Absolute_RPATH" -gt 1; then
abort "Patchset configure-Absolute_RPATH disabled, but loader-OSX_Preloader depends on that."
fi
enable_Staging=1
enable_configure_Absolute_RPATH=1
fi
if test "$enable_kernel32_SetFileCompletionNotificationModes" -eq 1; then
if test "$enable_ntdll_FileNameInformation" -gt 1; then
abort "Patchset ntdll-FileNameInformation disabled, but kernel32-SetFileCompletionNotificationModes depends on that."
@ -5115,6 +5130,27 @@ if test "$enable_libs_Unicode_Collation" -eq 1; then
) >> "$patchlist"
fi
# Patchset loader-OSX_Preloader
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * Staging, configure-Absolute_RPATH
# |
# | This patchset fixes the following Wine bugs:
# | * [#33159] Implement preloader for Mac OS
# |
# | Modified files:
# | * Makefile.in, configure.ac, dlls/ntdll/virtual.c, libs/wine/config.c, libs/wine/loader.c, loader/Makefile.in,
# | loader/main.c, loader/preloader.c
# |
if test "$enable_loader_OSX_Preloader" -eq 1; then
patch_apply loader-OSX_Preloader/0001-libs-wine-Do-not-restrict-base-address-of-main-threa.patch
patch_apply loader-OSX_Preloader/0002-loader-Implement-preloader-for-Mac-OS.patch
(
printf '%s\n' '+ { "Michael Müller", "libs/wine: Do not restrict base address of main thread on 64 bit mac os.", 1 },';
printf '%s\n' '+ { "Sebastian Lackner", "loader: Implement preloader for Mac OS.", 1 },';
) >> "$patchlist"
fi
# Patchset makedep-PARENTSPEC
# |
# | Modified files: