Module: wine Branch: master Commit: 955664c80f9dda3c14e871d518968ed0a3d52eec URL: https://gitlab.winehq.org/wine/wine/-/commit/955664c80f9dda3c14e871d518968ed...
Author: Alexandre Julliard julliard@winehq.org Date: Mon Nov 13 11:29:45 2023 +0100
winebuild: Add a helper to build an ARM64EC function name.
---
tools/winebuild/build.h | 1 + tools/winebuild/import.c | 6 +++--- tools/winebuild/utils.c | 16 +++++++++++++++- 3 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/tools/winebuild/build.h b/tools/winebuild/build.h index ef50e0597e9..61e404640e0 100644 --- a/tools/winebuild/build.h +++ b/tools/winebuild/build.h @@ -287,6 +287,7 @@ extern int sort_func_list( ORDDEF **list, int count, int (*compare)(const void * extern unsigned int get_page_size(void); extern unsigned int get_args_size( const ORDDEF *odp ); extern const char *asm_name( const char *func ); +extern const char *arm64_name( const char *func ); extern const char *asm_globl( const char *func ); extern const char *get_asm_ptr_keyword(void); extern const char *get_asm_string_keyword(void); diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c index 5ae8de1406c..c3a1dad4452 100644 --- a/tools/winebuild/import.c +++ b/tools/winebuild/import.c @@ -1347,7 +1347,7 @@ void output_stubs( DLLSPEC *spec ) break; case CPU_ARM64: case CPU_ARM64EC: - output_seh( ".seh_proc %s", asm_name(name) ); + output_seh( ".seh_proc %s", arm64_name(name) ); output_seh( ".seh_endprologue" ); output( "\tadrp x0, %s\n", arm64_page(".L__wine_spec_file_name") ); output( "\tadd x0, x0, #%s\n", arm64_pageoff(".L__wine_spec_file_name") ); @@ -1360,7 +1360,7 @@ void output_stubs( DLLSPEC *spec ) } else output( "\tmov x1, %u\n", odp->ordinal ); - output( "\tb %s\n", asm_name("__wine_spec_unimplemented_stub") ); + output( "\tb %s\n", arm64_name("__wine_spec_unimplemented_stub") ); output_seh( ".seh_endproc" ); break; } @@ -1476,7 +1476,7 @@ void output_syscalls( DLLSPEC *spec ) break; case CPU_ARM64: case CPU_ARM64EC: - output_seh( ".seh_proc %s", asm_name(name) ); + output_seh( ".seh_proc %s", arm64_name(name) ); output_seh( ".seh_endprologue" ); output( "\tmov x8, #%u\n", id ); output( "\tmov x9, x30\n" ); diff --git a/tools/winebuild/utils.c b/tools/winebuild/utils.c index c9880400a8c..0649070803a 100644 --- a/tools/winebuild/utils.c +++ b/tools/winebuild/utils.c @@ -828,10 +828,24 @@ const char *asm_name( const char *sym ) } }
+/* return the assembly name for an ARM64/ARM64EC function */ +const char *arm64_name( const char *sym ) +{ + switch (target.platform) + { + case PLATFORM_MINGW: + case PLATFORM_WINDOWS: + if (target.cpu == CPU_ARM64EC) return strmake( ""#%s"", sym ); + /* fall through */ + default: + return asm_name( sym ); + } +} + /* return an assembly function declaration for a C function name */ void output_function_header( const char *func, int global ) { - const char *name = asm_name( func ); + const char *name = arm64_name( func );
output( "\t.text\n" );