Closed Blackhex closed 1 month ago
Appeared in the recent OpenBLAS build. The mininum repro case is:
struct DATA_ZTRMV { double a_verify[131072]; double x_test; } data_ztrmv; int ztrmv_(double *) { } void check_ztrmv() { ztrmv_(&data_ztrmv.x_test); }
when built with:
aarch64-w64-mingw32-gcc -o bug.o -c bug.c
the output is:
/tmp/cc8WGCum.s: Assembler messages: /tmp/cc8WGCum.s:38: Error: relocation overflow
Changing the size of a_verify to anything lower than 131072 fixes the issue.
a_verify
131072
The produced assembly is:
.arch armv8-a .text .global data_ztrmv .data .align 3 data_ztrmv: .space 1048584 // skip .text .align 2 .global ztrmv_ .seh_proc ztrmv_ ztrmv_: sub sp, sp, #16 .seh_stackalloc 16 .seh_endprologue str x0, [sp, 8] nop .seh_startepilogue add sp, sp, 16 .seh_stackalloc 16 ret .seh_endepilogue .seh_endproc .align 2 .global check_ztrmv .seh_proc check_ztrmv check_ztrmv: sub x10, sp, #8192 .seh_nop str xzr, [x10, 4080] .seh_nop .seh_nop stp x29, x30, [sp, -16]! .seh_save_regp_x x29, 16 mov x29, sp .seh_set_fp .seh_endprologue adrp x0, data_ztrmv+1048576 add x0, x0, :lo12:data_ztrmv+1048576 bl ztrmv_ nop .seh_startepilogue ldp x29, x30, [sp], 16 .seh_save_regp_x x29, 16 ret .seh_endepilogue .seh_endproc
Fixed by https://github.com/Windows-on-ARM-Experiments/gcc-woarm64/pull/23 and https://github.com/Windows-on-ARM-Experiments/binutils-woarm64/pull/2 Validate by https://github.com/Windows-on-ARM-Experiments/mingw-woarm64-build/pull/142
Appeared in the recent OpenBLAS build. The mininum repro case is:
when built with:
the output is:
Changing the size of
a_verify
to anything lower than131072
fixes the issue.The produced assembly is: