[compiler-rt] [ARM][Compiler-RT] Add optional exclusion of libc provided ARM AEABI builtins from compiler-rt. (PR #137952)

Peter Smith via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 30 06:07:56 PDT 2025


================
@@ -450,25 +453,45 @@ set(thumb1_base_SOURCES
   ${GENERIC_SOURCES}
 )
 
-set(arm_EABI_SOURCES
-  arm/aeabi_cdcmp.S
-  arm/aeabi_cdcmpeq_check_nan.c
-  arm/aeabi_cfcmp.S
-  arm/aeabi_cfcmpeq_check_nan.c
-  arm/aeabi_dcmp.S
-  arm/aeabi_div0.c
-  arm/aeabi_drsub.c
-  arm/aeabi_fcmp.S
-  arm/aeabi_frsub.c
-  arm/aeabi_idivmod.S
-  arm/aeabi_ldivmod.S
-  arm/aeabi_memcmp.S
-  arm/aeabi_memcpy.S
-  arm/aeabi_memmove.S
-  arm/aeabi_memset.S
-  arm/aeabi_uidivmod.S
-  arm/aeabi_uldivmod.S
-)
+if(NOT COMPILER_RT_EXCLUDE_LIBC_PROVIDED_ARM_AEABI_BUILTINS)
+  set(arm_EABI_SOURCES
+     arm/aeabi_cdcmp.S
+     arm/aeabi_cdcmpeq_check_nan.c
+     arm/aeabi_cfcmp.S
+     arm/aeabi_cfcmpeq_check_nan.c
+     arm/aeabi_dcmp.S
+     arm/aeabi_div0.c
+     arm/aeabi_drsub.c
+     arm/aeabi_fcmp.S
+     arm/aeabi_frsub.c
+     arm/aeabi_idivmod.S
+     arm/aeabi_ldivmod.S
+     arm/aeabi_memcmp.S
----------------
smithp35 wrote:

arm/aeabi_memcmp.S is interesting as there is no libcall to it, gcc and libgcc doesn't define it, and it isn't in https://github.com/ARM-software/abi-aa/blob/main/rtabi32/rtabi32.rst could have been added by mistake, or it could have been added for legacy purposes. 

In any case I would put it with the other C library defined functions as logically that's were it belongs. Given that neither clang nor gcc will call it, I don't think it matters that it wouldn't be present if `COMPILER_RT_EXCLUDE_LIBC_PROVIDED_ARM_AEABI_BUILTINS`


https://github.com/llvm/llvm-project/pull/137952


More information about the llvm-commits mailing list