From: Twaik Yont <9674930+twaik@users.noreply.github.com> GNU as uses architecture-specific syntax for certain ELF directive arguments. On ARM, the second argument of .type and the section type in .section must be written using “%function” / “%object” and “%progbits”, while most other ELF architectures use the “@function” / “@progbits” form. winebuild currently emits “@function” and “@progbits” unconditionally, which is not accepted by the ARM assembler (including clang’s integrated assembler) and leads to assembly errors. Emit the ARM-specific “%function” and “%progbits” forms when targeting CPU_ARM, and keep the existing “@…” syntax for other architectures. Signed-off-by: Twaik Yont <9674930+twaik@users.noreply.github.com> --- tools/winebuild/utils.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/winebuild/utils.c b/tools/winebuild/utils.c index 1f0cde60bf9..2d2e59ae01d 100644 --- a/tools/winebuild/utils.c +++ b/tools/winebuild/utils.c @@ -780,7 +780,10 @@ void output_function_header( const char *func, int global ) if (global) output( "\t.globl %s\n", name ); break; default: - output( "\t.type %s,@function\n", name ); + if (target.cpu == CPU_ARM) + output( "\t.type %s,%%function\n", name ); + else + output( "\t.type %s,@function\n", name ); if (global) output( "\t.globl %s\n\t.hidden %s\n", name, name ); break; } @@ -890,7 +893,10 @@ void output_gnu_stack_note(void) case PLATFORM_APPLE: break; default: - output( "\t.section .note.GNU-stack,\"\",@progbits\n" ); + if (target.cpu == CPU_ARM) + output( "\t.section .note.GNU-stack,\"\",%%progbits\n" ); + else + output( "\t.section .note.GNU-stack,\"\",@progbits\n" ); break; } } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10067