Compare commits

...

9 Commits

Author SHA1 Message Date
Sebastian Lackner
154a80f8be Release 2.10-3 (macOS preloader fixes). 2017-06-18 18:21:12 +02:00
Sebastian Lackner
dfdeb2e61a loader-OSX_Preloader: Add PAGEZERO section for wine-preloader executable.
For wine64-preloader we already do that, but apparently there are also kernel
versions which enforce a PAGEZERO section for 32-bit executables.

(cherry picked from commit 907dc4eae6)
2017-06-17 21:03:13 +02:00
Sebastian Lackner
abb1f3201c Release 2.10-2 (macOS preloader fixes). 2017-06-16 00:50:52 +02:00
Sebastian Lackner
0ef6e01258 loader-OSX_Preloader: Fall back to MAP_FIXED if address hint is ignored.
This should get rid of preloader warnings on old versions of macOS.
Thanks to Gijs Vermeulen for help with debugging and testing this patch.

Ideally, we would like to use vm_allocate, but since the preloader runs
very early during the startup of the process, we don't have all required
libc functions available. Also, we don't want to reimplement it ourself,
which would be very unreliable in practice.

For now, lets just use mincore() to check if there are any other pages
mapped within the area, and then fallback to MAP_FIXED.

(cherry picked from commit f254a73e66)
2017-06-15 18:52:12 +02:00
Sebastian Lackner
256e818da5 loader-OSX_Preloader: Temporarily map address ranges needed for Wine builtin DLLs.
(cherry picked from commit 463f2b02c9)
2017-06-15 05:31:20 +02:00
Sebastian Lackner
bc32032f02 loader-OSX_Preloader: Allocate pagezero for main wine binary.
This change should fix compatibility with old versions of macOS.
Thanks to Gijs Vermeulen for help with debugging and testing this patch.

Old versions of libsystem_c.dylib crash while running initializers when
the application does not contain a PAGEZERO section. This is probably
caused by an incorrect comparison against NULL instead of (void *)-1.

Unfortunately, when we just add a PAGEZERO section, we trigger the next
bug - no matter if we actually use the page at address (void *)0 or not,
it will not be used because the relocation code tries to find a memory
hole of size (highAddr - lowAddr) ~ 2GB.

We might be able to workaround this issue by manually reordering the
sections in the main executable, but for now lets just drop the fixed
image base. Please note that this introduces a risk of conflicts with
builtin DLLs, which will be resolved in the next patch.

(cherry picked from commit e9daff5bc8)
2017-06-15 05:31:05 +02:00
Sebastian Lackner
199b98a78b patchinstall.sh: Add workaround for mktemp on macOS <= 10.10.
(cherry picked from commit ecdf44fe29)
2017-06-15 05:30:50 +02:00
Sebastian Lackner
c0525850fc patchinstall.sh: Do not use 'readlink -f' to improve compatibility with macOS.
(cherry picked from commit 3a7c5ae711)
2017-06-15 05:30:33 +02:00
Sebastian Lackner
d4aa71ae9d loader-OSX_Preloader: Fix compile error with old SDK versions.
(cherry picked from commit 3fab2fbed2)
2017-06-15 05:30:13 +02:00
4 changed files with 130 additions and 65 deletions

View File

@@ -1,20 +1,20 @@
From e3a9a59d25e11351bf8ff6ed0578c5defbad84ae Mon Sep 17 00:00:00 2001
From 9d3cd3764ad26ae8f190524943ce63a771f6b992 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Mon, 12 Jun 2017 00:16:08 +0200
Subject: loader: Implement preloader for Mac OS.
---
Makefile.in | 1 +
configure.ac | 32 ++++-
configure.ac | 23 ++-
dlls/ntdll/virtual.c | 2 -
libs/wine/config.c | 2 +-
loader/Makefile.in | 4 +-
loader/main.c | 44 ++----
loader/preloader.c | 386 +++++++++++++++++++++++++++++++++++++++++++++++++--
7 files changed, 420 insertions(+), 51 deletions(-)
loader/main.c | 44 +----
loader/preloader.c | 451 +++++++++++++++++++++++++++++++++++++++++++++++++--
7 files changed, 475 insertions(+), 52 deletions(-)
diff --git a/Makefile.in b/Makefile.in
index 22b2ae72305..29b6cbdd535 100644
index 22b2ae7230..29b6cbdd53 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -89,6 +89,7 @@ WINELOADER_PROGRAMS = @WINELOADER_PROGRAMS@
@@ -26,10 +26,10 @@ index 22b2ae72305..29b6cbdd535 100644
LIBWINE_IMPORTLIB = @LIBWINE_IMPORTLIB@
LIBWINE_INSTALL_LIB = @LIBWINE_INSTALL_LIB@
diff --git a/configure.ac b/configure.ac
index 5aaa20c22b6..433e7fa959c 100644
index 0f2221963d..d9bdf413bb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -709,6 +709,7 @@ AC_SUBST(LDRPATH_INSTALL,"")
@@ -683,6 +683,7 @@ AC_SUBST(LDRPATH_INSTALL,"")
AC_SUBST(LDRPATH_LOCAL,"")
AC_SUBST(LDEXECFLAGS,"")
AC_SUBST(WINELOADER_LDFLAGS,"")
@@ -37,36 +37,27 @@ index 5aaa20c22b6..433e7fa959c 100644
LIBEXT="so"
DLLEXT=".so"
IMPLIBEXT="def"
@@ -767,9 +768,26 @@ case $host_os in
@@ -741,9 +742,17 @@ case $host_os in
AC_SUBST(APPLICATIONSERVICES_LIBS,"-framework ApplicationServices")
AC_SUBST(CORESERVICES_LIBS,"-framework CoreServices")
AC_SUBST(APPKIT_LIBS,"-framework AppKit")
- WINELOADER_LDFLAGS="-image_base 0x7bf00000 -Wl,-pagezero_size,0x1000,-segaddr,WINE_DOS,0x00001000,-segaddr,WINE_SHAREDHEAP,0x7f000000,-sectcreate,__TEXT,__info_plist,wine_info.plist"
+
+ WINELOADER_LDFLAGS="-Wl,-image_base,0x7bf00000,-pie,-sectcreate,__TEXT,__info_plist,wine_info.plist"
+ WINELOADER_LDFLAGS="-Wl,-pie,-pagezero_size,0x1000,-sectcreate,__TEXT,__info_plist,wine_info.plist"
+ WINE_TRY_CFLAGS([-fPIC -Wl,--export-dynamic],
+ [WINELOADER_LDFLAGS="-Wl,--export-dynamic $WINELOADER_LDFLAGS"])
+
+ WINEPRELOADER_LDFLAGS="-nostartfiles -nodefaultlibs -e _start -ldylib1.o -Wl,-image_base,0x7c400000,-sectcreate,__TEXT,__info_plist,wine_info.plist"
+ WINEPRELOADER_LDFLAGS="-nostartfiles -nodefaultlibs -e _start -ldylib1.o -Wl,-image_base,0x7c400000,-pagezero_size,0x1000,-sectcreate,__TEXT,__info_plist,wine_info.plist"
+ WINE_TRY_CFLAGS([-Wl,-no_new_main -e _main],
+ [WINEPRELOADER_LDFLAGS="-Wl,-no_new_main $WINEPRELOADER_LDFLAGS"])
WINE_TRY_CFLAGS([-Wl,-no_pie],
- [WINELOADER_LDFLAGS="-Wl,-no_pie $WINELOADER_LDFLAGS"])
+ [WINEPRELOADER_LDFLAGS="-Wl,-no_pie $WINEPRELOADER_LDFLAGS"])
+
+ case $host_cpu in
+ *i[[3456789]]86*)
+ WINELOADER_LDFLAGS="-Wl,-pagezero_size,0x0 $WINELOADER_LDFLAGS"
+ WINEPRELOADER_LDFLAGS="-Wl,-pagezero_size,0x0 $WINEPRELOADER_LDFLAGS" ;;
+ *x86_64*)
+ WINELOADER_LDFLAGS="-Wl,-pagezero_size,0x1000 $WINELOADER_LDFLAGS"
+ WINEPRELOADER_LDFLAGS="-Wl,-pagezero_size,0x1000 $WINEPRELOADER_LDFLAGS" ;;
+ esac
+
if test "$ac_cv_header_DiskArbitration_DiskArbitration_h" = "yes"
then
dnl DiskArbitration API is not public on Darwin < 8.0, use it only if header found
@@ -882,6 +900,7 @@ case $host_os in
@@ -856,6 +865,7 @@ case $host_os in
enable_wineandroid_drv=${enable_wineandroid_drv:-yes}
WINE_TRY_CFLAGS([-fPIC -Wl,--export-dynamic],
[WINELOADER_LDFLAGS="-Wl,--export-dynamic"])
@@ -74,7 +65,7 @@ index 5aaa20c22b6..433e7fa959c 100644
WINE_TRY_CFLAGS([-fPIC -Wl,--rpath,\$ORIGIN/../lib],
[LDRPATH_INSTALL="-Wl,--rpath,\\\$\$ORIGIN/\`\$(MAKEDEP) -R \${bindir} \${libdir}\`"
LDRPATH_LOCAL="-Wl,--rpath,\\\$\$ORIGIN/\$(top_builddir)/libs/wine"],
@@ -926,6 +945,7 @@ case $host_os in
@@ -900,6 +910,7 @@ case $host_os in
WINE_TRY_CFLAGS([-fPIC -Wl,--export-dynamic],
[WINELOADER_LDFLAGS="-Wl,--export-dynamic"])
@@ -82,7 +73,7 @@ index 5aaa20c22b6..433e7fa959c 100644
WINE_TRY_CFLAGS([-fPIC -Wl,--rpath,\$ORIGIN/../lib],
[LDRPATH_INSTALL="-Wl,--rpath,\\\$\$ORIGIN/\`\$(MAKEDEP) -R \${bindir} \${libdir}\`:\$(DESTDIR)\${libdir}"
@@ -2085,6 +2105,14 @@ case $host_os in
@@ -2009,6 +2020,14 @@ case $host_os in
;;
esac
;;
@@ -98,10 +89,10 @@ index 5aaa20c22b6..433e7fa959c 100644
dnl **** Check for functions ****
diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c
index 0d3fa1e5715..3a280a4b0d8 100644
index ee9c8d0195..f115576e1d 100644
--- a/dlls/ntdll/virtual.c
+++ b/dlls/ntdll/virtual.c
@@ -1941,11 +1941,9 @@ void virtual_release_address_space(void)
@@ -1840,11 +1840,9 @@ void virtual_release_address_space(void)
}
else
{
@@ -114,10 +105,10 @@ index 0d3fa1e5715..3a280a4b0d8 100644
server_leave_uninterrupted_section( &csVirtual, &sigset );
diff --git a/libs/wine/config.c b/libs/wine/config.c
index 7daf38a07b5..7223ecd89cf 100644
index be9f401d9e..bccb36a6c1 100644
--- a/libs/wine/config.c
+++ b/libs/wine/config.c
@@ -1709,7 +1709,7 @@ void wine_exec_wine_binary( const char *name, char **argv, const char *env_var )
@@ -654,7 +654,7 @@ void wine_exec_wine_binary( const char *name, char **argv, const char *env_var )
if (!name) name = argv0_name; /* no name means default loader */
@@ -127,7 +118,7 @@ index 7daf38a07b5..7223ecd89cf 100644
#else
use_preloader = 0;
diff --git a/loader/Makefile.in b/loader/Makefile.in
index 4fb91ff5417..b715f022578 100644
index 4fb91ff541..b715f02257 100644
--- a/loader/Makefile.in
+++ b/loader/Makefile.in
@@ -26,7 +26,7 @@ wine64_DEPS = $(WINELOADER_DEPENDS)
@@ -141,7 +132,7 @@ index 4fb91ff5417..b715f022578 100644
-wine64_preloader_LDFLAGS = -static -nostartfiles -nodefaultlibs -Wl,-Ttext=0x7c400000
+wine64_preloader_LDFLAGS = $(WINEPRELOADER_LDFLAGS)
diff --git a/loader/main.c b/loader/main.c
index 13740c7b3c5..5212e3f0798 100644
index 13740c7b3c..5212e3f079 100644
--- a/loader/main.c
+++ b/loader/main.c
@@ -50,30 +50,6 @@
@@ -224,7 +215,7 @@ index 13740c7b3c5..5212e3f0798 100644
wine_init( argc, argv, error, sizeof(error) );
diff --git a/loader/preloader.c b/loader/preloader.c
index 5e6add7830f..b3e80527309 100644
index 5e6add7830..5b09b79cf3 100644
--- a/loader/preloader.c
+++ b/loader/preloader.c
@@ -4,6 +4,8 @@
@@ -257,12 +248,22 @@ index 5e6add7830f..b3e80527309 100644
#ifndef MAP_COPY
#define MAP_COPY MAP_PRIVATE
#endif
@@ -117,12 +118,25 @@ static struct wine_preload_info preload_info[] =
@@ -109,7 +110,8 @@
static struct wine_preload_info preload_info[] =
{
#ifdef __i386__
- { (void *)0x00000000, 0x00010000 }, /* low 64k */
+ { (void *)0x00000000, 0x00001000 }, /* first page */
+ { (void *)0x00001000, 0x0000f000 }, /* low 64k */
{ (void *)0x00010000, 0x00100000 }, /* DOS area */
{ (void *)0x00110000, 0x67ef0000 }, /* low memory area */
{ (void *)0x7f000000, 0x03000000 }, /* top-down allocations + shared heap + virtual heap */
@@ -117,12 +119,38 @@ static struct wine_preload_info preload_info[] =
{ (void *)0x000000010000, 0x00100000 }, /* DOS area */
{ (void *)0x000000110000, 0x67ef0000 }, /* low memory area */
{ (void *)0x00007ff00000, 0x000f0000 }, /* shared user data */
+#ifdef __APPLE__
+ /* address below exceeds maximum allowed user space address in mac os */
+ /* address below exceeds maximum allowed user space address in macOS */
+ { (void *)0x7fff40000000, 0x01ff0000 }, /* top-down allocations + virtual heap */
+#else
{ (void *)0x7ffffe000000, 0x01ff0000 }, /* top-down allocations + virtual heap */
@@ -272,7 +273,20 @@ index 5e6add7830f..b3e80527309 100644
{ 0, 0 } /* end of list */
};
+#ifndef __APPLE__
+#ifdef __APPLE__
+
+#ifndef LC_MAIN
+#define LC_MAIN 0x80000028
+struct entry_point_command
+{
+ uint32_t cmd;
+ uint32_t cmdsize;
+ uint64_t entryoff;
+ uint64_t stacksize;
+};
+#endif
+
+#else /* __APPLE__ */
+
+/* ELF definitions */
+#define ELF_PREFERRED_ADDRESS(loader, maplength, mapstartpref) (mapstartpref)
@@ -283,22 +297,23 @@ index 5e6add7830f..b3e80527309 100644
/* debugging */
#undef DUMP_SEGMENTS
#undef DUMP_AUX_INFO
@@ -168,6 +182,8 @@ struct wld_auxv
@@ -168,6 +196,8 @@ struct wld_auxv
} a_un;
};
+#endif /* !__APPLE__ */
+#endif /* __APPLE__ */
+
/*
* The __bb_init_func is an empty function only called when file is
* compiled with gcc flags "-fprofile-arcs -ftest-coverage". This
@@ -182,6 +198,196 @@ void *__stack_chk_guard = 0;
@@ -182,6 +212,201 @@ void *__stack_chk_guard = 0;
void __stack_chk_fail_local(void) { return; }
void __stack_chk_fail(void) { return; }
+#ifdef __APPLE__
+#ifdef __i386__
+
+static const size_t page_size = 0x1000;
+static const size_t page_mask = 0xfff;
+#define TARGET_CPU_TYPE CPU_TYPE_X86
+#define TARGET_MH_MAGIC MH_MAGIC
@@ -388,6 +403,7 @@ index 5e6add7830f..b3e80527309 100644
+
+#elif defined(__x86_64__)
+
+static const size_t page_size = 0x1000;
+static const size_t page_mask = 0xfff;
+#define TARGET_CPU_TYPE CPU_TYPE_X86_64
+#define TARGET_MH_MAGIC MH_MAGIC_64
@@ -485,11 +501,14 @@ index 5e6add7830f..b3e80527309 100644
+void *wld_munmap( void *start, size_t len );
+SYSCALL_FUNC( wld_munmap, 73 /* SYS_munmap */ );
+
+int wld_mincore( void *addr, size_t length, unsigned char *vec );
+SYSCALL_FUNC( wld_mincore, 78 /* SYS_mincore */ );
+
+#else /* __APPLE__ */
#ifdef __i386__
/* data for setting up the glibc-style thread-local storage in %gs */
@@ -458,16 +664,17 @@ SYSCALL_NOERR( wld_getegid, 108 /* SYS_getegid */ );
@@ -458,16 +683,17 @@ SYSCALL_NOERR( wld_getegid, 108 /* SYS_getegid */ );
#else
#error preloader not implemented for this CPU
#endif
@@ -509,7 +528,7 @@ index 5e6add7830f..b3e80527309 100644
{
if (len <= 0) return 0;
while ((--len > 0) && *str1 && (*str1 == *str2)) { str1++; str2++; }
@@ -560,6 +767,8 @@ static __attribute__((noreturn,format(printf,1,2))) void fatal_error(const char
@@ -560,6 +786,8 @@ static __attribute__((noreturn,format(printf,1,2))) void fatal_error(const char
wld_exit(1);
}
@@ -518,7 +537,7 @@ index 5e6add7830f..b3e80527309 100644
#ifdef DUMP_AUX_INFO
/*
* Dump interesting bits of the ELF auxv_t structure that is passed
@@ -1039,6 +1248,8 @@ found:
@@ -1039,6 +1267,8 @@ found:
return (void *)(symtab[idx].st_value + map->l_addr);
}
@@ -527,7 +546,7 @@ index 5e6add7830f..b3e80527309 100644
/*
* preload_reserve
*
@@ -1070,6 +1281,7 @@ static void preload_reserve( const char *str )
@@ -1070,6 +1300,7 @@ static void preload_reserve( const char *str )
/* sanity checks */
if (end <= start) start = end = NULL;
@@ -535,7 +554,7 @@ index 5e6add7830f..b3e80527309 100644
else if ((char *)end > preloader_start &&
(char *)start <= preloader_end)
{
@@ -1077,6 +1289,7 @@ static void preload_reserve( const char *str )
@@ -1077,6 +1308,7 @@ static void preload_reserve( const char *str )
start, end, preloader_start, preloader_end );
start = end = NULL;
}
@@ -543,7 +562,7 @@ index 5e6add7830f..b3e80527309 100644
/* check for overlap with low memory areas */
for (i = 0; preload_info[i].size; i++)
@@ -1101,7 +1314,7 @@ error:
@@ -1101,7 +1333,7 @@ error:
}
/* check if address is in one of the reserved ranges */
@@ -552,7 +571,7 @@ index 5e6add7830f..b3e80527309 100644
{
int i;
@@ -1125,6 +1338,159 @@ static void remove_preload_range( int i )
@@ -1125,6 +1357,203 @@ static void remove_preload_range( int i )
}
}
@@ -625,6 +644,57 @@ index 5e6add7830f..b3e80527309 100644
+ return NULL;
+};
+
+static int is_region_empty( struct wine_preload_info *info )
+{
+ unsigned char vec[1024];
+ size_t pos, size, block = 1024 * page_size;
+ int i;
+
+ for (pos = 0; pos < info->size; pos += size)
+ {
+ size = (pos + block <= info->size) ? block : (info->size - pos);
+ if (wld_mincore( (char *)info->addr + pos, size, vec ) == -1)
+ {
+ if (size <= page_size) continue;
+ block = page_size; size = 0; /* retry with smaller block size */
+ }
+ else
+ {
+ for (i = 0; i < size / page_size; i++)
+ if (vec[i] & 1) return 0;
+ }
+ }
+
+ return 1;
+}
+
+static int map_region( struct wine_preload_info *info )
+{
+ int flags = MAP_PRIVATE | MAP_ANON;
+ void *ret;
+
+ if (!info->addr) flags |= MAP_FIXED;
+
+ for (;;)
+ {
+ ret = wld_mmap( info->addr, info->size, PROT_NONE, flags, -1, 0 );
+ if (ret == info->addr) return 1;
+ if (ret != (void *)-1) wld_munmap( ret, info->size );
+ if (flags & MAP_FIXED) break;
+
+ /* Some versions of macOS ignore the address hint passed to mmap -
+ * use mincore() to check if its empty and then use MAP_FIXED */
+ if (!is_region_empty( info )) break;
+ flags |= MAP_FIXED;
+ }
+
+ /* don't warn for zero page */
+ if (info->addr >= (void *)0x1000)
+ wld_printf( "preloader: Warning: failed to reserve range %p-%p\n",
+ info->addr, (char *)info->addr + info->size );
+ return 0;
+}
+
+static inline void get_dyld_func( const char *name, void **func )
+{
+ _dyld_func_lookup( name, func );
@@ -636,6 +706,7 @@ index 5e6add7830f..b3e80527309 100644
+
+void *wld_start( void *stack, int *is_unix_thread )
+{
+ struct wine_preload_info builtin_dlls = { (void *)0x7a000000, 0x02000000 };
+ struct wine_preload_info **wine_main_preload_info;
+ char **argv, **p, *reserve = NULL;
+ struct target_mach_header *mh;
@@ -662,27 +733,16 @@ index 5e6add7830f..b3e80527309 100644
+ if (reserve) preload_reserve( reserve );
+ for (i = 0; preload_info[i].size; i++)
+ {
+ int flags = MAP_PRIVATE | MAP_ANON;
+ void *ret;
+
+ if (!preload_info[i].addr)
+ flags |= MAP_FIXED;
+
+ ret = wld_mmap( preload_info[i].addr, preload_info[i].size, PROT_NONE, flags, -1, 0 );
+ if (ret != (void *)-1 && ret != preload_info[i].addr)
+ if (!map_region( &preload_info[i] ))
+ {
+ wld_munmap(ret, preload_info[i].size);
+ ret = (void *)-1;
+ }
+ if (ret == (void *)-1)
+ {
+ wld_printf( "preloader: Warning: failed to reserve range %p-%p\n",
+ preload_info[i].addr, (char *)preload_info[i].addr + preload_info[i].size );
+ remove_preload_range( i );
+ i--;
+ }
+ }
+
+ if (!map_region( &builtin_dlls ))
+ builtin_dlls.size = 0;
+
+ LOAD_POSIX_DYLD_FUNC( dlopen );
+ LOAD_POSIX_DYLD_FUNC( dlsym );
+ LOAD_MACHO_DYLD_FUNC( _dyld_image_count );
@@ -693,6 +753,9 @@ index 5e6add7830f..b3e80527309 100644
+ if (!(mod = pdlopen( argv[1], RTLD_NOW )))
+ fatal_error( "%s: could not load binary\n", argv[1] );
+
+ if (builtin_dlls.size)
+ wld_munmap( builtin_dlls.addr, builtin_dlls.size );
+
+ /* store pointer to the preload info into the appropriate main binary variable */
+ wine_main_preload_info = pdlsym( mod, "wine_main_preload_info" );
+ if (wine_main_preload_info) *wine_main_preload_info = preload_info;
@@ -712,7 +775,7 @@ index 5e6add7830f..b3e80527309 100644
/*
* is_in_preload_range
*
@@ -1293,3 +1659,5 @@ void* wld_start( void **stack )
@@ -1293,3 +1722,5 @@ void* wld_start( void **stack )
return (void *)ld_so_map.l_entry;
}

View File

@@ -58,7 +58,7 @@ upstream_commit()
# Show version information
version()
{
echo "Wine Staging 2.10"
echo "Wine Staging 2.10-3"
echo "Copyright (C) 2014-2017 the Wine Staging project authors."
echo ""
echo "Patchset to be applied on upstream Wine:"
@@ -1715,7 +1715,7 @@ patchlist="/dev/null"
backend="patch"
# Find location of patches
patchdir="$(dirname "$(readlink -f "$0")")"
patchdir="$(cd "$(dirname "$0")" && pwd)"
if test ! -f "$patchdir/patchinstall.sh"; then
if test -f ./patchinstall.sh; then
patchdir="$(pwd)"
@@ -2685,7 +2685,8 @@ fi
# If autoupdate is enabled then create a tempfile to keep track of all patches
if test "$enable_patchlist" -eq 1; then
if test "$enable_Staging" -eq 1; then
patchlist=$(mktemp)
# macOS 10.10 and prior do not allow mktemp with empty argument
patchlist=$(mktemp 2>/dev/null || mktemp -t tmp)
if test ! -f "$patchlist"; then
abort "Unable to create temporary file for patchlist."
fi

View File

@@ -1 +1 @@
Wine Staging 2.10
Wine Staging 2.10-3

View File

@@ -89,7 +89,7 @@ patchlist="/dev/null"
backend="patch"
# Find location of patches
patchdir="$(dirname "$(readlink -f "$0")")"
patchdir="$(cd "$(dirname "$0")" && pwd)"
if test ! -f "$patchdir/patchinstall.sh"; then
if test -f ./patchinstall.sh; then
patchdir="$(pwd)"
@@ -435,7 +435,8 @@ patch_apply()
# If autoupdate is enabled then create a tempfile to keep track of all patches
if test "$enable_patchlist" -eq 1; then
if test "$enable_Staging" -eq 1; then
patchlist=$(mktemp)
# macOS 10.10 and prior do not allow mktemp with empty argument
patchlist=$(mktemp 2>/dev/null || mktemp -t tmp)
if test ! -f "$patchlist"; then
abort "Unable to create temporary file for patchlist."
fi