[builtins] Canonicalize PowerPC detection macros to __powerpc__
authorFangrui Song <i@maskray.me>
Mon, 7 Nov 2022 01:34:04 +0000 (17:34 -0800)
committerFangrui Song <i@maskray.me>
Mon, 7 Nov 2022 01:34:04 +0000 (17:34 -0800)
The lowercase __ppc__ is not defined by Linux GCC, therefore it lures
users to write code which is not portable to GCC. Migrate to __powerpc__ in
preparation for undefining __ppc__. __powerpc__ is much more common than
__PPC__.

compiler-rt/lib/builtins/apple_versioning.c
compiler-rt/lib/builtins/trampoline_setup.c

index f87b428..83d4194 100644 (file)
@@ -138,13 +138,13 @@ NOT_HERE_BEFORE_10_6(__udivti3)
 NOT_HERE_BEFORE_10_6(__umoddi3)
 NOT_HERE_BEFORE_10_6(__umodti3)
 
-#if __ppc__
+#if __powerpc__
 NOT_HERE_BEFORE_10_6(__gcc_qadd)
 NOT_HERE_BEFORE_10_6(__gcc_qdiv)
 NOT_HERE_BEFORE_10_6(__gcc_qmul)
 NOT_HERE_BEFORE_10_6(__gcc_qsub)
 NOT_HERE_BEFORE_10_6(__trampoline_setup)
-#endif // __ppc__
+#endif // __powerpc__
 
 NOT_HERE_IN_10_8_AND_EARLIER(__atomic_compare_exchange)
 NOT_HERE_IN_10_8_AND_EARLIER(__atomic_compare_exchange_1)
index a624317..844eb27 100644 (file)
@@ -16,7 +16,7 @@ extern void __clear_cache(void *start, void *end);
 // which loads r11 with a pointer to the outer function's locals
 // and then jumps to the target nested function.
 
-#if __ppc__ && !defined(__powerpc64__)
+#if __powerpc__ && !defined(__powerpc64__)
 COMPILER_RT_ABI void __trampoline_setup(uint32_t *trampOnStack,
                                         int trampSizeAllocated,
                                         const void *realFunc, void *localsPtr) {
@@ -40,4 +40,4 @@ COMPILER_RT_ABI void __trampoline_setup(uint32_t *trampOnStack,
   // clear instruction cache
   __clear_cache(trampOnStack, &trampOnStack[10]);
 }
-#endif // __ppc__ && !defined(__powerpc64__)
+#endif // __powerpc__ && !defined(__powerpc64__)