fix build of new version on raspbian.
authorPeter Michael Green <plugwash@raspbian.org>
Fri, 11 Nov 2022 07:48:24 +0000 (07:48 +0000)
committerPeter Michael Green <plugwash@raspbian.org>
Fri, 11 Nov 2022 07:48:24 +0000 (07:48 +0000)
13 files changed:
debian/changelog
debian/patches/raspbian.patch
debian/patches/series
debian/rules
dlls/ntdll/signal_arm.c
dlls/ntdll/unix/signal_arm.c
include/winnt.h
loader/preloader.c
tools/winebuild/import.c
tools/winebuild/main.c
tools/winebuild/relay.c
tools/winebuild/spec32.c
tools/winegcc/utils.c

index c37cbdfecab4e984a6e8ab7f64fcea55d9f7c48b..983e921a1338a553bc4eecc2e5aa1dd7c157c09a 100644 (file)
@@ -4,6 +4,11 @@ wine (7.0~repack-10+rpi1) bookworm-staging; urgency=medium
   * Build for armv6k on raspbian.
   * Replace movt instruction with orr instruction to support armv6k build.
 
+  [changes introduced in 7.0~repack-10+rpi1 by Peter Michael Green]
+  * Replace more armv7 asm with armv6 equivilents.
+  * Tweak some build utils to make debugging asm issues easier.
+  * Make clean target clean up files left behind by build tool tweaks.
+
  -- Peter Michael Green <plugwash@raspbian.org>  Fri, 22 Jul 2022 02:18:42 +0000
 
 wine (7.0~repack-10) unstable; urgency=medium
index 1a7d767f847731ae497988577d409315938af820..b6b4a34a794bd2516fbb130c82cc5ac9964a1e26 100644 (file)
@@ -1,11 +1,47 @@
 Description: Replace movt instruction with orr instruction to support armv6k build.
 Author: Peter Michael Green <plugwash@raspbian.org>
 
-diff --git a/dlls/ntdll/unix/signal_arm.c b/dlls/ntdll/unix/signal_arm.c
-index a1bcb0dd..206d32fe 100644
---- a/dlls/ntdll/unix/signal_arm.c
-+++ b/dlls/ntdll/unix/signal_arm.c
-@@ -1213,8 +1213,8 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher,
+Index: wine-7.0~repack/dlls/ntdll/unix/signal_arm.c
+===================================================================
+--- wine-7.0~repack.orig/dlls/ntdll/unix/signal_arm.c
++++ wine-7.0~repack/dlls/ntdll/unix/signal_arm.c
+@@ -1128,7 +1128,8 @@ __ASM_GLOBAL_FUNC( signal_start_thread,
+                    "str sp, [r3, #0x1d4]\n\t" /* arm_thread_data()->exit_frame */
+                    /* set syscall frame */
+                    "ldr r6, [r3, #0x1d8]\n\t" /* arm_thread_data()->syscall_frame */
+-                   "cbnz r6, 1f\n\t"
++                   "cmp r6, #0\n\t"
++                   "bne 1f\n\t"
+                    "sub r6, sp, #0x160\n\t"   /* sizeof(struct syscall_frame) */
+                    "str r6, [r3, #0x1d8]\n\t" /* arm_thread_data()->syscall_frame */
+                    "1:\tmov sp, r6\n\t"
+@@ -1160,7 +1161,10 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispat
+                    "str r2, [r1, #0x38]\n\t"
+                    "str r3, [r1, #0x3c]\n\t"
+                    "mrs r0, CPSR\n\t"
+-                   "bfi r0, lr, #5, #1\n\t"         /* set thumb bit */
++                   "and r6, lr, #1\n\t" /* begin set thumb bit */
++                   "bic r0, r0, #32\n\t"
++                   "orr r0, r0, r6, LSL #5\n\t" /* end set thumb bit */
++                   /*"bfi r0, lr, #5, #1\n\t"*/         /* set thumb bit */
+                    "str r0, [r1, #0x40]\n\t"
+                    "mov r0, #0\n\t"
+                    "str r0, [r1, #0x44]\n\t"        /* frame->restore_flags */
+@@ -1174,8 +1178,11 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispat
+                    "mov sp, r1\n\t"
+                    "mov r8, r1\n\t"
+                    "ldr r5, [r1, #0x50]\n\t"        /* frame->syscall_table */
+-                   "ubfx r4, ip, #12, #2\n\t"       /* syscall table number */
+-                   "bfc ip, #12, #20\n\t"           /* syscall number */
++                   "and r4, ip, #0b11000000000000\n\t" /* syscall table number */
++                   "lsr r4, r4, #12\n\t"
++                   "bic ip ,ip, #0xFF000000\n\t"           /* syscall number */
++                   "bic ip ,ip, #0x00FF0000\n\t"           /* syscall number */
++                   "bic ip ,ip, #0x0000F000\n\t"           /* syscall number */
+                    "add r4, r5, r4, lsl #4\n\t"
+                    "ldr r5, [r4, #8]\n\t"           /* table->ServiceLimit */
+                    "cmp ip, r5\n\t"
+@@ -1213,8 +1220,8 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispat
                     "ldr sp, [r8, #0x38]\n\t"
                     "add r8, r8, #0x10\n\t"
                     "ldm r8, {r4-r12,pc}\n"
@@ -16,3 +52,194 @@ index a1bcb0dd..206d32fe 100644
                     "add sp, sp, #0x10\n\t"
                     "b 4b\n"
                     __ASM_NAME("__wine_syscall_dispatcher_return") ":\n\t"
+Index: wine-7.0~repack/tools/winebuild/main.c
+===================================================================
+--- wine-7.0~repack.orig/tools/winebuild/main.c
++++ wine-7.0~repack/tools/winebuild/main.c
+@@ -613,7 +613,7 @@ int main(int argc, char **argv)
+     files = parse_options( argc, argv, short_options, long_options, 0, option_callback );
+     atexit( cleanup );  /* make sure we remove the output file on exit */
+-    if (!save_temps) atexit( cleanup_tmp_files );
++    //if (!save_temps) atexit( cleanup_tmp_files );
+     if (spec->file_name && !strchr( spec->file_name, '.' ))
+         strcat( spec->file_name, exec_mode == MODE_EXE ? ".exe" : ".dll" );
+Index: wine-7.0~repack/tools/winebuild/relay.c
+===================================================================
+--- wine-7.0~repack.orig/tools/winebuild/relay.c
++++ wine-7.0~repack/tools/winebuild/relay.c
+@@ -140,18 +140,18 @@ static void BuildCallFrom16Core( int reg
+         output( "\t.byte 0x2e\n\tmovl %s,%%edx\n", asm_name("CallTo16_DataSelector") );
+     /* Load 32-bit segment registers */
+-    output( "\tmovw %%dx, %%ds\n" );
+-    output( "\tmovw %%dx, %%es\n" );
++    output( "\tldr %%dx, =%%ds\n" );
++    output( "\tldr %%dx, =%%es\n" );
+     if ( UsePIC )
+-        output( "\tmovw %s-1b(%%ecx), %%fs\n", asm_name("CallTo16_TebSelector") );
++        output( "\tldr %s-1b(%%ecx), =%%fs\n", asm_name("CallTo16_TebSelector") );
+     else
+-        output( "\tmovw %s, %%fs\n", asm_name("CallTo16_TebSelector") );
++        output( "\tldr %s, =%%fs\n", asm_name("CallTo16_TebSelector") );
+     output( "\t.byte 0x64\n\tmov (%d),%%gs\n", GS_OFFSET );
+     /* Translate STACK16FRAME base to flat offset in %edx */
+-    output( "\tmovw %%ss, %%dx\n" );
++    output( "\tldr %%ss, =%%dx\n" );
+     output( "\tandl $0xfff8, %%edx\n" );
+     output( "\tshrl $1, %%edx\n" );
+     if (UsePIC)
+@@ -170,8 +170,8 @@ static void BuildCallFrom16Core( int reg
+     output( "\tpushl %%ebp\n" );
+     /* Switch stacks */
+-    output( "\t.byte 0x64\n\tmovw %%ss, (%d)\n", STACKOFFSET + 2 );
+-    output( "\t.byte 0x64\n\tmovw %%sp, (%d)\n", STACKOFFSET );
++    output( "\t.byte 0x64\n\tldr %%ss, =(%d)\n", STACKOFFSET + 2 );
++    output( "\t.byte 0x64\n\tldr %%sp, =(%d)\n", STACKOFFSET );
+     output( "\tpushl %%ds\n" );
+     output( "\tpopl %%ss\n" );
+     output( "\tmovl %%ebp, %%esp\n" );
+Index: wine-7.0~repack/tools/winegcc/utils.c
+===================================================================
+--- wine-7.0~repack.orig/tools/winegcc/utils.c
++++ wine-7.0~repack/tools/winegcc/utils.c
+@@ -189,7 +189,7 @@ int spawn(struct strarray prefix, struct
+     args.str[0] = find_binary( prefix, args.str[0] );
+     if (verbose) strarray_trace( args );
+-
++    printf("!!%s!!", strarray_tostring(args," "));
+     if ((status = strarray_spawn( args )) && !ignore_errors)
+     {
+       if (status > 0) error("%s failed\n", args.str[0]);
+Index: wine-7.0~repack/dlls/ntdll/signal_arm.c
+===================================================================
+--- wine-7.0~repack.orig/dlls/ntdll/signal_arm.c
++++ wine-7.0~repack/dlls/ntdll/signal_arm.c
+@@ -112,7 +112,12 @@ __ASM_STDCALL_FUNC( RtlCaptureContext, 4
+                     "str SP, [r0, #0x38]\n\t"  /* context->Sp */
+                     "str LR, [r0, #0x40]\n\t"  /* context->Pc */
+                     "mrs r1, CPSR\n\t"
+-                    "bfi r1, lr, #5, #1\n\t"   /* Thumb bit */
++                    //"bfi r1, lr, #5, #1\n\t"   /* Thumb bit */
++                    "push {r6}\n\t"
++                    "and r6, lr, #1\n\t" /* begin set thumb bit */
++                    "bic r1, r1, #32\n\t"
++                    "orr r1, r1, r6, lsl #5\n\t" /* end set thumb bit */
++                    "pop {r6}\n\t"
+                     "str r1, [r0, #0x44]\n\t"  /* context->Cpsr */
+                     "mov r1, #0\n\t"
+                     "str r1, [r0, #0x4]\n\t"   /* context->R0 */
+@@ -1102,7 +1107,8 @@ __ASM_GLOBAL_FUNC( call_consolidate_call
+                    __ASM_CFI(".cfi_escape 0x10,0x8e,0x02,0x03,0x7d,0xc0,0x01\n\t") /* DW_CFA_expression: D14 DW_OP_breg13 + 192 */
+                    __ASM_CFI(".cfi_escape 0x10,0x8f,0x02,0x03,0x7d,0xc8,0x01\n\t") /* DW_CFA_expression: D15 DW_OP_breg13 + 200 */
+ #endif
+-                   "ldrd r1, r2, [sp, #0x1a4]\n\t"
++                   "ldr r1, [sp, #0x1a4]\n\t"
++                   "ldr r2, [sp, #0x1a8]\n\t"
+                    "mov r0, r2\n\t"
+                    "blx r1\n\t"
+                    "add sp, sp, #0x1ac\n\t"
+@@ -1420,7 +1426,12 @@ __ASM_STDCALL_FUNC( RtlRaiseException, 4
+                     "str r1, [sp, #0x3c]\n\t"  /* context->Lr */
+                     "str r1, [sp, #0x40]\n\t"  /* context->Pc */
+                     "mrs r2, CPSR\n\t"
+-                    "bfi r2, r1, #5, #1\n\t"   /* Thumb bit */
++                    //"bfi r2, r1, #5, #1\n\t"   /* Thumb bit */
++                    "push {r6}\n\t"
++                    "and r6, r1, #1\n\t" /* begin set thumb bit */
++                    "bic r2, r2, #32\n\t"
++                    "orr r2, r2, r6, lsl #5\n\t" /* end set thumb bit */
++                    "pop {r6}\n\t" 
+                     "str r2, [sp, #0x44]\n\t"  /* context->Cpsr */
+                     "str r1, [r0, #12]\n\t"    /* rec->ExceptionAddress */
+                     "add r1, sp, #0x1a8\n\t"
+Index: wine-7.0~repack/tools/winebuild/spec32.c
+===================================================================
+--- wine-7.0~repack.orig/tools/winebuild/spec32.c
++++ wine-7.0~repack/tools/winebuild/spec32.c
+@@ -312,8 +312,10 @@ static void output_relay_debug( DLLSPEC
+             }
+             output( "\tpush {LR}\n" );
+             output( "\tsub SP, #4\n");
+-            output( "\tmovw r1,#%u\n", i - spec->base );
+-            output( "\tmovt r1,#%u\n", odp->u.func.args_str_offset );
++            output( "\tmov r1,#%u\n", (i - spec->base) % 256 );
++            output( "\torr r1,#%u\n", (i - spec->base) / 256 * 256 );
++            output( "\torr r1,#%u\n", (odp->u.func.args_str_offset % 256 ) * 65536 );
++            output( "\torr r1,#%u\n", (odp->u.func.args_str_offset / 256 * 256 ) * 65536 );
+             if (UsePIC)
+             {
+                 output( "\tldr r0, 2f\n");
+Index: wine-7.0~repack/tools/winebuild/import.c
+===================================================================
+--- wine-7.0~repack.orig/tools/winebuild/import.c
++++ wine-7.0~repack/tools/winebuild/import.c
+@@ -1150,7 +1150,7 @@ static void output_delayed_import_thunks
+                 break;
+             case CPU_ARM:
+                 output( "\tmov ip, #%u\n", j );
+-                if (idx) output( "\tmovt ip, #%u\n", idx );
++                if (idx) output( "\torr ip, #%u\n", idx * 65536 );
+                 output( "\tb %s\n", asm_name("__wine_delay_load_asm") );
+                 break;
+             case CPU_ARM64:
+@@ -1449,7 +1449,8 @@ void output_syscalls( DLLSPEC *spec )
+             break;
+         case CPU_ARM:
+             output( "\tpush {r0-r3}\n" );
+-            output( "\tmovw ip, #%u\n", id );
++            output( "\tmov ip, #%u\n", id & 0xFF );
++            if (id > 256) output( "\torr ip, ip, #%u\n", id & 0xFF00 );
+             output( "\tmov r3, lr\n" );
+             output( "\tbl %s\n", asm_name("__wine_syscall") );
+             output( "\tbx lr\n" );
+Index: wine-7.0~repack/include/winnt.h
+===================================================================
+--- wine-7.0~repack.orig/include/winnt.h
++++ wine-7.0~repack/include/winnt.h
+@@ -6537,7 +6537,7 @@ static FORCEINLINE void YieldProcessor(v
+ #if defined(__i386__) || defined(__x86_64__)
+     __asm__ __volatile__( "rep; nop" : : : "memory" );
+ #elif defined(__arm__) || defined(__aarch64__)
+-    __asm__ __volatile__( "dmb ishst\n\tyield" : : : "memory" );
++    __asm__ __volatile__( "mcr p15, #0, r0, c7, c10, #5\n\tyield" : : : "memory" );
+ #else
+     __asm__ __volatile__( "" : : : "memory" );
+ #endif
+Index: wine-7.0~repack/loader/preloader.c
+===================================================================
+--- wine-7.0~repack.orig/loader/preloader.c
++++ wine-7.0~repack/loader/preloader.c
+@@ -546,8 +546,8 @@ __ASM_GLOBAL_FUNC(_start,
+                   "sub sp, sp, #144\n\t" /* allocate some space for extra aux values */
+                   "str r0, [sp]\n\t"     /* orig stack pointer */
+                   "ldr r0, =thread_data\n\t"
+-                  "movw r7, #0x0005\n\t" /* __ARM_NR_set_tls */
+-                  "movt r7, #0xf\n\t"    /* __ARM_NR_set_tls */
++                  "mov r7, #0x0005\n\t" /* __ARM_NR_set_tls */
++                  "orr r7, #0xf0000\n\t"    /* __ARM_NR_set_tls */
+                   "svc #0\n\t"
+                   "mov r0, sp\n\t"       /* ptr to orig stack pointer */
+                   "bl wld_start\n\t"
+@@ -567,12 +567,13 @@ __ASM_GLOBAL_FUNC(_start,
+                        "push {r4-r5,r7,lr}\n\t" \
+                        "ldr r4, [sp, #16]\n\t" \
+                        "ldr r5, [sp, #20]\n\t" \
+-                       "mov r7, #" #nr "\n\t" \
++                       "ldr r7, =#" #nr "\n\t" \
+                        "svc #0\n\t" \
+                        "cmn r0, #4096\n\t" \
+                        "it hi\n\t" \
+                        "movhi r0, #-1\n\t" \
+-                       "pop {r4-r5,r7,pc}\n\t" )
++                       "pop {r4-r5,r7,pc}\n\t" \
++                       ".ltorg\n\t" )
+ #define SYSCALL_NOERR( name, nr ) \
+     __ASM_GLOBAL_FUNC( name, \
index f2216858a9cfe5525efb7a80680e6c97a5fa346d..8f62b25a93acd5968d9c289cd4b548ca8112547f 100644 (file)
@@ -8,7 +8,6 @@ debianization/desktop-launchers.patch
 debianization/duplicate-apploaders.patch
 debianization/wineserver-persistence.patch
 
-system/zlib.patch
 
 disable/fold.patch
 disable/line-wrapping.patch
index 62da4fd28e5df047e7067453d8846cb623198934..c9cfa9cf5b1b33cc9bee130de53b60fb146bccc7 100755 (executable)
@@ -255,6 +255,8 @@ override_dh_missing:
 override_dh_clean:
        dh_clean -- $(INSTALLS)
        make -f debian/rules debian/control
+       find . -maxdepth 1 -name '*.o' -delete
+       find . -maxdepth 1 -name '*.s' -delete
 
 override_dh_auto_clean:
        make -f debian/rules debian/control
index 12ffbb3663a12aaf1cb1c4bb5b3b21c9d1e834b0..c31b44bfa13f887b77218a3a6c01cb1ef0558899 100644 (file)
@@ -112,7 +112,12 @@ __ASM_STDCALL_FUNC( RtlCaptureContext, 4,
                     "str SP, [r0, #0x38]\n\t"  /* context->Sp */
                     "str LR, [r0, #0x40]\n\t"  /* context->Pc */
                     "mrs r1, CPSR\n\t"
-                    "bfi r1, lr, #5, #1\n\t"   /* Thumb bit */
+                    //"bfi r1, lr, #5, #1\n\t"   /* Thumb bit */
+                    "push {r6}\n\t"
+                    "and r6, lr, #1\n\t" /* begin set thumb bit */
+                    "bic r1, r1, #32\n\t"
+                    "orr r1, r1, r6, lsl #5\n\t" /* end set thumb bit */
+                    "pop {r6}\n\t"
                     "str r1, [r0, #0x44]\n\t"  /* context->Cpsr */
                     "mov r1, #0\n\t"
                     "str r1, [r0, #0x4]\n\t"   /* context->R0 */
@@ -1102,7 +1107,8 @@ __ASM_GLOBAL_FUNC( call_consolidate_callback,
                    __ASM_CFI(".cfi_escape 0x10,0x8e,0x02,0x03,0x7d,0xc0,0x01\n\t") /* DW_CFA_expression: D14 DW_OP_breg13 + 192 */
                    __ASM_CFI(".cfi_escape 0x10,0x8f,0x02,0x03,0x7d,0xc8,0x01\n\t") /* DW_CFA_expression: D15 DW_OP_breg13 + 200 */
 #endif
-                   "ldrd r1, r2, [sp, #0x1a4]\n\t"
+                   "ldr r1, [sp, #0x1a4]\n\t"
+                   "ldr r2, [sp, #0x1a8]\n\t"
                    "mov r0, r2\n\t"
                    "blx r1\n\t"
                    "add sp, sp, #0x1ac\n\t"
@@ -1420,7 +1426,12 @@ __ASM_STDCALL_FUNC( RtlRaiseException, 4,
                     "str r1, [sp, #0x3c]\n\t"  /* context->Lr */
                     "str r1, [sp, #0x40]\n\t"  /* context->Pc */
                     "mrs r2, CPSR\n\t"
-                    "bfi r2, r1, #5, #1\n\t"   /* Thumb bit */
+                    //"bfi r2, r1, #5, #1\n\t"   /* Thumb bit */
+                    "push {r6}\n\t"
+                    "and r6, r1, #1\n\t" /* begin set thumb bit */
+                    "bic r2, r2, #32\n\t"
+                    "orr r2, r2, r6, lsl #5\n\t" /* end set thumb bit */
+                    "pop {r6}\n\t" 
                     "str r2, [sp, #0x44]\n\t"  /* context->Cpsr */
                     "str r1, [r0, #12]\n\t"    /* rec->ExceptionAddress */
                     "add r1, sp, #0x1a8\n\t"
index 206d32fe057fb76ec4afb71c2d24a896a539ddb3..78dea1834cc588c646e4c2aa799eef3977944559 100644 (file)
@@ -1128,7 +1128,8 @@ __ASM_GLOBAL_FUNC( signal_start_thread,
                    "str sp, [r3, #0x1d4]\n\t" /* arm_thread_data()->exit_frame */
                    /* set syscall frame */
                    "ldr r6, [r3, #0x1d8]\n\t" /* arm_thread_data()->syscall_frame */
-                   "cbnz r6, 1f\n\t"
+                   "cmp r6, #0\n\t"
+                   "bne 1f\n\t"
                    "sub r6, sp, #0x160\n\t"   /* sizeof(struct syscall_frame) */
                    "str r6, [r3, #0x1d8]\n\t" /* arm_thread_data()->syscall_frame */
                    "1:\tmov sp, r6\n\t"
@@ -1160,7 +1161,10 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher,
                    "str r2, [r1, #0x38]\n\t"
                    "str r3, [r1, #0x3c]\n\t"
                    "mrs r0, CPSR\n\t"
-                   "bfi r0, lr, #5, #1\n\t"         /* set thumb bit */
+                   "and r6, lr, #1\n\t" /* begin set thumb bit */
+                   "bic r0, r0, #32\n\t"
+                   "orr r0, r0, r6, LSL #5\n\t" /* end set thumb bit */
+                   /*"bfi r0, lr, #5, #1\n\t"*/         /* set thumb bit */
                    "str r0, [r1, #0x40]\n\t"
                    "mov r0, #0\n\t"
                    "str r0, [r1, #0x44]\n\t"        /* frame->restore_flags */
@@ -1174,8 +1178,11 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher,
                    "mov sp, r1\n\t"
                    "mov r8, r1\n\t"
                    "ldr r5, [r1, #0x50]\n\t"        /* frame->syscall_table */
-                   "ubfx r4, ip, #12, #2\n\t"       /* syscall table number */
-                   "bfc ip, #12, #20\n\t"           /* syscall number */
+                   "and r4, ip, #0b11000000000000\n\t" /* syscall table number */
+                   "lsr r4, r4, #12\n\t"
+                   "bic ip ,ip, #0xFF000000\n\t"           /* syscall number */
+                   "bic ip ,ip, #0x00FF0000\n\t"           /* syscall number */
+                   "bic ip ,ip, #0x0000F000\n\t"           /* syscall number */
                    "add r4, r5, r4, lsl #4\n\t"
                    "ldr r5, [r4, #8]\n\t"           /* table->ServiceLimit */
                    "cmp ip, r5\n\t"
index c80efee077d250886bfafd88d45432bb793d08c3..a09d1c6140a6f2fe3d1889b08ba88ecd2818b7d7 100644 (file)
@@ -6537,7 +6537,7 @@ static FORCEINLINE void YieldProcessor(void)
 #if defined(__i386__) || defined(__x86_64__)
     __asm__ __volatile__( "rep; nop" : : : "memory" );
 #elif defined(__arm__) || defined(__aarch64__)
-    __asm__ __volatile__( "dmb ishst\n\tyield" : : : "memory" );
+    __asm__ __volatile__( "mcr p15, #0, r0, c7, c10, #5\n\tyield" : : : "memory" );
 #else
     __asm__ __volatile__( "" : : : "memory" );
 #endif
index 585be50624f62f0e9b6d4068458b2c330e80c121..d873b42b651f81be647cfe9970de3698fb34b32e 100644 (file)
@@ -546,8 +546,8 @@ __ASM_GLOBAL_FUNC(_start,
                   "sub sp, sp, #144\n\t" /* allocate some space for extra aux values */
                   "str r0, [sp]\n\t"     /* orig stack pointer */
                   "ldr r0, =thread_data\n\t"
-                  "movw r7, #0x0005\n\t" /* __ARM_NR_set_tls */
-                  "movt r7, #0xf\n\t"    /* __ARM_NR_set_tls */
+                  "mov r7, #0x0005\n\t" /* __ARM_NR_set_tls */
+                  "orr r7, #0xf0000\n\t"    /* __ARM_NR_set_tls */
                   "svc #0\n\t"
                   "mov r0, sp\n\t"       /* ptr to orig stack pointer */
                   "bl wld_start\n\t"
@@ -567,12 +567,13 @@ __ASM_GLOBAL_FUNC(_start,
                        "push {r4-r5,r7,lr}\n\t" \
                        "ldr r4, [sp, #16]\n\t" \
                        "ldr r5, [sp, #20]\n\t" \
-                       "mov r7, #" #nr "\n\t" \
+                       "ldr r7, =#" #nr "\n\t" \
                        "svc #0\n\t" \
                        "cmn r0, #4096\n\t" \
                        "it hi\n\t" \
                        "movhi r0, #-1\n\t" \
-                       "pop {r4-r5,r7,pc}\n\t" )
+                       "pop {r4-r5,r7,pc}\n\t" \
+                       ".ltorg\n\t" )
 
 #define SYSCALL_NOERR( name, nr ) \
     __ASM_GLOBAL_FUNC( name, \
index a0b25fa703f957ee2b42718a0cf243ca523e42c5..13e067502e744905b42df419e0a6fe0a79e15b5e 100644 (file)
@@ -1150,7 +1150,7 @@ static void output_delayed_import_thunks( const DLLSPEC *spec )
                 break;
             case CPU_ARM:
                 output( "\tmov ip, #%u\n", j );
-                if (idx) output( "\tmovt ip, #%u\n", idx );
+                if (idx) output( "\torr ip, #%u\n", idx * 65536 );
                 output( "\tb %s\n", asm_name("__wine_delay_load_asm") );
                 break;
             case CPU_ARM64:
@@ -1449,7 +1449,8 @@ void output_syscalls( DLLSPEC *spec )
             break;
         case CPU_ARM:
             output( "\tpush {r0-r3}\n" );
-            output( "\tmovw ip, #%u\n", id );
+            output( "\tmov ip, #%u\n", id & 0xFF );
+            if (id > 256) output( "\torr ip, ip, #%u\n", id & 0xFF00 );
             output( "\tmov r3, lr\n" );
             output( "\tbl %s\n", asm_name("__wine_syscall") );
             output( "\tbx lr\n" );
index 77f13b0fa8a3599c42ded120f84504b5c0398f76..62795fb8329d24c84551d5319b1119354d731790 100644 (file)
@@ -613,7 +613,7 @@ int main(int argc, char **argv)
     files = parse_options( argc, argv, short_options, long_options, 0, option_callback );
 
     atexit( cleanup );  /* make sure we remove the output file on exit */
-    if (!save_temps) atexit( cleanup_tmp_files );
+    //if (!save_temps) atexit( cleanup_tmp_files );
 
     if (spec->file_name && !strchr( spec->file_name, '.' ))
         strcat( spec->file_name, exec_mode == MODE_EXE ? ".exe" : ".dll" );
index b86a88aae242f9868d53f2bba90bc380841eda9a..baf3743a6ccb99960b6204502710a35a968855b9 100644 (file)
@@ -140,18 +140,18 @@ static void BuildCallFrom16Core( int reg_func, int thunk )
         output( "\t.byte 0x2e\n\tmovl %s,%%edx\n", asm_name("CallTo16_DataSelector") );
 
     /* Load 32-bit segment registers */
-    output( "\tmovw %%dx, %%ds\n" );
-    output( "\tmovw %%dx, %%es\n" );
+    output( "\tldr %%dx, =%%ds\n" );
+    output( "\tldr %%dx, =%%es\n" );
 
     if ( UsePIC )
-        output( "\tmovw %s-1b(%%ecx), %%fs\n", asm_name("CallTo16_TebSelector") );
+        output( "\tldr %s-1b(%%ecx), =%%fs\n", asm_name("CallTo16_TebSelector") );
     else
-        output( "\tmovw %s, %%fs\n", asm_name("CallTo16_TebSelector") );
+        output( "\tldr %s, =%%fs\n", asm_name("CallTo16_TebSelector") );
 
     output( "\t.byte 0x64\n\tmov (%d),%%gs\n", GS_OFFSET );
 
     /* Translate STACK16FRAME base to flat offset in %edx */
-    output( "\tmovw %%ss, %%dx\n" );
+    output( "\tldr %%ss, =%%dx\n" );
     output( "\tandl $0xfff8, %%edx\n" );
     output( "\tshrl $1, %%edx\n" );
     if (UsePIC)
@@ -170,8 +170,8 @@ static void BuildCallFrom16Core( int reg_func, int thunk )
     output( "\tpushl %%ebp\n" );
 
     /* Switch stacks */
-    output( "\t.byte 0x64\n\tmovw %%ss, (%d)\n", STACKOFFSET + 2 );
-    output( "\t.byte 0x64\n\tmovw %%sp, (%d)\n", STACKOFFSET );
+    output( "\t.byte 0x64\n\tldr %%ss, =(%d)\n", STACKOFFSET + 2 );
+    output( "\t.byte 0x64\n\tldr %%sp, =(%d)\n", STACKOFFSET );
     output( "\tpushl %%ds\n" );
     output( "\tpopl %%ss\n" );
     output( "\tmovl %%ebp, %%esp\n" );
index 46494f2e2735bb414412364c3a3ab1856a9686f8..fc32ae57df2310de2f857cc55e7269ebf4ee61d1 100644 (file)
@@ -312,8 +312,10 @@ static void output_relay_debug( DLLSPEC *spec )
             }
             output( "\tpush {LR}\n" );
             output( "\tsub SP, #4\n");
-            output( "\tmovw r1,#%u\n", i - spec->base );
-            output( "\tmovt r1,#%u\n", odp->u.func.args_str_offset );
+            output( "\tmov r1,#%u\n", (i - spec->base) % 256 );
+            output( "\torr r1,#%u\n", (i - spec->base) / 256 * 256 );
+            output( "\torr r1,#%u\n", (odp->u.func.args_str_offset % 256 ) * 65536 );
+            output( "\torr r1,#%u\n", (odp->u.func.args_str_offset / 256 * 256 ) * 65536 );
             if (UsePIC)
             {
                 output( "\tldr r0, 2f\n");
index 409ae26cd823ac7130120deae3848f91d4bfdcf2..7d929b92206cbec785c5e993bed14b52397df3f4 100644 (file)
@@ -189,7 +189,7 @@ int spawn(struct strarray prefix, struct strarray args, int ignore_errors)
 
     args.str[0] = find_binary( prefix, args.str[0] );
     if (verbose) strarray_trace( args );
-
+    printf("!!%s!!", strarray_tostring(args," "));
     if ((status = strarray_spawn( args )) && !ignore_errors)
     {
        if (status > 0) error("%s failed\n", args.str[0]);