diff --git a/arch/aarch64/swapcontext.S b/arch/aarch64/swapcontext.S index 19303a7..d5bad2c 100644 --- a/arch/aarch64/swapcontext.S +++ b/arch/aarch64/swapcontext.S @@ -51,7 +51,7 @@ FUNC(libucontext_swapcontext) /* move x1 to x0 and call setcontext */ mov x0, x1 - bl libucontext_setcontext + bl PROC_NAME(libucontext_setcontext) /* hmm, we came back here try to return */ mov x30, x28 diff --git a/arch/common/common-defs.h b/arch/common/common-defs.h index 8a5f12d..3e8b607 100644 --- a/arch/common/common-defs.h +++ b/arch/common/common-defs.h @@ -18,15 +18,27 @@ #endif #ifndef TYPE -# define TYPE(__proc) .type __proc, @function; +# ifdef __clang__ +# define TYPE(__proc) // .type not supported +# else +# define TYPE(__proc) .type __proc, @function; +#endif +#endif + +#ifndef PROC_NAME +# ifdef __MACH__ +# define PROC_NAME(__proc) _ ## __proc +# else +# define PROC_NAME(__proc) __proc +# endif #endif #define FUNC(__proc) \ - .global __proc; \ + .global PROC_NAME(__proc); \ .align 2; \ TYPE(__proc) \ ENT(__proc) \ -__proc: \ +PROC_NAME(__proc): \ SETUP_FRAME(__proc) #ifdef __clang__ #define END(__proc)