diff options
Diffstat (limited to 'app-emulation/wine/files')
13 files changed, 0 insertions, 1482 deletions
diff --git a/app-emulation/wine/files/wine-1.1.15-winegcc.patch b/app-emulation/wine/files/wine-1.1.15-winegcc.patch deleted file mode 100644 index a1cd890..0000000 --- a/app-emulation/wine/files/wine-1.1.15-winegcc.patch +++ /dev/null @@ -1,55 +0,0 @@ -http://bugs.gentoo.org/260726 - ---- wine-1.1.15/tools/winegcc/winegcc.c -+++ wine-1.1.15/tools/winegcc/winegcc.c -@@ -215,10 +215,13 @@ - strarray* files; - }; - -+#undef FORCE_POINTER_SIZE - #ifdef __i386__ - static const enum target_cpu build_cpu = CPU_x86; -+#define FORCE_POINTER_SIZE - #elif defined(__x86_64__) - static const enum target_cpu build_cpu = CPU_x86_64; -+#define FORCE_POINTER_SIZE - #elif defined(__sparc__) - static const enum target_cpu build_cpu = CPU_SPARC; - #elif defined(__ALPHA__) -@@ -968,6 +971,9 @@ - opts.linker_args = strarray_alloc(); - opts.compiler_args = strarray_alloc(); - opts.winebuild_args = strarray_alloc(); -+#ifdef FORCE_POINTER_SIZE -+ opts.force_pointer_size = sizeof(size_t); -+#endif - - /* determine the processor type */ - if (strendswith(argv[0], "winecpp")) opts.processor = proc_cpp; ---- wine-1.1.15/tools/winebuild/main.c -+++ wine-1.1.15/tools/winebuild/main.c -@@ -50,10 +50,13 @@ - int link_ext_symbols = 0; - int force_pointer_size = 0; - -+#undef FORCE_POINTER_SIZE - #ifdef __i386__ - enum target_cpu target_cpu = CPU_x86; -+#define FORCE_POINTER_SIZE - #elif defined(__x86_64__) - enum target_cpu target_cpu = CPU_x86_64; -+#define FORCE_POINTER_SIZE - #elif defined(__sparc__) - enum target_cpu target_cpu = CPU_SPARC; - #elif defined(__ALPHA__) -@@ -574,6 +577,10 @@ - signal( SIGTERM, exit_on_signal ); - signal( SIGINT, exit_on_signal ); - -+#ifdef FORCE_POINTER_SIZE -+ force_pointer_size = sizeof(size_t); -+#endif -+ - output_file = stdout; - argv = parse_options( argc, argv, spec ); - diff --git a/app-emulation/wine/files/wine-1.4_rc2-multilib-portage.patch b/app-emulation/wine/files/wine-1.4_rc2-multilib-portage.patch deleted file mode 100644 index be6ffc5..0000000 --- a/app-emulation/wine/files/wine-1.4_rc2-multilib-portage.patch +++ /dev/null @@ -1,40 +0,0 @@ -https://bugs.gentoo.org/show_bug.cgi?id=395615 - -Explicitly add the required -m32/m64 to *FLAGS; this overrides any -arch-specific -m* flags that may have been appended by multilib-portage. - -Even though -m32/m64 is now added to *FLAGS, -m32/m64 still has to be -explicitly added to CC and CXX due to wine's build system. For example, -winegcc saves the build-time value of CC and uses it at runtime. - ---- a/configure.ac -+++ b/configure.ac -@@ -133,12 +133,18 @@ - then - CC="$CC -m64" - CXX="$CXX -m64" -+ CFLAGS="$CFLAGS -m64" -+ LDFLAGS="$LDFLAGS -m64" -+ CXXFLAGS="$CXXFLAGS -m64" - host_cpu="x86_64" - notice_platform="64-bit " - AC_SUBST(TARGETFLAGS,"-m64") - else - CC="$CC -m32" - CXX="$CXX -m32" -+ CFLAGS="$CFLAGS -m32" -+ LDFLAGS="$LDFLAGS -m32" -+ CXXFLAGS="$CXXFLAGS -m32" - host_cpu="i386" - notice_platform="32-bit " - AC_SUBST(TARGETFLAGS,"-m32") -@@ -150,6 +156,9 @@ - then - CC="$CC -m32" - CXX="$CXX -m32" -+ CFLAGS="$CFLAGS -m32" -+ LDFLAGS="$LDFLAGS -m32" -+ CXXFLAGS="$CXXFLAGS -m32" - AC_MSG_CHECKING([whether $CC works]) - AC_LINK_IFELSE([AC_LANG_PROGRAM()],AC_MSG_RESULT([yes]), - [AC_MSG_RESULT([no]) diff --git a/app-emulation/wine/files/wine-1.5.17-osmesa-check.patch b/app-emulation/wine/files/wine-1.5.17-osmesa-check.patch deleted file mode 100644 index 8236192..0000000 --- a/app-emulation/wine/files/wine-1.5.17-osmesa-check.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 1ede664b18bd8a88359a3cebb291ad49833ee033 Mon Sep 17 00:00:00 2001 -From: Alexandre Rostovtsev <tetromino@gentoo.org> -Date: Tue, 7 Aug 2012 01:29:01 -0400 -Subject: [PATCH] Do not check for libGL symbols when checking libOSMesa - -If mesa had been built with shared glapi, glAccum is not available in -libOSMesa without explicitly linking to libGL. In addition, in -mesa-8.0.x and earlier, libOSMesa needs to be explicitly linked to -libglapi if mesa was built with shared glapi, see -https://bugs.gentoo.org/show_bug.cgi?id=399813 -And in mesa-8.1.x, libOSMesa in addition needs libdl, libpthread, and -libstdc++, see https://bugs.gentoo.org/show_bug.cgi?id=431832 ---- - configure.ac | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index cc32c24..275b792 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1128,7 +1128,13 @@ This probably prevents linking to OpenGL. Try deleting the file and restarting c - - if test "x$with_osmesa" != "xno" - then -- WINE_CHECK_SONAME(OSMesa,glAccum,,,[$X_LIBS $X_PRE_LIBS $XLIB -lm $X_EXTRA_LIBS]) -+ WINE_CHECK_SONAME(OSMesa,OSMesaCreateContext,,,[$X_LIBS $X_PRE_LIBS $XLIB -lm $X_EXTRA_LIBS]) -+ if test "x$ac_cv_lib_soname_OSMesa" = "x"; then -+ osmesa_save_CC=$CC -+ CC=$CXX -+ WINE_CHECK_SONAME(OSMesa,OSMesaCreateContext,,,[-lglapi -lpthread -ldl $X_LIBS $X_PRE_LIBS $XLIB -lm $X_EXTRA_LIBS]) -+ CC=$osmesa_save_CC -+ fi - WINE_NOTICE_WITH(osmesa,[test "x$ac_cv_lib_soname_OSMesa" = "x"], - [libOSMesa ${notice_platform}development files not found (or too old), OpenGL rendering in bitmaps won't be supported.]) - fi --- -1.8.0 - diff --git a/app-emulation/wine/files/wine-1.5.19-KUSER_SHARED_DATA_18.patch b/app-emulation/wine/files/wine-1.5.19-KUSER_SHARED_DATA_18.patch deleted file mode 100644 index 8ed74ad..0000000 --- a/app-emulation/wine/files/wine-1.5.19-KUSER_SHARED_DATA_18.patch +++ /dev/null @@ -1,144 +0,0 @@ ---- a/dlls/ntdll/Makefile.in -+++ a/dlls/ntdll/Makefile.in -@@ -2,7 +2,7 @@ EXTRADEFS = -D_NTSYSTEM_ - MODULE = ntdll.dll - IMPORTLIB = ntdll - IMPORTS = winecrt0 --EXTRALIBS = @IOKITLIB@ @LIBPTHREAD@ -+EXTRALIBS = @IOKITLIB@ @LIBPTHREAD@ -lrt - EXTRADLLFLAGS = -nodefaultlibs -Wl,--image-base,0x7bc00000 - - C_SRCS = \ ---- a/dlls/ntdll/thread.c -+++ a/dlls/ntdll/thread.c -@@ -23,6 +23,10 @@ - - #include <assert.h> - #include <stdarg.h> -+ -+#include <stdint.h> -+#include <errno.h> -+ - #include <sys/types.h> - #ifdef HAVE_SYS_MMAN_H - #include <sys/mman.h> -@@ -70,6 +74,73 @@ - static LIST_ENTRY tls_links; - static int nb_threads = 1; - -+ -+ -+static void update_shared_data_time(void) -+{ -+ LARGE_INTEGER now, start, irq; -+ -+ NtQuerySystemTime( &now ); -+ -+ //FIXME("%lld\n", now.QuadPart); -+ -+ irq.QuadPart = (now.QuadPart - server_start_time); -+ -+ user_shared_data->InterruptTime.High2Time = irq.HighPart; -+ user_shared_data->InterruptTime.LowPart = irq.LowPart; -+ user_shared_data->InterruptTime.High1Time = irq.HighPart; -+ -+ user_shared_data->SystemTime.High2Time = now.HighPart; -+ user_shared_data->SystemTime.LowPart = now.LowPart; -+ user_shared_data->SystemTime.High1Time = now.HighPart; -+ -+ start.QuadPart = irq.QuadPart / 10000; -+ -+ user_shared_data->u.TickCount.High2Time = start.HighPart; -+ user_shared_data->u.TickCount.LowPart = start.LowPart; -+ user_shared_data->u.TickCount.High1Time = start.HighPart; -+ user_shared_data->TickCountLowDeprecated = start.LowPart; -+} -+ -+static void add_timespec(struct timespec* dst, struct timespec* arg) -+{ -+ dst->tv_sec += arg->tv_sec; -+ dst->tv_nsec += arg->tv_nsec; -+ -+ if(dst->tv_nsec > 999999999) { -+ dst->tv_nsec -= 1000000000; -+ dst->tv_sec++; -+ } -+} -+ -+static void* shared_data_thread(void *thread_arg) -+{ -+ struct timespec start, arg; -+ int e; -+ -+ e = clock_gettime(CLOCK_MONOTONIC, &start); -+ if(e) { -+ FIXME("Unable to get starting time: %s (%d)\n", strerror(errno), errno); -+ return NULL; -+ } -+ -+ arg.tv_sec = 0; -+ arg.tv_nsec = 15600000; -+ -+ while(1) { -+ update_shared_data_time(); -+ add_timespec(&start, &arg); -+ e = clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &start, NULL); -+ if(e) { -+ FIXME("clock_nanosleep failed: %s (%d)\n", strerror(e), e); -+ } -+ } -+ -+ return NULL; -+} -+ -+ -+ - /*********************************************************************** - * get_unicode_string - * -@@ -199,11 +270,14 @@ - void *addr; - SIZE_T size, info_size; - HANDLE exe_file = 0; -- LARGE_INTEGER now; -+ // LARGE_INTEGER now; - NTSTATUS status; - struct ntdll_thread_data *thread_data; - static struct debug_info debug_info; /* debug info for initial thread */ - -+ pthread_t thread; -+ int s; -+ - virtual_init(); - - /* reserve space for shared user data */ -@@ -298,16 +372,28 @@ - } - - /* initialize time values in user_shared_data */ -- NtQuerySystemTime( &now ); -+ /* NtQuerySystemTime( &now ); - user_shared_data->SystemTime.LowPart = now.u.LowPart; - user_shared_data->SystemTime.High1Time = user_shared_data->SystemTime.High2Time = now.u.HighPart; - user_shared_data->u.TickCountQuad = (now.QuadPart - server_start_time) / 10000; - user_shared_data->u.TickCount.High2Time = user_shared_data->u.TickCount.High1Time; - user_shared_data->TickCountLowDeprecated = user_shared_data->u.TickCount.LowPart; -+ */ -+ - user_shared_data->TickCountMultiplier = 1 << 24; -+ -+ update_shared_data_time(); - - fill_cpu_info(); - -+ if(!(s = pthread_create(&thread, NULL, &shared_data_thread, NULL))) { -+ if(pthread_detach(thread)) -+ FIXME("Unable to detach thread\n"); -+ } else { -+ FIXME("unable to spawn thread: %s (%d)\n", strerror(s), s); -+ } -+ -+ - return exe_file; - } - diff --git a/app-emulation/wine/files/wine-1.5.23-winebuild-CCAS.patch b/app-emulation/wine/files/wine-1.5.23-winebuild-CCAS.patch deleted file mode 100644 index 3971ddd..0000000 --- a/app-emulation/wine/files/wine-1.5.23-winebuild-CCAS.patch +++ /dev/null @@ -1,214 +0,0 @@ -From 57c57e9dfae50f045503ae9f3107fa3748512483 Mon Sep 17 00:00:00 2001 -From: Alexandre Rostovtsev <tetromino@gentoo.org> -Date: Sun, 3 Feb 2013 19:19:36 -0500 -Subject: [PATCH] winebuild: Use $CCAS to assemble if found - -Commit c14bdaf1 made winebuild use Clang to assemble if found. - -However, just because a user has some version of Clang installed, it -does not mean that she wants to use Clang to assemble Wine. For example, -a user who has both Clang and GAS installed may want to use GAS to avoid -textrels (see https://bugs.gentoo.org/show_bug.cgi?id=455308). - -This patch allows the user to override which assembler gets used by -exporting CCAS at Wine configure time; the name CCAS was chosen for -compatibility with automake's standard AM_PROG_AS macro. ---- - configure | 106 ++++++++++++++++++++++++++++++++++++++++++++ - configure.ac | 4 ++ - tools/winebuild/Makefile.in | 5 ++- - tools/winebuild/utils.c | 12 +++++ - 4 files changed, 126 insertions(+), 1 deletion(-) - -diff --git a/configure b/configure -index e3253ee..d0b7777 100755 ---- a/configure -+++ b/configure -@@ -732,6 +732,8 @@ FLEX - TOOLSDIR - WOW64_DISABLE - TARGETFLAGS -+ac_ct_CCAS -+CCAS - CPPBIN - ac_ct_CXX - CXXFLAGS -@@ -861,6 +863,7 @@ CPPFLAGS - CXX - CXXFLAGS - CCC -+CCAS - CPP - XMKMF' - -@@ -1549,6 +1552,7 @@ Some influential environment variables: - you have headers in a nonstandard directory <include dir> - CXX C++ compiler command - CXXFLAGS C++ compiler flags -+ CCAS Assembler command - CPP C preprocessor - XMKMF Path to xmkmf, Makefile generator for X Window System - -@@ -4075,6 +4079,108 @@ cat >>confdefs.h <<_ACEOF - _ACEOF - - -+ -+if test -n "$ac_tool_prefix"; then -+ for ac_prog in clang gas as -+ do -+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -+set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -+$as_echo_n "checking for $ac_word... " >&6; } -+if ${ac_cv_prog_CCAS+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test -n "$CCAS"; then -+ ac_cv_prog_CCAS="$CCAS" # Let the user override the test. -+else -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ ac_cv_prog_CCAS="$ac_tool_prefix$ac_prog" -+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+ done -+IFS=$as_save_IFS -+ -+fi -+fi -+CCAS=$ac_cv_prog_CCAS -+if test -n "$CCAS"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CCAS" >&5 -+$as_echo "$CCAS" >&6; } -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+fi -+ -+ -+ test -n "$CCAS" && break -+ done -+fi -+if test -z "$CCAS"; then -+ ac_ct_CCAS=$CCAS -+ for ac_prog in clang gas as -+do -+ # Extract the first word of "$ac_prog", so it can be a program name with args. -+set dummy $ac_prog; ac_word=$2 -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -+$as_echo_n "checking for $ac_word... " >&6; } -+if ${ac_cv_prog_ac_ct_CCAS+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test -n "$ac_ct_CCAS"; then -+ ac_cv_prog_ac_ct_CCAS="$ac_ct_CCAS" # Let the user override the test. -+else -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ ac_cv_prog_ac_ct_CCAS="$ac_prog" -+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+ done -+IFS=$as_save_IFS -+ -+fi -+fi -+ac_ct_CCAS=$ac_cv_prog_ac_ct_CCAS -+if test -n "$ac_ct_CCAS"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CCAS" >&5 -+$as_echo "$ac_ct_CCAS" >&6; } -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+fi -+ -+ -+ test -n "$ac_ct_CCAS" && break -+done -+ -+ if test "x$ac_ct_CCAS" = x; then -+ CCAS=""$CC"" -+ else -+ case $cross_compiling:$ac_tool_warned in -+yes:) -+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -+ac_tool_warned=yes ;; -+esac -+ CCAS=$ac_ct_CCAS -+ fi -+fi -+ -+ - case $host in - *-darwin*) - if test "x$enable_win64" = "xyes" -diff --git a/configure.ac b/configure.ac -index c93cd08..760f325 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -126,6 +126,10 @@ dnl We can't use AC_PROG_CPP for winegcc, it uses by default $(CC) -E - AC_CHECK_TOOL(CPPBIN,cpp,cpp) - AC_DEFINE_UNQUOTED(EXEEXT,["$ac_exeext"],[Define to the file extension for executables.]) - -+dnl Analogous to AM_PROG_AS -+AC_ARG_VAR([CCAS],[Assembler command]) -+AC_CHECK_TOOLS(CCAS,[clang gas as],["$CC"]) -+ - case $host in - *-darwin*) - if test "x$enable_win64" = "xyes" -diff --git a/tools/winebuild/Makefile.in b/tools/winebuild/Makefile.in -index 2017129..3fe47a3 100644 ---- a/tools/winebuild/Makefile.in -+++ b/tools/winebuild/Makefile.in -@@ -1,4 +1,7 @@ --DEFS = -D__WINESRC__ $(EXTRADEFS) -+DEFS = \ -+ -DCCAS="\"@CCAS@\"" \ -+ -D__WINESRC__ \ -+ $(EXTRADEFS) - - PROGRAMS = winebuild$(EXEEXT) - MANPAGE = winebuild.man -diff --git a/tools/winebuild/utils.c b/tools/winebuild/utils.c -index 262ff3a..1c5f918 100644 ---- a/tools/winebuild/utils.c -+++ b/tools/winebuild/utils.c -@@ -352,6 +352,18 @@ struct strarray *get_as_command(void) - static int as_is_clang = 0; - struct strarray *args = strarray_init(); - -+ if (!as_command && strlen( CCAS )) -+ { -+ struct stat st; -+ -+ if (!stat( CCAS, &st )) -+ as_command = CCAS; -+ else -+ as_command = find_tool( CCAS, NULL ); -+ -+ if (as_command && strstr( as_command, "clang" )) as_is_clang = 1; -+ } -+ - if (!as_command) - { - as_command = find_tool( "clang", NULL ); --- -1.8.1.2 - diff --git a/app-emulation/wine/files/wine-1.5.26-winegcc.patch b/app-emulation/wine/files/wine-1.5.26-winegcc.patch deleted file mode 100644 index 2045e34..0000000 --- a/app-emulation/wine/files/wine-1.5.26-winegcc.patch +++ /dev/null @@ -1,59 +0,0 @@ -http://bugs.gentoo.org/260726 - -diff --git a/tools/winebuild/main.c b/tools/winebuild/main.c -index 16b4165..5c77267 100644 ---- a/tools/winebuild/main.c -+++ b/tools/winebuild/main.c -@@ -48,10 +48,13 @@ int link_ext_symbols = 0; - int force_pointer_size = 0; - int unwind_tables = 0; - -+#undef FORCE_POINTER_SIZE - #ifdef __i386__ - enum target_cpu target_cpu = CPU_x86; -+#define FORCE_POINTER_SIZE - #elif defined(__x86_64__) - enum target_cpu target_cpu = CPU_x86_64; -+#define FORCE_POINTER_SIZE - #elif defined(__powerpc__) - enum target_cpu target_cpu = CPU_POWERPC; - #elif defined(__arm__) -@@ -611,6 +614,10 @@ int main(int argc, char **argv) - signal( SIGTERM, exit_on_signal ); - signal( SIGINT, exit_on_signal ); - -+#ifdef FORCE_POINTER_SIZE -+ force_pointer_size = sizeof(size_t); -+#endif -+ - output_file = stdout; - argv = parse_options( argc, argv, spec ); - -diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c -index 06aa200..c44d2e3 100644 ---- a/tools/winegcc/winegcc.c -+++ b/tools/winegcc/winegcc.c -@@ -213,10 +213,13 @@ struct options - strarray* files; - }; - -+#undef FORCE_POINTER_SIZE - #ifdef __i386__ - static const enum target_cpu build_cpu = CPU_x86; -+#define FORCE_POINTER_SIZE - #elif defined(__x86_64__) - static const enum target_cpu build_cpu = CPU_x86_64; -+#define FORCE_POINTER_SIZE - #elif defined(__powerpc__) - static const enum target_cpu build_cpu = CPU_POWERPC; - #elif defined(__arm__) -@@ -1258,6 +1261,9 @@ int main(int argc, char **argv) - opts.linker_args = strarray_alloc(); - opts.compiler_args = strarray_alloc(); - opts.winebuild_args = strarray_alloc(); -+#ifdef FORCE_POINTER_SIZE -+ opts.force_pointer_size = sizeof(size_t); -+#endif - - /* determine the processor type */ - if (strendswith(argv[0], "winecpp")) opts.processor = proc_cpp; diff --git a/app-emulation/wine/files/wine-1.5.28-pathofexile.patch b/app-emulation/wine/files/wine-1.5.28-pathofexile.patch deleted file mode 100644 index ea0b3e4..0000000 --- a/app-emulation/wine/files/wine-1.5.28-pathofexile.patch +++ /dev/null @@ -1,40 +0,0 @@ ->From 7362cabccdc7f6b3aa745fcd0ec6f2701f2eb4b2 Mon Sep 17 00:00:00 2001 -From: FeepingCreature <default_357-line@yahoo.de> -Date: Fri, 8 Mar 2013 16:52:39 +0100 -Subject: ntdll: Make NtFlushVirtualMemory's msync() call asynchronous, since - FlushViewOfFile, which calls it, is specified to be asynchronous in - the MSDN - (http://msdn.microsoft.com/en-us/library/windows/desktop/aa366563%28v=vs.85%29.aspx - ). - ---- - dlls/ntdll/virtual.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c -index a99bca4..e4f2bb6 100644 ---- a/dlls/ntdll/virtual.c -+++ b/dlls/ntdll/virtual.c -@@ -62,6 +62,10 @@ WINE_DECLARE_DEBUG_CHANNEL(module); - #define MS_SYNC 0 - #endif - -+#ifndef MS_ASYNC -+#define MS_ASYNC 1 -+#endif -+ - #ifndef MAP_NORESERVE - #define MAP_NORESERVE 0 - #endif -@@ -2780,7 +2784,7 @@ NTSTATUS WINAPI NtFlushVirtualMemory( HANDLE process, LPCVOID *addr_ptr, - { - if (!*size_ptr) *size_ptr = view->size; - *addr_ptr = addr; -- if (msync( addr, *size_ptr, MS_SYNC )) status = STATUS_NOT_MAPPED_DATA; -+ if (msync( addr, *size_ptr, MS_ASYNC )) status = STATUS_NOT_MAPPED_DATA; - } - server_leave_uninterrupted_section( &csVirtual, &sigset ); - return status; --- -1.7.12 - diff --git a/app-emulation/wine/files/wine-1.6-memset-O3.patch b/app-emulation/wine/files/wine-1.6-memset-O3.patch deleted file mode 100644 index 75372f8..0000000 --- a/app-emulation/wine/files/wine-1.6-memset-O3.patch +++ /dev/null @@ -1,21 +0,0 @@ -Avoid "undefined reference to `memset'" error when building with -USE=custom-cflags and -O3 in CFLAGS with gcc-4.8. - -See: - -http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56888 -http://bugs.winehq.org/show_bug.cgi?id=33521 -https://bugs.gentoo.org/show_bug.cgi?id=480508 - -diff --git a/configure.ac b/configure.ac -index d8033cf..fe7cc7d 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1767,6 +1767,7 @@ then - - dnl Check for some compiler flags - WINE_TRY_CFLAGS([-fno-builtin],[AC_SUBST(BUILTINFLAG,"-fno-builtin")]) -+ WINE_TRY_CFLAGS([-fno-tree-loop-distribute-patterns]) - WINE_TRY_CFLAGS([-fno-strict-aliasing]) - dnl clang needs to be told to fail on unknown options - saved_CFLAGS=$CFLAGS diff --git a/app-emulation/wine/files/wine-1.7.1-KUSER_SHARED_DATA_18.patch b/app-emulation/wine/files/wine-1.7.1-KUSER_SHARED_DATA_18.patch deleted file mode 100644 index 8effafc..0000000 --- a/app-emulation/wine/files/wine-1.7.1-KUSER_SHARED_DATA_18.patch +++ /dev/null @@ -1,139 +0,0 @@ -http://bugs.winehq.org/show_bug.cgi?id=29168 -Star Wars: The Old Republic game client hangs at intro splash - -Generated from wine-1.7.13 ---- a/dlls/ntdll/thread.c -+++ b/dlls/ntdll/thread.c -@@ -23,6 +23,10 @@ - - #include <assert.h> - #include <stdarg.h> -+ -+#include <stdint.h> -+#include <errno.h> -+ - #include <sys/types.h> - #ifdef HAVE_SYS_MMAN_H - #include <sys/mman.h> -@@ -69,6 +73,73 @@ - static RTL_BITMAP fls_bitmap; - static int nb_threads = 1; - -+ -+ -+static void update_shared_data_time(void) -+{ -+ LARGE_INTEGER now, start, irq; -+ -+ NtQuerySystemTime( &now ); -+ -+ //FIXME("%lld\n", now.QuadPart); -+ -+ irq.QuadPart = (now.QuadPart - server_start_time); -+ -+ user_shared_data->InterruptTime.High2Time = irq.HighPart; -+ user_shared_data->InterruptTime.LowPart = irq.LowPart; -+ user_shared_data->InterruptTime.High1Time = irq.HighPart; -+ -+ user_shared_data->SystemTime.High2Time = now.HighPart; -+ user_shared_data->SystemTime.LowPart = now.LowPart; -+ user_shared_data->SystemTime.High1Time = now.HighPart; -+ -+ start.QuadPart = irq.QuadPart / 10000; -+ -+ user_shared_data->u.TickCount.High2Time = start.HighPart; -+ user_shared_data->u.TickCount.LowPart = start.LowPart; -+ user_shared_data->u.TickCount.High1Time = start.HighPart; -+ user_shared_data->TickCountLowDeprecated = start.LowPart; -+} -+ -+static void add_timespec(struct timespec* dst, struct timespec* arg) -+{ -+ dst->tv_sec += arg->tv_sec; -+ dst->tv_nsec += arg->tv_nsec; -+ -+ if(dst->tv_nsec > 999999999) { -+ dst->tv_nsec -= 1000000000; -+ dst->tv_sec++; -+ } -+} -+ -+static void* shared_data_thread(void *thread_arg) -+{ -+ struct timespec start, arg; -+ int e; -+ -+ e = clock_gettime(CLOCK_MONOTONIC, &start); -+ if(e) { -+ FIXME("Unable to get starting time: %s (%d)\n", strerror(errno), errno); -+ return NULL; -+ } -+ -+ arg.tv_sec = 0; -+ arg.tv_nsec = 15600000; -+ -+ while(1) { -+ update_shared_data_time(); -+ add_timespec(&start, &arg); -+ e = clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &start, NULL); -+ if(e) { -+ FIXME("clock_nanosleep failed: %s (%d)\n", strerror(e), e); -+ } -+ } -+ -+ return NULL; -+} -+ -+ -+ - /*********************************************************************** - * get_unicode_string - * -@@ -215,11 +286,14 @@ - void *addr; - SIZE_T size, info_size; - HANDLE exe_file = 0; -- LARGE_INTEGER now; -+ // LARGE_INTEGER now; - NTSTATUS status; - struct ntdll_thread_data *thread_data; - static struct debug_info debug_info; /* debug info for initial thread */ - -+ pthread_t thread; -+ int s; -+ - virtual_init(); - - /* reserve space for shared user data */ -@@ -316,18 +390,30 @@ - } - - /* initialize time values in user_shared_data */ -- NtQuerySystemTime( &now ); -+ /* NtQuerySystemTime( &now ); - user_shared_data->SystemTime.LowPart = now.u.LowPart; - user_shared_data->SystemTime.High1Time = user_shared_data->SystemTime.High2Time = now.u.HighPart; - user_shared_data->u.TickCountQuad = (now.QuadPart - server_start_time) / 10000; - user_shared_data->u.TickCount.High2Time = user_shared_data->u.TickCount.High1Time; - user_shared_data->TickCountLowDeprecated = user_shared_data->u.TickCount.LowPart; -+ */ -+ - user_shared_data->TickCountMultiplier = 1 << 24; -+ -+ update_shared_data_time(); - - fill_cpu_info(); - - NtCreateKeyedEvent( &keyed_event, GENERIC_READ | GENERIC_WRITE, NULL, 0 ); - -+ if(!(s = pthread_create(&thread, NULL, &shared_data_thread, NULL))) { -+ if(pthread_detach(thread)) -+ FIXME("Unable to detach thread\n"); -+ } else { -+ FIXME("unable to spawn thread: %s (%d)\n", strerror(s), s); -+ } -+ -+ - return exe_file; - } - diff --git a/app-emulation/wine/files/wine-1.7.12-osmesa-check.patch b/app-emulation/wine/files/wine-1.7.12-osmesa-check.patch deleted file mode 100644 index 7cafcd4..0000000 --- a/app-emulation/wine/files/wine-1.7.12-osmesa-check.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 6932b9a17c4f64c13f7060895d46334bc7022430 Mon Sep 17 00:00:00 2001 -From: Alexandre Rostovtsev <tetromino@gentoo.org> -Date: Tue, 7 Aug 2012 01:29:01 -0400 -Subject: [PATCH] Do not check for libGL symbols when checking libOSMesa - -If mesa had been built with shared glapi, glAccum is not available in -libOSMesa without explicitly linking to libGL. In addition, in -mesa-8.0.x and earlier, libOSMesa needs to be explicitly linked to -libglapi if mesa was built with shared glapi, see -https://bugs.gentoo.org/show_bug.cgi?id=399813 -And in mesa-8.1.x, libOSMesa in addition needs libdl, libpthread, and -libstdc++, see https://bugs.gentoo.org/show_bug.cgi?id=431832 ---- - configure.ac | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index de807d2..a2e8684 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1233,7 +1233,13 @@ This probably prevents linking to OpenGL. Try deleting the file and restarting c - - if test "x$with_osmesa" != "xno" - then -- WINE_CHECK_SONAME(OSMesa,glAccum,,,[$X_LIBS -lm $X_EXTRA_LIBS]) -+ WINE_CHECK_SONAME(OSMesa,OSMesaCreateContext,,,[$X_LIBS -lm $X_EXTRA_LIBS]) -+ if test "x$ac_cv_lib_soname_OSMesa" = "x"; then -+ osmesa_save_CC=$CC -+ CC=$CXX -+ WINE_CHECK_SONAME(OSMesa,OSMesaCreateContext,,,[-lglapi -lpthread -ldl $X_LIBS -lm $X_EXTRA_LIBS]) -+ CC=$osmesa_save_CC -+ fi - WINE_NOTICE_WITH(osmesa,[test "x$ac_cv_lib_soname_OSMesa" = "x"], - [libOSMesa ${notice_platform}development files not found (or too old), OpenGL rendering in bitmaps won't be supported.]) - fi --- -1.8.5.3 - diff --git a/app-emulation/wine/files/wine-1.7.2-crypt32-Skip-unknown-item-when.patch b/app-emulation/wine/files/wine-1.7.2-crypt32-Skip-unknown-item-when.patch deleted file mode 100644 index d53920a..0000000 --- a/app-emulation/wine/files/wine-1.7.2-crypt32-Skip-unknown-item-when.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 24a36ed47bfbddf83da5aaf9df1cfbe3fac59d80 Mon Sep 17 00:00:00 2001 -From: Charles Davis <cdavis5x@gmail.com> -Date: Sun, 1 Sep 2013 23:39:41 -0600 -Subject: [PATCH] crypt32: Skip unknown item when decoding a CMS certificate. -Reply-To: Wine Developer's List <wine-devel@winehq.org> - -I ran into this while trying to run Star Citizen under Wine. ---- - dlls/crypt32/decode.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/dlls/crypt32/decode.c b/dlls/crypt32/decode.c -index e5f8baf..3561700 100644 ---- a/dlls/crypt32/decode.c -+++ b/dlls/crypt32/decode.c -@@ -5502,6 +5502,8 @@ static BOOL CRYPT_AsnDecodeCMSSignerInfoInternal(const BYTE *pbEncoded, - offsetof(CMSG_CMS_SIGNER_INFO, AuthAttrs), - CRYPT_AsnDecodePKCSAttributesInternal, sizeof(CRYPT_ATTRIBUTES), - TRUE, TRUE, offsetof(CMSG_CMS_SIGNER_INFO, AuthAttrs.rgAttr), 0 }, -+ /* Unknown item */ -+ { ASN_CONSTRUCTOR | ASN_UNIVERSAL | 0x11, 0, NULL, 0, TRUE, FALSE, 0, 0 }, - { ASN_SEQUENCEOF, offsetof(CMSG_CMS_SIGNER_INFO, HashEncryptionAlgorithm), - CRYPT_AsnDecodeAlgorithmId, sizeof(CRYPT_ALGORITHM_IDENTIFIER), - FALSE, TRUE, offsetof(CMSG_CMS_SIGNER_INFO, --- -1.7.12.4 - diff --git a/app-emulation/wine/files/wine-1.7.2-osmesa-check.patch b/app-emulation/wine/files/wine-1.7.2-osmesa-check.patch deleted file mode 100644 index e20ea2c..0000000 --- a/app-emulation/wine/files/wine-1.7.2-osmesa-check.patch +++ /dev/null @@ -1,38 +0,0 @@ -From b7eb1ff48dd1210aa3e1002afc503d5df75d50b9 Mon Sep 17 00:00:00 2001 -From: Alexandre Rostovtsev <tetromino@gentoo.org> -Date: Tue, 7 Aug 2012 01:29:01 -0400 -Subject: [PATCH] Do not check for libGL symbols when checking libOSMesa - -If mesa had been built with shared glapi, glAccum is not available in -libOSMesa without explicitly linking to libGL. In addition, in -mesa-8.0.x and earlier, libOSMesa needs to be explicitly linked to -libglapi if mesa was built with shared glapi, see -https://bugs.gentoo.org/show_bug.cgi?id=399813 -And in mesa-8.1.x, libOSMesa in addition needs libdl, libpthread, and -libstdc++, see https://bugs.gentoo.org/show_bug.cgi?id=431832 ---- - configure.ac | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index 66b4dd6..0303d87 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1213,7 +1213,13 @@ This probably prevents linking to OpenGL. Try deleting the file and restarting c - - if test "x$with_osmesa" != "xno" - then -- WINE_CHECK_SONAME(OSMesa,glAccum,,,[$X_LIBS $XLIB -lm $X_EXTRA_LIBS]) -+ WINE_CHECK_SONAME(OSMesa,OSMesaCreateContext,,,[$X_LIBS $XLIB -lm $X_EXTRA_LIBS]) -+ if test "x$ac_cv_lib_soname_OSMesa" = "x"; then -+ osmesa_save_CC=$CC -+ CC=$CXX -+ WINE_CHECK_SONAME(OSMesa,OSMesaCreateContext,,,[-lglapi -lpthread -ldl $X_LIBS $XLIB -lm $X_EXTRA_LIBS]) -+ CC=$osmesa_save_CC -+ fi - WINE_NOTICE_WITH(osmesa,[test "x$ac_cv_lib_soname_OSMesa" = "x"], - [libOSMesa ${notice_platform}development files not found (or too old), OpenGL rendering in bitmaps won't be supported.]) - fi --- -1.8.3.2 - diff --git a/app-emulation/wine/files/wine-1.7.28-gstreamer-v4.patch b/app-emulation/wine/files/wine-1.7.28-gstreamer-v4.patch deleted file mode 100644 index fbf930b..0000000 --- a/app-emulation/wine/files/wine-1.7.28-gstreamer-v4.patch +++ /dev/null @@ -1,629 +0,0 @@ -From 9e081cd4a04e3326d4927aa082695f15432590e2 Mon Sep 17 00:00:00 2001 -From: Maarten Lankhorst <maarten.lankhorst@canonical.com> -Date: Thu, 14 Aug 2014 11:49:20 +0200 -Subject: [PATCH] TESTING -- override pthreads to fix gstreamer v4 - -I believe the code is ready and will work properly now in all cases. -but please test before cherry picking this patch, and report -success or failure to me please. - -Changes since v1: - - Call pthread_yield to make sure that we link against libpthread. - This fixes the build on saucy. -Changes since v2: - - Set thread_data->detached before creating the thread to prevent - a race condition. -Changes since v3: - - Set thread_data->detached CORRECTLY. Fix a small race between - thread creation and pthread_detach. ---- - dlls/ntdll/ntdll_misc.h | 3 + - dlls/ntdll/thread.c | 307 +++++++++++++++++++++++++++++++++++++-- - dlls/winegstreamer/glibthread.c | 13 ++ - libs/wine/loader.c | 7 + - libs/wine/wine.map | 6 + - loader/Makefile.in | 2 +- - loader/main.c | 41 +++++ - 7 files changed, 362 insertions(+), 17 deletions(-) - -diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h -index 4370084..1af819b 100644 ---- a/dlls/ntdll/ntdll_misc.h -+++ b/dlls/ntdll/ntdll_misc.h -@@ -28,6 +28,7 @@ - #include "winnt.h" - #include "winternl.h" - #include "wine/server.h" -+#include "wine/list.h" - - #define MAX_NT_PATH_LENGTH 277 - -@@ -235,6 +236,8 @@ struct ntdll_thread_data - WINE_VM86_TEB_INFO vm86; /* 1fc vm86 private data */ - void *exit_frame; /* 204 exit frame pointer */ - #endif -+ struct list entry; -+ BOOL detached; - }; - - static inline struct ntdll_thread_data *ntdll_get_thread_data(void) -diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c -index c8461b0..8d5470e 100644 ---- a/dlls/ntdll/thread.c -+++ b/dlls/ntdll/thread.c -@@ -33,6 +33,7 @@ - #ifdef HAVE_SYS_SYSCALL_H - #include <sys/syscall.h> - #endif -+#include <errno.h> - - #define NONAMELESSUNION - #include "ntstatus.h" -@@ -58,6 +59,7 @@ struct startup_info - TEB *teb; - PRTL_THREAD_START_ROUTINE entry_point; - void *entry_arg; -+ BOOL native_thread; - }; - - static PEB *peb; -@@ -202,6 +204,78 @@ static ULONG get_dyld_image_info_addr(void) - } - #endif /* __APPLE__ */ - -+#ifdef __linux__ -+extern typeof(pthread_create) *__glob_pthread_create, *call_pthread_create; -+extern typeof(pthread_join) *__glob_pthread_join, *call_pthread_join; -+extern typeof(pthread_detach) *__glob_pthread_detach, *call_pthread_detach; -+ -+static typeof(pthread_create) __hook_pthread_create; -+static typeof(pthread_join) __hook_pthread_join; -+static typeof(pthread_detach) __hook_pthread_detach; -+ -+static pthread_mutex_t thread_lock; -+ -+static void thread_wrap_init(void) -+{ -+ pthread_mutexattr_t attr; -+ pthread_mutexattr_init(&attr); -+ pthread_mutexattr_setrobust(&attr, PTHREAD_MUTEX_ROBUST); -+ pthread_mutex_init(&thread_lock, &attr); -+ pthread_mutexattr_destroy(&attr); -+ -+ call_pthread_create = __hook_pthread_create; -+ call_pthread_join = __hook_pthread_join; -+ call_pthread_detach = __hook_pthread_detach; -+} -+ -+static TEB *dead_teb; -+static struct list active_list = LIST_INIT(active_list); -+ -+static void take_thread_lock(void) -+{ -+ int ret = pthread_mutex_lock(&thread_lock); -+ if (ret == EOWNERDEAD) -+ pthread_mutex_consistent(&thread_lock); -+} -+ -+static void detach_thread_unlock(TEB *own_teb) -+{ -+ struct ntdll_thread_data *thread_data; -+ TEB *teb = dead_teb; -+ -+ dead_teb = own_teb; -+ -+ pthread_mutex_unlock(&thread_lock); -+ if (!teb) -+ return; -+ -+ thread_data = (struct ntdll_thread_data *)teb->SpareBytes1; -+ __glob_pthread_join(thread_data->pthread_id, NULL); -+ signal_free_thread(teb); -+} -+ -+static void reap_thread(TEB *teb) -+{ -+ struct ntdll_thread_data *thread_data = (struct ntdll_thread_data *)teb->SpareBytes1; -+ take_thread_lock(); -+ if (thread_data->detached) -+ detach_thread_unlock(teb); -+ else { -+ /* -+ * Do not unlock, wait until the thread is thoroughly dead. -+ * This prevents a race condition where detach is called -+ * after the thread has not finished dying yet. -+ */ -+ } -+} -+ -+#else -+#define __glob_pthread_create pthread_create -+#define __glob_pthread_join pthread_join -+#define __glob_pthread_detach pthread_detach -+#define thread_wrap_init() -+#endif -+ - /*********************************************************************** - * thread_init - * -@@ -220,6 +294,7 @@ HANDLE thread_init(void) - struct ntdll_thread_data *thread_data; - static struct debug_info debug_info; /* debug info for initial thread */ - -+ thread_wrap_init(); - virtual_init(); - - /* reserve space for shared user data */ -@@ -349,14 +424,12 @@ void terminate_thread( int status ) - pthread_exit( UIntToPtr(status) ); - } - -- --/*********************************************************************** -- * exit_thread -- */ --void exit_thread( int status ) -+static void exit_thread_common( int status ) - { -+#ifndef __linux__ - static void *prev_teb; - TEB *teb; -+#endif - - if (status) /* send the exit code to the server (0 is already the default) */ - { -@@ -380,24 +453,177 @@ void exit_thread( int status ) - - pthread_sigmask( SIG_BLOCK, &server_block_set, NULL ); - -+#ifndef __linux__ - if ((teb = interlocked_xchg_ptr( &prev_teb, NtCurrentTeb() ))) - { - struct ntdll_thread_data *thread_data = (struct ntdll_thread_data *)teb->SpareBytes1; - - if (thread_data->pthread_id) - { -- pthread_join( thread_data->pthread_id, NULL ); -+ __glob_pthread_join( thread_data->pthread_id, NULL ); - signal_free_thread( teb ); - } - } -+#else -+ reap_thread(NtCurrentTeb()); -+#endif - - close( ntdll_get_thread_data()->wait_fd[0] ); - close( ntdll_get_thread_data()->wait_fd[1] ); - close( ntdll_get_thread_data()->reply_fd ); - close( ntdll_get_thread_data()->request_fd ); -+} -+ -+void exit_thread( int status ) -+{ -+ exit_thread_common(status); - pthread_exit( UIntToPtr(status) ); - } - -+#ifdef __linux__ -+ -+struct unix_arg { -+ void *(*start)(void *); -+ void *arg; -+}; -+ -+/* dummy used for comparison */ -+static DWORD native_unix_start; -+ -+static void call_native_cleanup(void *arg) -+{ -+ exit_thread_common(0); -+} -+ -+static int -+__hook_pthread_create(pthread_t *thread, const pthread_attr_t *attr, -+ void *(*start_routine) (void *), void *parm) -+{ -+ NTSTATUS ret; -+ pthread_t tid; -+ size_t stack = 8 * 1024 * 1024; -+ struct unix_arg arg; -+ arg.start = start_routine; -+ arg.arg = parm; -+ -+ if (!thread) -+ thread = &tid; -+ -+ TRACE("Overriding thread creation!\n"); -+ if (attr) { -+ static int once; -+ if (!once++) -+ FIXME("most thread attributes ignored!\n"); -+ else -+ WARN("most thread attributes ignored!\n"); -+ -+ pthread_attr_getstacksize(attr, &stack); -+ } -+ -+ ret = RtlCreateUserThread( NtCurrentProcess(), NULL, FALSE, NULL, stack, 0, (void*)&native_unix_start, &arg, NULL, (void*)thread ); -+ if (ret != STATUS_SUCCESS) -+ FIXME("ret: %08x\n", ret); -+ switch (ret) { -+ case STATUS_SUCCESS: -+ TRACE("created thread %lx for %p/%p\n", *thread, start_routine, parm); -+ return 0; -+ case STATUS_NO_MEMORY: -+ return ENOMEM; -+ case STATUS_TOO_MANY_OPENED_FILES: -+ return EMFILE; -+ default: -+ ERR("Unhandled ntstatus %08x\n", ret); -+ return ENOMEM; -+ } -+} -+ -+static int __hook_pthread_detach(pthread_t thread) -+{ -+ struct ntdll_thread_data *thread_data; -+ TEB *teb = NULL; -+ -+ if (pthread_equal(thread, pthread_self())) { -+ TRACE("Detached self: %lx\n", pthread_self()); -+ ntdll_get_thread_data()->detached = 1; -+ return 0; -+ } -+ -+ take_thread_lock(); -+ LIST_FOR_EACH_ENTRY(thread_data, &active_list, typeof(*thread_data), entry) { -+ if (pthread_equal(thread_data->pthread_id, thread)) { -+ teb = CONTAINING_RECORD(thread_data, typeof(*teb), SpareBytes1); -+ -+ list_remove(&thread_data->entry); -+ if (!pthread_tryjoin_np(thread, NULL)) { -+ detach_thread_unlock(NULL); -+ TRACE("Thread %lx was dead, cleaning up\n", thread); -+ signal_free_thread(teb); -+ return 0; -+ } -+ thread_data->detached = 1; -+ break; -+ } -+ } -+ detach_thread_unlock(NULL); -+ if (!teb) -+ TRACE("Could not find thread %lx to detach\n", thread); -+ else -+ TRACE("Changed thread %lx to detached\n", thread); -+ return teb ? 0 : ESRCH; -+} -+ -+static int __hook_pthread_join(pthread_t thread, void **retval) -+{ -+ struct ntdll_thread_data *thread_data, *t2; -+ int ret = ESRCH; -+ -+ if (pthread_equal(thread, pthread_self())) -+ return EDEADLK; -+ -+ take_thread_lock(); -+ LIST_FOR_EACH_ENTRY(thread_data, &active_list, typeof(*thread_data), entry) { -+ TEB *teb = CONTAINING_RECORD(thread_data, typeof(*teb), SpareBytes1); -+ -+ if (pthread_equal(thread, thread_data->pthread_id)) { -+ -+ ret = pthread_tryjoin_np(thread, retval); -+ if (!ret) { -+ TRACE("Thread %lx was dead fastpath, cleaning up\n", thread); -+ goto free; -+ } -+ detach_thread_unlock(NULL); -+ -+ ret = __glob_pthread_join(thread, retval); -+ if (ret) { -+ TRACE("Thread %lx join failed with %i, ignoring\n", thread, ret); -+ return ret; -+ } -+ -+ take_thread_lock(); -+ /* Check if someone else freed the thread yet */ -+ LIST_FOR_EACH_ENTRY(t2, &active_list, typeof(*thread_data), entry) -+ if (t2 == thread_data) { -+ TRACE("Cleaning up after successful join\n"); -+ goto free; -+ } -+ TRACE("No clean up after successful join, multiple pthread_join's?\n"); -+ break; -+ -+free: -+ list_remove(&thread_data->entry); -+ detach_thread_unlock(NULL); -+ signal_free_thread(teb); -+ return 0; -+ } -+ } -+ -+ detach_thread_unlock(NULL); -+ if (ret) -+ TRACE("failed with %i\n", ret); -+ return ret; -+} -+ -+#endif - - /*********************************************************************** - * start_thread -@@ -426,9 +652,19 @@ static void start_thread( struct startup_info *info ) - if (TRACE_ON(relay)) - DPRINTF( "%04x:Starting thread proc %p (arg=%p)\n", GetCurrentThreadId(), func, arg ); - -- call_thread_entry_point( (LPTHREAD_START_ROUTINE)func, arg ); --} -+#ifdef __linux__ -+ if (info->native_thread) { -+ void *(*start)(void*) = (void*)func; - -+ FIXME("Started native thread %08x\n", GetCurrentThreadId()); -+ pthread_cleanup_push(call_native_cleanup, NULL); -+ pthread_exit(start(arg)); -+ pthread_cleanup_pop(1); -+ return; -+ } -+#endif -+ call_thread_entry_point( (LPTHREAD_START_ROUTINE)func, arg ); -+} - - /*********************************************************************** - * RtlCreateUserThread (NTDLL.@) -@@ -440,14 +676,13 @@ NTSTATUS WINAPI RtlCreateUserThread( HANDLE process, const SECURITY_DESCRIPTOR * - HANDLE *handle_ptr, CLIENT_ID *id ) - { - sigset_t sigset; -- pthread_t pthread_id; - pthread_attr_t attr; - struct ntdll_thread_data *thread_data; - struct startup_info *info = NULL; - HANDLE handle = 0, actctx = 0; - TEB *teb = NULL; - DWORD tid = 0; -- int request_pipe[2]; -+ int request_pipe[2], ret; - NTSTATUS status; - - if (process != NtCurrentProcess()) -@@ -472,10 +707,14 @@ NTSTATUS WINAPI RtlCreateUserThread( HANDLE process, const SECURITY_DESCRIPTOR * - if (handle_ptr) *handle_ptr = wine_server_ptr_handle( result.create_thread.handle ); - else NtClose( wine_server_ptr_handle( result.create_thread.handle )); - } -+ TRACE("CreateThread for other process returns %08x\n", result.create_thread.status); - return result.create_thread.status; - } - -- if (server_pipe( request_pipe ) == -1) return STATUS_TOO_MANY_OPENED_FILES; -+ if (server_pipe( request_pipe ) == -1) { -+ TRACE("CreateThread cannot create request pipe: %m\n"); -+ return STATUS_TOO_MANY_OPENED_FILES; -+ } - wine_server_send_fd( request_pipe[0] ); - - SERVER_START_REQ( new_thread ) -@@ -496,12 +735,16 @@ NTSTATUS WINAPI RtlCreateUserThread( HANDLE process, const SECURITY_DESCRIPTOR * - if (status) - { - close( request_pipe[1] ); -+ TRACE("CreateThread server request failed with %08x\n", status); - return status; - } - - pthread_sigmask( SIG_BLOCK, &server_block_set, &sigset ); - -- if ((status = signal_alloc_thread( &teb ))) goto error; -+ if ((status = signal_alloc_thread( &teb ))) { -+ TRACE("CreateThread signal thread allocation failed with %08x\n", status); -+ goto error; -+ } - - teb->Peb = NtCurrentTeb()->Peb; - teb->ClientId.UniqueProcess = ULongToHandle(GetCurrentProcessId()); -@@ -524,32 +767,64 @@ NTSTATUS WINAPI RtlCreateUserThread( HANDLE process, const SECURITY_DESCRIPTOR * - - info = (struct startup_info *)(teb + 1); - info->teb = teb; -- info->entry_point = start; -- info->entry_arg = param; -+#ifdef __linux__ -+ info->native_thread = (void*)start == (void*)&native_unix_start; -+ if (info->native_thread) { -+ struct unix_arg *arg = param; -+ info->entry_point = (void*)arg->start; -+ info->entry_arg = arg->arg; -+ } else -+#endif -+ { -+ info->entry_point = start; -+ info->entry_arg = param; -+ } - - thread_data = (struct ntdll_thread_data *)teb->SpareBytes1; -+#ifdef __linux__ -+ thread_data->detached = !info->native_thread; -+#endif - thread_data->request_fd = request_pipe[1]; - thread_data->reply_fd = -1; - thread_data->wait_fd[0] = -1; - thread_data->wait_fd[1] = -1; -+ thread_data->entry.next = NULL; - -- if ((status = virtual_alloc_thread_stack( teb, stack_reserve, stack_commit ))) goto error; -+ if ((status = virtual_alloc_thread_stack( teb, stack_reserve ?: (8 << 20), stack_commit ?: (1 << 20) ))) { -+ TRACE("Allocating virtual stack for %p (%li/%li) failed with %08x\n", start, stack_reserve, stack_commit, status); -+ goto error; -+ } - - pthread_attr_init( &attr ); - pthread_attr_setstack( &attr, teb->DeallocationStack, - (char *)teb->Tib.StackBase - (char *)teb->DeallocationStack ); - pthread_attr_setscope( &attr, PTHREAD_SCOPE_SYSTEM ); /* force creating a kernel thread */ - interlocked_xchg_add( &nb_threads, 1 ); -- if (pthread_create( &pthread_id, &attr, (void * (*)(void *))start_thread, info )) -+ -+ take_thread_lock(); -+ ret = __glob_pthread_create( &thread_data->pthread_id, &attr, (void * (*)(void *))start_thread, info ); -+ if (ret) - { -+ TRACE("pthread create failed with %i/%m\n", ret); - interlocked_xchg_add( &nb_threads, -1 ); - pthread_attr_destroy( &attr ); - status = STATUS_NO_MEMORY; - goto error; - } -+ if (!thread_data->detached) -+ list_add_tail(&active_list, &thread_data->entry); -+ detach_thread_unlock(NULL); -+ - pthread_attr_destroy( &attr ); - pthread_sigmask( SIG_SETMASK, &sigset, NULL ); - -+ TRACE("Created thread succesfully, win handle: %04x, pthread: %lx\n", tid, thread_data->pthread_id); -+ -+#ifdef __linux__ -+ if ((void*)start == (void*)&native_unix_start && id) -+ *(pthread_t*)id = thread_data->pthread_id; -+ else -+#endif - if (id) id->UniqueThread = ULongToHandle(tid); - if (handle_ptr) *handle_ptr = handle; - else NtClose( handle ); -diff --git a/dlls/winegstreamer/glibthread.c b/dlls/winegstreamer/glibthread.c -index 0d829a0..46e22f4 100644 ---- a/dlls/winegstreamer/glibthread.c -+++ b/dlls/winegstreamer/glibthread.c -@@ -43,6 +43,7 @@ - #include <stdlib.h> - #include <stdio.h> - -+#if 0 - #include "windef.h" - #include "winbase.h" - #include "winnls.h" -@@ -388,3 +389,15 @@ void g_thread_impl_init (void) - g_thread_self_tls = TlsAlloc (); - g_thread_init(&g_thread_functions_for_glib_use_default); - } -+ -+#else -+ -+void g_thread_impl_init (void) -+{ -+ static gboolean beenhere = FALSE; -+ -+ if (!beenhere++) -+ g_thread_init(NULL); -+} -+ -+#endif -diff --git a/libs/wine/loader.c b/libs/wine/loader.c -index 7261522..a8c31b9 100644 ---- a/libs/wine/loader.c -+++ b/libs/wine/loader.c -@@ -73,6 +73,13 @@ char **__wine_main_argv = NULL; - WCHAR **__wine_main_wargv = NULL; - char **__wine_main_environ = NULL; - -+#ifdef __linux__ -+#include <pthread.h> -+typeof(pthread_create) *call_pthread_create, *__glob_pthread_create; -+typeof(pthread_join) *call_pthread_join, *__glob_pthread_join; -+typeof(pthread_detach) *call_pthread_detach, *__glob_pthread_detach; -+#endif -+ - struct dll_path_context - { - unsigned int index; /* current index in the dll path list */ -diff --git a/libs/wine/wine.map b/libs/wine/wine.map -index 2159fac..fb3b951 100644 ---- a/libs/wine/wine.map -+++ b/libs/wine/wine.map -@@ -117,6 +117,12 @@ WINE_1.0 - wine_utf8_mbstowcs; - wine_utf8_wcstombs; - wine_wctype_table; -+ __glob_pthread_create; -+ call_pthread_create; -+ __glob_pthread_join; -+ call_pthread_join; -+ __glob_pthread_detach; -+ call_pthread_detach; - - local: *; - }; -diff --git a/loader/Makefile.in b/loader/Makefile.in -index 95e4798..a18dd02 100644 ---- a/loader/Makefile.in -+++ b/loader/Makefile.in -@@ -1,4 +1,4 @@ --EXTRALIBS = $(PTHREAD_LIBS) -+EXTRALIBS = $(PTHREAD_LIBS) $(DL_LIBS) - - C_SRCS = \ - main.c \ -diff --git a/loader/main.c b/loader/main.c -index ac67290..76609e1 100644 ---- a/loader/main.c -+++ b/loader/main.c -@@ -202,6 +202,45 @@ static int pre_exec(void) - - #endif - -+#ifdef __linux__ -+ -+extern typeof(pthread_create) *call_pthread_create, *__glob_pthread_create; -+extern typeof(pthread_detach) *call_pthread_detach, *__glob_pthread_detach; -+extern typeof(pthread_join) *call_pthread_join, *__glob_pthread_join; -+ -+int pthread_create(pthread_t *thread, const pthread_attr_t *attr, -+ void *(*start_routine) (void *), void *arg) -+{ -+ return call_pthread_create(thread, attr, start_routine, arg); -+} -+ -+int pthread_detach(pthread_t thread) -+{ -+ return call_pthread_detach(thread); -+} -+ -+int pthread_join(pthread_t thread, void **retval) -+{ -+ return call_pthread_join(thread, retval); -+} -+ -+static void init_thread_hook(void) { -+ call_pthread_create = __glob_pthread_create = dlvsym(RTLD_NEXT, "pthread_create", "GLIBC_2.2.5"); -+ if (!__glob_pthread_create) -+ call_pthread_create = __glob_pthread_create = dlvsym(RTLD_NEXT, "pthread_create", "GLIBC_2.1"); -+ -+ call_pthread_detach = __glob_pthread_detach = dlsym(RTLD_NEXT, "pthread_detach"); -+ call_pthread_join = __glob_pthread_join = dlsym(RTLD_NEXT, "pthread_join"); -+ -+ /* Call a function from libpthread to ensure being linked against it */ -+ pthread_yield(); -+} -+ -+#else -+ -+#define init_thread_hook() -+ -+#endif - - /********************************************************************** - * main -@@ -211,6 +250,8 @@ int main( int argc, char *argv[] ) - char error[1024]; - int i; - -+ init_thread_hook(); -+ - if (!getenv( "WINELOADERNOEXEC" )) /* first time around */ - { - static char noexec[] = "WINELOADERNOEXEC=1"; --- -1.7.6.6.GIT - |