|
| 1 | +# arm32 deduplicate labels |
| 2 | + |
| 3 | +Problem that only appears on clang (not former GNU AS used before Android NDK 24): |
| 4 | + |
| 5 | +```text |
| 6 | +make: Entering directory '/workspaces/dkml-compiler/dist-android_arm32v7a-on-linux_x86/opt/mlcross/android_arm32v7a/src/ocaml/stdlib' |
| 7 | +/usr/bin/env /workspaces/dkml-compiler/dist-android_arm32v7a-on-linux_x86/opt/mlcross/android_arm32v7a/src/ocaml/support/ocamloptTarget.wrapper -strict-sequence -absname -w +a-4-9-41-42-44-45-48-70 -g -warn-error +A -bin-annot -nostdlib -principal -safe-string -strict-formats -dstartup -S -nopervasives -c camlinternalAtomic.ml |
| 8 | +camlinternalAtomic.s:94:1: error: symbol '.L100' is already defined |
| 9 | +.L100: |
| 10 | +^ |
| 11 | +camlinternalAtomic.s:146:1: error: symbol '.L105' is already defined |
| 12 | +.L105: |
| 13 | +^ |
| 14 | +camlinternalAtomic.s:173:1: error: symbol '.L106' is already defined |
| 15 | +.L106: |
| 16 | +^ |
| 17 | +camlinternalAtomic.s:202:1: error: symbol '.L108' is already defined |
| 18 | +.L108: |
| 19 | +^ |
| 20 | +camlinternalAtomic.s:262:1: error: symbol '.L110' is already defined |
| 21 | +.L110: |
| 22 | +^ |
| 23 | +camlinternalAtomic.s:289:1: error: symbol '.L112' is already defined |
| 24 | +.L112: |
| 25 | +^ |
| 26 | +File "/workspaces/dkml-compiler/dist-android_arm32v7a-on-linux_x86/opt/mlcross/android_arm32v7a/src/ocaml/stdlib/camlinternalAtomic.ml", line 1: |
| 27 | +Error: Assembler error, input left in file /workspaces/dkml-compiler/dist-android_arm32v7a-on-linux_x86/opt/mlcross/android_arm32v7a/src/ocaml/stdlib/camlinternalAtomic.s |
| 28 | +make: *** [Makefile:231: camlinternalAtomic.cmx] Error 2 |
| 29 | +make: Leaving directory '/workspaces/dkml-compiler/dist-android_arm32v7a-on-linux_x86/opt/mlcross/android_arm32v7a/src/ocaml/stdlib' |
| 30 | +``` |
| 31 | + |
| 32 | +Here is the definition of a function: |
| 33 | + |
| 34 | +```armasm |
| 35 | +# lines 1 - 82 |
| 36 | +camlCamlinternalAtomic__make_9: # line 83 |
| 37 | + .file 2 "camlinternalAtomic.ml" |
| 38 | + .loc 2 27 |
| 39 | + .cfi_startproc |
| 40 | + .loc 2 27 |
| 41 | + sub sp, sp, #0x8 # Beginning of [Lprologue] |
| 42 | + .cfi_adjust_cfa_offset 8 |
| 43 | + .cfi_offset 14, -4 |
| 44 | + str lr, [sp, #4] |
| 45 | +.L100: # line 92 |
| 46 | + .loc 2 27 # End of [Lprologue] |
| 47 | +.L100: # line 94. Beginning and end of [Llabel] |
| 48 | + .loc 2 27 |
| 49 | + sub alloc_ptr, alloc_ptr, #0x8 |
| 50 | + ldr r1, [domain_state_ptr, 0] |
| 51 | + cmp alloc_ptr, r1 |
| 52 | + bcc .L102 |
| 53 | +.L103: add r1, alloc_ptr, #4 |
| 54 | + ldr lr, [sp, #4] |
| 55 | + movs r2, #0x400 |
| 56 | + str r2, [r1, #-4] |
| 57 | + str r0, [r1, #0] |
| 58 | + mov r0, r1 |
| 59 | + add sp, sp, #0x8 |
| 60 | + .cfi_adjust_cfa_offset -8 |
| 61 | + bx lr |
| 62 | + .cfi_adjust_cfa_offset 8 |
| 63 | +.L102: bl caml_call_gc(PLT) |
| 64 | +.L101: b .L103 |
| 65 | + .cfi_endproc |
| 66 | + .type camlCamlinternalAtomic__make_9, %function |
| 67 | + .size camlCamlinternalAtomic__make_9, .-camlCamlinternalAtomic__make_9 |
| 68 | +``` |
| 69 | + |
| 70 | +This patch gets rid of any duplicate, consecutive labels. |
0 commit comments