diff options
author | Nobuyoshi Nakada <[email protected]> | 2024-10-08 16:12:10 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2024-10-08 23:29:49 +0900 |
commit | 1f39184bc7e564eefc9c6e09e038e20e112bef20 (patch) | |
tree | 18b4296223b8ac856b4363cf901e5f0211c18f0d | |
parent | 49ccc31d906d26f980dcedf1197a2e18245ec50e (diff) |
Substitute `coroutine_transfer` with prefixed symbol in Makefile
```
coroutine/arm64/Context.S:31:57: error: invoking macro TOKEN_PASTE argument 1: empty macro arguments are undefined in ISO C90 [-Wpedantic]
31 | .global PREFIXED_SYMBOL(SYMBOL_PREFIX,coroutine_transfer)
| ^
```
-rw-r--r-- | coroutine/amd64/Context.S | 5 | ||||
-rw-r--r-- | coroutine/arm32/Context.S | 7 | ||||
-rw-r--r-- | coroutine/arm64/Context.S | 5 | ||||
-rw-r--r-- | coroutine/loongarch64/Context.S | 5 | ||||
-rw-r--r-- | coroutine/ppc/Context.S | 5 | ||||
-rw-r--r-- | coroutine/ppc64/Context.S | 5 | ||||
-rw-r--r-- | coroutine/ppc64le/Context.S | 7 | ||||
-rw-r--r-- | coroutine/riscv64/Context.S | 5 | ||||
-rw-r--r-- | coroutine/x86/Context.S | 5 | ||||
-rw-r--r-- | template/Makefile.in | 4 |
10 files changed, 23 insertions, 30 deletions
diff --git a/coroutine/amd64/Context.S b/coroutine/amd64/Context.S index eebf9bf18e..4b94d31f30 100644 --- a/coroutine/amd64/Context.S +++ b/coroutine/amd64/Context.S @@ -10,12 +10,11 @@ * one at the bottom of this file */ #define TOKEN_PASTE(x,y) x##y -#define PREFIXED_SYMBOL(prefix,name) TOKEN_PASTE(prefix,name) .text -.globl PREFIXED_SYMBOL(SYMBOL_PREFIX,coroutine_transfer) -PREFIXED_SYMBOL(SYMBOL_PREFIX,coroutine_transfer): +.globl PREFIXED_SYMBOL(coroutine_transfer) +PREFIXED_SYMBOL(coroutine_transfer): #if defined(__CET__) && (__CET__ & 0x01) != 0 /* IBT landing pad */ diff --git a/coroutine/arm32/Context.S b/coroutine/arm32/Context.S index 1850c4c408..945e4f82d5 100644 --- a/coroutine/arm32/Context.S +++ b/coroutine/arm32/Context.S @@ -6,16 +6,15 @@ ## #define TOKEN_PASTE(x,y) x##y -#define PREFIXED_SYMBOL(prefix,name) TOKEN_PASTE(prefix,name) .file "Context.S" .text -.globl PREFIXED_SYMBOL(SYMBOL_PREFIX,coroutine_transfer) +.globl PREFIXED_SYMBOL(coroutine_transfer) .align 2 -.type PREFIXED_SYMBOL(SYMBOL_PREFIX,coroutine_transfer),%function +.type PREFIXED_SYMBOL(coroutine_transfer),%function .syntax unified -PREFIXED_SYMBOL(SYMBOL_PREFIX,coroutine_transfer): +PREFIXED_SYMBOL(coroutine_transfer): # Save caller state (8 registers + return address) push {r4-r11,lr} diff --git a/coroutine/arm64/Context.S b/coroutine/arm64/Context.S index 2391333cae..11f6aa0810 100644 --- a/coroutine/arm64/Context.S +++ b/coroutine/arm64/Context.S @@ -6,7 +6,6 @@ ## #define TOKEN_PASTE(x,y) x##y -#define PREFIXED_SYMBOL(prefix,name) TOKEN_PASTE(prefix,name) #if defined(__APPLE__) #define x29 fp @@ -28,8 +27,8 @@ ## See "Providing protection for complex software" for more details about PAC/BTI ## https://developer.arm.com/architectures/learn-the-architecture/providing-protection-for-complex-software -.global PREFIXED_SYMBOL(SYMBOL_PREFIX,coroutine_transfer) -PREFIXED_SYMBOL(SYMBOL_PREFIX,coroutine_transfer): +.global PREFIXED_SYMBOL(coroutine_transfer) +PREFIXED_SYMBOL(coroutine_transfer): #if defined(__ARM_FEATURE_PAC_DEFAULT) && (__ARM_FEATURE_PAC_DEFAULT != 0) # paciasp (it also acts as BTI landing pad, so no need to insert BTI also) diff --git a/coroutine/loongarch64/Context.S b/coroutine/loongarch64/Context.S index 662f5dfb6c..6e10cd032b 100644 --- a/coroutine/loongarch64/Context.S +++ b/coroutine/loongarch64/Context.S @@ -1,11 +1,10 @@ #define TOKEN_PASTE(x,y) x##y -#define PREFIXED_SYMBOL(prefix,name) TOKEN_PASTE(prefix,name) .text .align 2 -.global PREFIXED_SYMBOL(SYMBOL_PREFIX,coroutine_transfer) -PREFIXED_SYMBOL(SYMBOL_PREFIX,coroutine_transfer): +.global PREFIXED_SYMBOL(coroutine_transfer) +PREFIXED_SYMBOL(coroutine_transfer): # Make space on the stack for caller registers addi.d $sp, $sp, -0xa0 diff --git a/coroutine/ppc/Context.S b/coroutine/ppc/Context.S index e2431a9250..f44b2419b4 100644 --- a/coroutine/ppc/Context.S +++ b/coroutine/ppc/Context.S @@ -9,15 +9,14 @@ ; To add support for AIX, *BSD or *Linux, please make separate implementations. #define TOKEN_PASTE(x,y) x##y -#define PREFIXED_SYMBOL(prefix,name) TOKEN_PASTE(prefix,name) .machine ppc7400 ; = G4, Rosetta .text -.globl PREFIXED_SYMBOL(SYMBOL_PREFIX,coroutine_transfer) +.globl PREFIXED_SYMBOL(coroutine_transfer) .align 2 -PREFIXED_SYMBOL(SYMBOL_PREFIX,coroutine_transfer): +PREFIXED_SYMBOL(coroutine_transfer): ; Make space on the stack for caller registers ; (Should we rather use red zone? See libphobos example.) subi r1,r1,80 diff --git a/coroutine/ppc64/Context.S b/coroutine/ppc64/Context.S index f8561e0e7d..20a47c61c6 100644 --- a/coroutine/ppc64/Context.S +++ b/coroutine/ppc64/Context.S @@ -8,15 +8,14 @@ ; To add support for AIX, *BSD or *Linux, please make separate implementations. #define TOKEN_PASTE(x,y) x##y -#define PREFIXED_SYMBOL(prefix,name) TOKEN_PASTE(prefix,name) .machine ppc64 ; = G5 .text -.globl PREFIXED_SYMBOL(SYMBOL_PREFIX,coroutine_transfer) +.globl PREFIXED_SYMBOL(coroutine_transfer) .align 2 -PREFIXED_SYMBOL(SYMBOL_PREFIX,coroutine_transfer): +PREFIXED_SYMBOL(coroutine_transfer): ; Make space on the stack for caller registers ; (Should we rather use red zone? See libphobos example.) subi r1,r1,160 diff --git a/coroutine/ppc64le/Context.S b/coroutine/ppc64le/Context.S index 61be9efcf0..cccd002be5 100644 --- a/coroutine/ppc64le/Context.S +++ b/coroutine/ppc64le/Context.S @@ -1,12 +1,11 @@ #define TOKEN_PASTE(x,y) x##y -#define PREFIXED_SYMBOL(prefix,name) TOKEN_PASTE(prefix,name) .text .align 2 -.globl PREFIXED_SYMBOL(SYMBOL_PREFIX,coroutine_transfer) -.type PREFIXED_SYMBOL(SYMBOL_PREFIX,coroutine_transfer), @function -PREFIXED_SYMBOL(SYMBOL_PREFIX,coroutine_transfer): +.globl PREFIXED_SYMBOL(coroutine_transfer) +.type PREFIXED_SYMBOL(coroutine_transfer), @function +PREFIXED_SYMBOL(coroutine_transfer): # Make space on the stack for caller registers addi 1,1,-152 diff --git a/coroutine/riscv64/Context.S b/coroutine/riscv64/Context.S index cc4e872f84..8e7fc74ffc 100644 --- a/coroutine/riscv64/Context.S +++ b/coroutine/riscv64/Context.S @@ -1,11 +1,10 @@ #define TOKEN_PASTE(x,y) x##y -#define PREFIXED_SYMBOL(prefix,name) TOKEN_PASTE(prefix,name) .text .align 2 -.global PREFIXED_SYMBOL(SYMBOL_PREFIX,coroutine_transfer) -PREFIXED_SYMBOL(SYMBOL_PREFIX,coroutine_transfer): +.global PREFIXED_SYMBOL(coroutine_transfer) +PREFIXED_SYMBOL(coroutine_transfer): # Make space on the stack for caller registers addi sp, sp, -0xd0 diff --git a/coroutine/x86/Context.S b/coroutine/x86/Context.S index f06a417084..b04e71aa1c 100644 --- a/coroutine/x86/Context.S +++ b/coroutine/x86/Context.S @@ -6,12 +6,11 @@ ## #define TOKEN_PASTE(x,y) x##y -#define PREFIXED_SYMBOL(prefix,name) TOKEN_PASTE(prefix,name) .text -.globl PREFIXED_SYMBOL(SYMBOL_PREFIX,coroutine_transfer) -PREFIXED_SYMBOL(SYMBOL_PREFIX,coroutine_transfer): +.globl PREFIXED_SYMBOL(coroutine_transfer) +PREFIXED_SYMBOL(coroutine_transfer): # Save caller registers pushl %ebp diff --git a/template/Makefile.in b/template/Makefile.in index 4cc0865ddc..c4e2d6d542 100644 --- a/template/Makefile.in +++ b/template/Makefile.in @@ -452,9 +452,11 @@ gc_impl.$(OBJEXT): gc/$(BUILTIN_GC).c probes.h @$(ECHO) compiling $< $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c $< +PREFIXED_SYMBOL = name +_PREFIXED_SYMBOL = TOKEN_PASTE($(SYMBOL_PREFIX),name) .$(ASMEXT).$(OBJEXT): @$(ECHO) assembling $< - $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -DSYMBOL_PREFIX=$(SYMBOL_PREFIX) -c $< + $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ "-DPREFIXED_SYMBOL(name)=$($(SYMBOL_PREFIX)PREFIXED_SYMBOL)" -c $< .c.$(ASMEXT): @$(ECHO) translating $< |