diff --git a/configure b/configure
index 5f8735b0d37e..543b0ac22c1f 100755
--- a/configure
+++ b/configure
@@ -21396,6 +21396,11 @@ $with_wine64/loader/wine-preloader:
 	rm -f \$@ && \$(LN_S) $ac_pwd/loader/wine-preloader \$@
 clean::
 	rm -f loader/wine64 loader/wine64-preloader $with_wine64/loader/wine $with_wine64/loader/wine-preloader"
+    test -z "$CROSSTARGET" || wine_fn_append_rule "all:$with_wine64/$ARCH-windows
+$with_wine64/$ARCH-windows:
+	rm -f \$@ && \$(LN_S) $ac_pwd \$@
+clean::
+	rm -f $with_wine64/$ARCH-windows"
 else
     TOP_INSTALL_DEV="$TOP_INSTALL_DEV include"
     TOP_INSTALL_LIB="$TOP_INSTALL_LIB \
diff --git a/configure.ac b/configure.ac
index 594794ed93cf..3b78f9333b14 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4113,6 +4113,12 @@ $with_wine64/loader/wine-preloader:
 	rm -f \$[@] && \$(LN_S) $ac_pwd/loader/wine-preloader \$[@]
 clean::
 	rm -f loader/wine64 loader/wine64-preloader $with_wine64/loader/wine $with_wine64/loader/wine-preloader])
+    test -z "$CROSSTARGET" || WINE_APPEND_RULE(
+[all:$with_wine64/$ARCH-windows
+$with_wine64/$ARCH-windows:
+	rm -f \$[@] && \$(LN_S) $ac_pwd \$[@]
+clean::
+	rm -f $with_wine64/$ARCH-windows])
 else
     TOP_INSTALL_DEV="$TOP_INSTALL_DEV include"
     TOP_INSTALL_LIB="$TOP_INSTALL_LIB \
diff --git a/dlls/ntdll/Makefile.in b/dlls/ntdll/Makefile.in
index ab79942f8dfa..dfb62ad3fff3 100644
--- a/dlls/ntdll/Makefile.in
+++ b/dlls/ntdll/Makefile.in
@@ -4,7 +4,7 @@ IMPORTLIB = ntdll
 IMPORTS   = winecrt0
 EXTRAINCL = $(UNWIND_CFLAGS)
 EXTRALIBS = -lwinecrt0 -Wl,--subsystem,unixlib $(IOKIT_LIBS) $(COREFOUNDATION_LIBS) $(CORESERVICES_LIBS) $(RT_LIBS) $(PTHREAD_LIBS) $(UNWIND_LIBS) $(I386_LIBS) $(PROCSTAT_LIBS)
-EXTRADLLFLAGS = -mno-cygwin -nodefaultlibs -Wl,--image-base,0x7bc00000
+EXTRADLLFLAGS = -mno-cygwin -nodefaultlibs -Wl,--image-base,0x7bc00000,--image-base64,0x180000000
 
 C_SRCS = \
 	actctx.c \
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index 48e826fe8884..0fcf8536ae17 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -2029,6 +2029,7 @@ static BOOL convert_to_pe64( HMODULE module, const SECTION_IMAGE_INFORMATION *in
 
     if (nt->OptionalHeader.Magic != IMAGE_NT_OPTIONAL_HDR32_MAGIC) return TRUE;  /* already 64-bit */
     if (!info->ImageContainsCode) return TRUE;  /* no need to convert */
+    if (!(info->ImageCharacteristics & IMAGE_FILE_DLL)) return TRUE;  /* no need to convert */
 
     TRACE( "%p\n", module );
 
@@ -2118,6 +2119,7 @@ static BOOL is_valid_binary( HANDLE file, const SECTION_IMAGE_INFORMATION *info
     if (info->Machine == IMAGE_FILE_MACHINE_ARM64) return TRUE;
 #endif
     if (!info->ImageContainsCode) return TRUE;
+    if (!(info->ImageCharacteristics & IMAGE_FILE_DLL)) return TRUE;
     if (!(info->u.s.ComPlusNativeReady))
     {
         IMAGE_COR20_HEADER cor_header;
@@ -2427,6 +2429,8 @@ static NTSTATUS load_so_dll( LPCWSTR load_path, const UNICODE_STRING *nt_name,
     WINE_MODREF *wm;
     UNICODE_STRING win_name = *nt_name;
 
+    if (!unix_funcs) return STATUS_INVALID_IMAGE_NOT_MZ;
+
     TRACE( "trying %s as so lib\n", debugstr_us(&win_name) );
     if ((status = unix_funcs->load_so_dll( &win_name, &module )))
     {
@@ -2970,6 +2974,8 @@ NTSTATUS __cdecl __wine_init_unix_lib( HMODULE module, DWORD reason, const void
     WINE_MODREF *wm;
     NTSTATUS ret;
 
+    if (!unix_funcs) return STATUS_DLL_NOT_FOUND;
+
     RtlEnterCriticalSection( &loader_section );
 
     if ((wm = get_modref( module ))) ret = unix_funcs->init_unix_lib( module, reason, ptr_in, ptr_out );
diff --git a/dlls/ntdll/process.c b/dlls/ntdll/process.c
index 160b1f549c9c..82b8daa47af4 100644
--- a/dlls/ntdll/process.c
+++ b/dlls/ntdll/process.c
@@ -552,5 +552,12 @@ void WINAPI DbgUiRemoteBreakin( void *arg )
  */
 NTSTATUS WINAPI DbgUiIssueRemoteBreakin( HANDLE process )
 {
-    return unix_funcs->DbgUiIssueRemoteBreakin( process );
+    HANDLE handle;
+    NTSTATUS status;
+    OBJECT_ATTRIBUTES attr = { sizeof(attr) };
+
+    status = NtCreateThreadEx( &handle, THREAD_ALL_ACCESS, &attr, process,
+                               DbgUiRemoteBreakin, NULL, 0, 0, 0, 0, NULL );
+    if (!status) NtClose( handle );
+    return status;
 }
diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c
index ef32eba68b7f..b83404363f3c 100644
--- a/dlls/ntdll/signal_x86_64.c
+++ b/dlls/ntdll/signal_x86_64.c
@@ -277,7 +277,8 @@ static NTSTATUS virtual_unwind( ULONG type, DISPATCHER_CONTEXT *dispatch, CONTEX
 
     if (!module || (module->Flags & LDR_WINE_INTERNAL))
     {
-        status = unix_funcs->unwind_builtin_dll( type, dispatch, context );
+        if (!unix_funcs) status = STATUS_UNSUCCESSFUL;
+        else status = unix_funcs->unwind_builtin_dll( type, dispatch, context );
 
         if (!status && dispatch->LanguageHandler && !module)
         {
diff --git a/dlls/ntdll/time.c b/dlls/ntdll/time.c
index ccd2c55552b5..a4981474b2b8 100644
--- a/dlls/ntdll/time.c
+++ b/dlls/ntdll/time.c
@@ -372,6 +372,12 @@ void WINAPI RtlTimeToElapsedTimeFields( const LARGE_INTEGER *Time, PTIME_FIELDS
  */
 LONGLONG WINAPI RtlGetSystemTimePrecise( void )
 {
+    if (!unix_funcs)
+    {
+        LARGE_INTEGER now;
+        NtQuerySystemTime( &now );
+        return now.QuadPart;
+    }
     return unix_funcs->RtlGetSystemTimePrecise();
 }
 
diff --git a/dlls/ntdll/unix/env.c b/dlls/ntdll/unix/env.c
index ae1afb2797b7..e807aa035bf9 100644
--- a/dlls/ntdll/unix/env.c
+++ b/dlls/ntdll/unix/env.c
@@ -2068,6 +2068,18 @@ static void *build_wow64_parameters( const RTL_USER_PROCESS_PARAMETERS *params )
  */
 static void init_peb( RTL_USER_PROCESS_PARAMETERS *params, void *module )
 {
+#ifdef _WIN64
+    if (main_image_info.Machine != current_machine)
+    {
+        TEB32 *teb32 = (TEB32 *)((char *)NtCurrentTeb() + teb_offset);
+        NtCurrentTeb()->WowTebOffset = teb_offset;
+        NtCurrentTeb()->Tib.ExceptionList = (void *)teb32;
+        teb32->ClientId.UniqueProcess = GetCurrentProcessId();
+        teb32->ClientId.UniqueThread  = GetCurrentThreadId();
+        teb32->RealClientId = teb32->ClientId;
+    }
+#endif
+
     peb->ImageBaseAddress           = module;
     peb->ProcessParameters          = params;
     peb->OSMajorVersion             = 6;
@@ -2148,7 +2160,6 @@ static RTL_USER_PROCESS_PARAMETERS *build_initial_params( void **module )
     if (!status)
     {
         if (main_image_info.ImageCharacteristics & IMAGE_FILE_DLL) status = STATUS_INVALID_IMAGE_FORMAT;
-        if (main_image_info.Machine != current_machine) status = STATUS_INVALID_IMAGE_FORMAT;
     }
 
     if (status)  /* try launching it through start.exe */
diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c
index 6312cb2f11dc..b85cedd2e5b7 100644
--- a/dlls/ntdll/unix/loader.c
+++ b/dlls/ntdll/unix/loader.c
@@ -103,7 +103,6 @@ static const char so_dir[] = "/aarch64-unix";
 static const char so_dir[] = "";
 #endif
 
-void     (WINAPI *pDbgUiRemoteBreakin)( void *arg ) = NULL;
 NTSTATUS (WINAPI *pKiRaiseUserExceptionDispatcher)(void) = NULL;
 NTSTATUS (WINAPI *pKiUserExceptionDispatcher)(EXCEPTION_RECORD*,CONTEXT*) = NULL;
 void     (WINAPI *pKiUserApcDispatcher)(CONTEXT*,ULONG_PTR,ULONG_PTR,ULONG_PTR,PNTAPCFUNC) = NULL;
@@ -696,6 +695,7 @@ NTSTATUS exec_wineloader( char **argv, int socketfd, const pe_image_info_t *pe_i
     if (pe_info->image_flags & IMAGE_FLAGS_WineFakeDll) res_start = res_end = 0;
     if (pe_info->image_flags & IMAGE_FLAGS_ComPlusNativeReady) machine = native_machine;
 
+    machine = native_machine;
     is_child_64bit = is_machine_64bit( machine );
 
     if (!is_win64 ^ !is_child_64bit)
@@ -1072,7 +1073,6 @@ static void load_ntdll_functions( HMODULE module )
     if (!(p##name = (void *)find_named_export( module, ntdll_exports, #name ))) \
         ERR( "%s not found\n", #name )
 
-    GET_FUNC( DbgUiRemoteBreakin );
     GET_FUNC( KiRaiseUserExceptionDispatcher );
     GET_FUNC( KiUserExceptionDispatcher );
     GET_FUNC( KiUserApcDispatcher );
@@ -1588,7 +1588,7 @@ static NTSTATUS find_builtin_dll( UNICODE_STRING *nt_name, void **module, SIZE_T
 {
     unsigned int i, pos, namepos, namelen, maxlen = 0;
     unsigned int len = nt_name->Length / sizeof(WCHAR);
-    char *ptr = NULL, *file, *ext = NULL;
+    char *ptr = NULL, *file, *ext = NULL, *unix_name = NULL;
     const char *pe_dir = get_pe_dir( machine );
     OBJECT_ATTRIBUTES attr;
     NTSTATUS status = STATUS_DLL_NOT_FOUND;
@@ -1625,6 +1625,8 @@ static NTSTATUS find_builtin_dll( UNICODE_STRING *nt_name, void **module, SIZE_T
         if (ext && !strcmp( ext, ".dll" )) namelen -= 4;
         ptr = prepend( ptr, ptr, namelen );
         ptr = prepend( ptr, "/dlls", sizeof("/dlls") - 1 );
+        unix_name = ptr;
+        if (machine != current_machine) ptr = prepend( ptr, pe_dir, strlen(pe_dir) );
         ptr = prepend( ptr, build_dir, strlen(build_dir) );
         status = open_builtin_pe_file( ptr, &attr, module, size_ptr, image_info, machine, prefer_native );
         if (status != STATUS_DLL_NOT_FOUND) goto done;
@@ -1639,6 +1641,8 @@ static NTSTATUS find_builtin_dll( UNICODE_STRING *nt_name, void **module, SIZE_T
         if (ext && !strcmp( ext, ".exe" )) namelen -= 4;
         ptr = prepend( ptr, ptr, namelen );
         ptr = prepend( ptr, "/programs", sizeof("/programs") - 1 );
+        unix_name = ptr;
+        if (machine != current_machine) ptr = prepend( ptr, pe_dir, strlen(pe_dir) );
         ptr = prepend( ptr, build_dir, strlen(build_dir) );
         status = open_builtin_pe_file( ptr, &attr, module, size_ptr, image_info, machine, prefer_native );
         if (status != STATUS_DLL_NOT_FOUND) goto done;
@@ -1658,6 +1662,7 @@ static NTSTATUS find_builtin_dll( UNICODE_STRING *nt_name, void **module, SIZE_T
         ptr = file + pos;
         ptr = prepend( ptr, so_dir, strlen(so_dir) );
         ptr = prepend( ptr, dll_paths[i], strlen(dll_paths[i]) );
+        unix_name = ptr;
         if (status != STATUS_DLL_NOT_FOUND) goto done;
         strcpy( file + pos + len + 1, ".so" );
         status = open_builtin_so_file( ptr, &attr, module, image_info, machine, prefer_native );
@@ -1670,6 +1675,7 @@ static NTSTATUS find_builtin_dll( UNICODE_STRING *nt_name, void **module, SIZE_T
             found_image = TRUE;
             continue;
         }
+        unix_name = ptr;
         if (status != STATUS_DLL_NOT_FOUND) goto done;
         strcpy( file + pos + len + 1, ".so" );
         status = open_builtin_so_file( ptr, &attr, module, image_info, machine, prefer_native );
@@ -1680,14 +1686,15 @@ static NTSTATUS find_builtin_dll( UNICODE_STRING *nt_name, void **module, SIZE_T
     if (found_image) status = STATUS_IMAGE_MACHINE_TYPE_MISMATCH;
     WARN( "cannot find builtin library for %s\n", debugstr_us(nt_name) );
 done:
-    if (status >= 0 && ext)
+    if (status >= 0 && unix_name && ext)
     {
         void *handle;
 
         strcpy( ext, ".so" );
-        if ((handle = dlopen( ptr, RTLD_NOW )))
+        if (build_dir) unix_name = prepend( unix_name, build_dir, strlen(build_dir) );
+        if ((handle = dlopen( unix_name, RTLD_NOW )))
         {
-            if (set_builtin_unix_handle( *module, ptr, handle )) dlclose( handle );
+            if (set_builtin_unix_handle( *module, unix_name, handle )) dlclose( handle );
         }
     }
     free( file );
@@ -2147,7 +2154,6 @@ static struct unix_funcs unix_funcs =
 #ifdef __aarch64__
     NtCurrentTeb,
 #endif
-    DbgUiIssueRemoteBreakin,
     RtlGetSystemTimePrecise,
     ntdll_atan,
     ntdll_ceil,
diff --git a/dlls/ntdll/unix/server.c b/dlls/ntdll/unix/server.c
index 986eb6c32508..12d3f2f60275 100644
--- a/dlls/ntdll/unix/server.c
+++ b/dlls/ntdll/unix/server.c
@@ -574,17 +574,6 @@ static void invoke_system_apc( const apc_call_t *call, apc_result_t *result, BOO
         if (!self) NtClose( wine_server_ptr_handle(call->dup_handle.dst_process) );
         break;
     }
-    case APC_BREAK_PROCESS:
-    {
-        HANDLE handle;
-
-        result->type = APC_BREAK_PROCESS;
-        result->break_process.status = NtCreateThreadEx( &handle, THREAD_ALL_ACCESS, NULL,
-                                                         NtCurrentProcess(), pDbgUiRemoteBreakin, NULL,
-                                                         0, 0, 0, 0, NULL );
-        if (!result->break_process.status) NtClose( handle );
-        break;
-    }
     default:
         server_protocol_error( "get_apc_request: bad type %d\n", call->type );
         break;
@@ -1639,23 +1633,6 @@ void server_init_thread( void *entry_point, BOOL *suspend )
 }
 
 
-/***********************************************************************
- *           DbgUiIssueRemoteBreakin
- */
-NTSTATUS WINAPI DbgUiIssueRemoteBreakin( HANDLE process )
-{
-    apc_call_t call;
-    apc_result_t result;
-    NTSTATUS status;
-
-    memset( &call, 0, sizeof(call) );
-    call.type = APC_BREAK_PROCESS;
-    status = server_queue_process_apc( process, &call, &result );
-    if (status) return status;
-    return result.break_process.status;
-}
-
-
 /******************************************************************************
  *           NtDuplicateObject
  */
diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c
index a9bdbf629294..54ced545bcc6 100644
--- a/dlls/ntdll/unix/signal_x86_64.c
+++ b/dlls/ntdll/unix/signal_x86_64.c
@@ -2175,6 +2196,7 @@ static void setup_raise_exception( ucontext_t *sigcontext, EXCEPTION_RECORD *rec
         }
     }
 
+    CS_sig(sigcontext)  = cs64_sel;
     RIP_sig(sigcontext) = (ULONG_PTR)pKiUserExceptionDispatcher;
     RSP_sig(sigcontext) = (ULONG_PTR)stack;
     /* clear single-step, direction, and align check flag */
diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h
index 3d20bbbda407..e6a68449f385 100644
--- a/dlls/ntdll/unix/unix_private.h
+++ b/dlls/ntdll/unix/unix_private.h
@@ -91,7 +91,6 @@ static const LONG teb_offset = 0x2000;
 #define FILE_USE_FILE_POINTER_POSITION ((LONGLONG)-2)
 
 /* callbacks to PE ntdll from the Unix side */
-extern void     (WINAPI *pDbgUiRemoteBreakin)( void *arg ) DECLSPEC_HIDDEN;
 extern NTSTATUS (WINAPI *pKiRaiseUserExceptionDispatcher)(void) DECLSPEC_HIDDEN;
 extern NTSTATUS (WINAPI *pKiUserExceptionDispatcher)(EXCEPTION_RECORD*,CONTEXT*) DECLSPEC_HIDDEN;
 extern void     (WINAPI *pKiUserApcDispatcher)(CONTEXT*,ULONG_PTR,ULONG_PTR,ULONG_PTR,PNTAPCFUNC) DECLSPEC_HIDDEN;
diff --git a/dlls/ntdll/unixlib.h b/dlls/ntdll/unixlib.h
index 22fabf7df73a..327cd59a7232 100644
--- a/dlls/ntdll/unixlib.h
+++ b/dlls/ntdll/unixlib.h
@@ -36,7 +36,6 @@ struct unix_funcs
 #endif
 
     /* other Win32 API functions */
-    NTSTATUS      (WINAPI *DbgUiIssueRemoteBreakin)( HANDLE process );
     LONGLONG      (WINAPI *RtlGetSystemTimePrecise)(void);
 
     /* math functions */
diff --git a/dlls/wow64/process.c b/dlls/wow64/process.c
index d66b973385b1..a12009f91db6 100644
--- a/dlls/wow64/process.c
+++ b/dlls/wow64/process.c
@@ -460,6 +451,17 @@ NTSTATUS WINAPI wow64_NtAlertThread( UINT *args )
 }
 
 
+/**********************************************************************
+ *           wow64_NtAlertThreadByThreadId
+ */
+NTSTATUS WINAPI wow64_NtAlertThreadByThreadId( UINT *args )
+{
+    HANDLE handle = get_handle( &args );
+
+    return NtAlertThreadByThreadId( handle );
+}
+
+
 /**********************************************************************
  *           wow64_NtAssignProcessToJobObject
  */
diff --git a/dlls/wow64/sync.c b/dlls/wow64/sync.c
index 0078508fc7f5..0b8f8f86d464 100644
--- a/dlls/wow64/sync.c
+++ b/dlls/wow64/sync.c
@@ -1481,6 +1481,14 @@ NTSTATUS WINAPI wow64_NtTestAlert( UINT *args )
 }
 
 
+NTSTATUS WINAPI wow64_NtWaitForAlertByThreadId( UINT *args )
+{
+    void *addr = get_ptr( &args );
+    LARGE_INTEGER *timeout = get_ptr( &args );
+
+    return NtWaitForAlertByThreadId( addr, timeout );
+}
+
 /**********************************************************************
  *           wow64_NtTraceControl
  */
diff --git a/dlls/wow64/syscall.h b/dlls/wow64/syscall.h
index a565e9cda3ab..bdb0e32fb969 100644
--- a/dlls/wow64/syscall.h
+++ b/dlls/wow64/syscall.h
@@ -30,7 +30,8 @@
     SYSCALL_ENTRY( NtAdjustPrivilegesToken ) \
     SYSCALL_ENTRY( NtAlertResumeThread ) \
     SYSCALL_ENTRY( NtAlertThread ) \
+    SYSCALL_ENTRY( NtAlertThreadByThreadId ) \
     SYSCALL_ENTRY( NtAllocateLocallyUniqueId ) \
     SYSCALL_ENTRY( NtAllocateUuids ) \
     SYSCALL_ENTRY( NtAllocateVirtualMemory ) \
     SYSCALL_ENTRY( NtAllocateVirtualMemoryEx ) \
@@ -234,6 +236,7 @@
     SYSCALL_ENTRY( NtUnlockFile ) \
     SYSCALL_ENTRY( NtUnlockVirtualMemory ) \
     SYSCALL_ENTRY( NtUnmapViewOfSection ) \
+    SYSCALL_ENTRY( NtWaitForAlertByThreadId ) \
     SYSCALL_ENTRY( NtWaitForDebugEvent ) \
     SYSCALL_ENTRY( NtWaitForKeyedEvent ) \
     SYSCALL_ENTRY( NtWaitForMultipleObjects ) \
diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h
index bb4862c96691..72b545ed1877 100644
--- a/include/wine/server_protocol.h
+++ b/include/wine/server_protocol.h
@@ -470,8 +470,7 @@ enum apc_type
     APC_MAP_VIEW,
     APC_UNMAP_VIEW,
     APC_CREATE_THREAD,
-    APC_DUP_HANDLE,
-    APC_BREAK_PROCESS
+    APC_DUP_HANDLE
 };
 
 typedef struct
diff --git a/server/protocol.def b/server/protocol.def
index 133d6ad05528..2bea66daafa0 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -486,8 +486,7 @@ enum apc_type
     APC_MAP_VIEW,
     APC_UNMAP_VIEW,
     APC_CREATE_THREAD,
-    APC_DUP_HANDLE,
-    APC_BREAK_PROCESS
+    APC_DUP_HANDLE
 };
 
 typedef struct
diff --git a/server/thread.c b/server/thread.c
index 9d4121068098..b7d5ebbca512 100644
--- a/server/thread.c
+++ b/server/thread.c
@@ -1737,7 +1737,6 @@ DECL_HANDLER(queue_apc)
         }
         break;
     case APC_CREATE_THREAD:
-    case APC_BREAK_PROCESS:
         process = get_process_from_handle( req->handle, PROCESS_CREATE_THREAD );
         break;
     case APC_DUP_HANDLE:
diff --git a/server/trace.c b/server/trace.c
index 4e91d933a5d8..bb38a4959524 100644
--- a/server/trace.c
+++ b/server/trace.c
@@ -238,9 +238,6 @@ static void dump_apc_call( const char *prefix, const apc_call_t *call )
                  call->dup_handle.src_handle, call->dup_handle.dst_process, call->dup_handle.access,
                  call->dup_handle.attributes, call->dup_handle.options );
         break;
-    case APC_BREAK_PROCESS:
-        fprintf( stderr, "APC_BREAK_PROCESS" );
-        break;
     default:
         fprintf( stderr, "type=%u", call->type );
         break;
@@ -325,9 +322,6 @@ static void dump_apc_result( const char *prefix, const apc_result_t *result )
         fprintf( stderr, "APC_DUP_HANDLE,status=%s,handle=%04x",
                  get_status_name( result->dup_handle.status ), result->dup_handle.handle );
         break;
-    case APC_BREAK_PROCESS:
-        fprintf( stderr, "APC_BREAK_PROCESS,status=%s", get_status_name( result->break_process.status ) );
-        break;
     default:
         fprintf( stderr, "type=%u", result->type );
         break;
diff --git a/tools/runtest b/tools/runtest
index 3299d6135c81..2ce7b47cc2ed 100755
--- a/tools/runtest
+++ b/tools/runtest
@@ -148,4 +148,4 @@ export WINETEST_PLATFORM WINETEST_DEBUG
 #  WINETEST_WRAPPER=valgrind
 # would run the tests under valgrind to look for memory errors.
 
-exec $WINETEST_WRAPPER "$topobjdir/wine" "$program" "$@"
+exec $WINETEST_WRAPPER "$topobjdir/wine64" "$program" "$@"
diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c
index 5f8e6c0e0867..6ec94ccc2c9e 100644
--- a/tools/winegcc/winegcc.c
+++ b/tools/winegcc/winegcc.c
@@ -223,6 +223,7 @@ struct options
     const char* winebuild;
     const char* output_name;
     const char* image_base;
+    const char* image_base64;
     const char* section_align;
     const char* file_align;
     const char* sysroot;
@@ -466,6 +467,11 @@ static int try_link( const strarray *prefix, const strarray *link_tool, const ch
     return ret;
 }
 
+static int is_win64_target( struct options *opts )
+{
+    return opts->target_cpu == CPU_x86_64 || opts->target_cpu == CPU_ARM64;
+}
+
 static strarray *get_link_args( struct options *opts, const char *output_name )
 {
     strarray *link_args = get_translator( opts );
@@ -663,8 +669,8 @@ static char *get_lib_dir( struct options *opts )
     struct stat st;
     size_t build_len, target_len;
 
-    bit_suffix = opts->target_cpu == CPU_x86_64 || opts->target_cpu == CPU_ARM64 ? "64" : "32";
-    other_bit_suffix = opts->target_cpu == CPU_x86_64 || opts->target_cpu == CPU_ARM64 ? "32" : "64";
+    bit_suffix = is_win64_target(opts) ? "64" : "32";
+    other_bit_suffix = is_win64_target(opts) ? "32" : "64";
     winecrt0 = strmake( "%s/libwinecrt0.a", get_wine_arch_dir( opts->target_cpu, opts->target_platform ));
     build_multiarch = get_multiarch_dir( build_cpu );
     target_multiarch = get_multiarch_dir( opts->target_cpu );
@@ -824,7 +830,7 @@ static void compile(struct options* opts, const char* lang)
             strarray_add(comp_args, "-fno-PIC");
     }
 
-    if (opts->target_cpu == CPU_x86_64 || opts->target_cpu == CPU_ARM64)
+    if (is_win64_target(opts))
     {
         strarray_add(comp_args, "-DWIN64");
         strarray_add(comp_args, "-D_WIN64");
@@ -886,7 +892,7 @@ static void compile(struct options* opts, const char* lang)
     strarray_add(comp_args, "-D__int8=char");
     strarray_add(comp_args, "-D__int16=short");
     strarray_add(comp_args, "-D__int32=int");
-    if (opts->target_cpu == CPU_x86_64 || opts->target_cpu == CPU_ARM64)
+    if (is_win64_target(opts))
         strarray_add(comp_args, "-D__int64=long");
     else
         strarray_add(comp_args, "-D__int64=long long");
@@ -1386,6 +1392,8 @@ static void build(struct options* opts)
     }
     else entry_point = opts->entry_point;
 
+    if (is_win64_target( opts ) && opts->image_base64) opts->image_base = opts->image_base64;
+
     /* run winebuild to generate the .spec.o file */
     if (!(opts->unix_lib && opts->subsystem && !strcmp(opts->subsystem, "unixlib")))
         spec_o_name = build_spec_obj( opts, spec_file, output_file, files, lib_dirs, entry_point );
@@ -2014,6 +2022,11 @@ int main(int argc, char **argv)
                                 opts.image_base = strdup( Wl->base[++j] );
                                 continue;
                             }
+                            if (!strcmp(Wl->base[j], "--image-base64") && j < Wl->size - 1)
+                            {
+                                opts.image_base64 = strdup( Wl->base[++j] );
+                                continue;
+                            }
                             if (!strcmp(Wl->base[j], "--section-alignment") && j < Wl->size - 1)
                             {
                                 opts.section_align = strdup( Wl->base[++j] );
