diff --git a/libc/cmake/modules/LLVMLibCCheckCpuFeatures.cmake b/libc/cmake/modules/LLVMLibCCheckCpuFeatures.cmake --- a/libc/cmake/modules/LLVMLibCCheckCpuFeatures.cmake +++ b/libc/cmake/modules/LLVMLibCCheckCpuFeatures.cmake @@ -7,7 +7,7 @@ if(${LIBC_TARGET_ARCHITECTURE_IS_X86}) set(ALL_CPU_FEATURES SSE2 SSE4_2 AVX2 AVX512F) - set(LIBC_COMPILE_OPTIONS_NATIVE -march=native) + # set(LIBC_COMPILE_OPTIONS_NATIVE -march=native) elseif(${LIBC_TARGET_ARCHITECTURE_IS_AARCH64}) set(LIBC_COMPILE_OPTIONS_NATIVE -mcpu=native) endif() diff --git a/libc/config/linux/arm/entrypoints.txt b/libc/config/linux/arm/entrypoints.txt new file mode 100644 --- /dev/null +++ b/libc/config/linux/arm/entrypoints.txt @@ -0,0 +1,86 @@ +set(TARGET_LIBC_ENTRYPOINTS + # ctype.h entrypoints + libc.src.ctype.isalnum + libc.src.ctype.isalpha + libc.src.ctype.isascii + libc.src.ctype.isblank + libc.src.ctype.iscntrl + libc.src.ctype.isdigit + libc.src.ctype.isgraph + libc.src.ctype.islower + libc.src.ctype.isprint + libc.src.ctype.ispunct + libc.src.ctype.isspace + libc.src.ctype.isupper + libc.src.ctype.isxdigit + libc.src.ctype.toascii + libc.src.ctype.tolower + libc.src.ctype.toupper + + # string.h entrypoints + libc.src.string.bcmp + libc.src.string.bzero + libc.src.string.memccpy + libc.src.string.memchr + libc.src.string.memcmp + libc.src.string.memcpy + libc.src.string.memmove + libc.src.string.mempcpy + libc.src.string.memrchr + libc.src.string.memset + libc.src.string.stpcpy + libc.src.string.stpncpy + libc.src.string.strcat + libc.src.string.strchr + libc.src.string.strcmp + libc.src.string.strcpy + libc.src.string.strcspn + libc.src.string.strlen + libc.src.string.strncat + libc.src.string.strncmp + libc.src.string.strncpy + libc.src.string.strnlen + libc.src.string.strpbrk + libc.src.string.strrchr + libc.src.string.strspn + libc.src.string.strstr + libc.src.string.strtok + libc.src.string.strtok_r + + # inttypes.h entrypoints + libc.src.inttypes.imaxdiv + + # stdlib.h entrypoints + libc.src.stdlib.abs + libc.src.stdlib.bsearch + libc.src.stdlib.div + libc.src.stdlib.labs + libc.src.stdlib.ldiv + libc.src.stdlib.llabs + libc.src.stdlib.lldiv + libc.src.stdlib.qsort +) + +set(TARGET_LIBM_ENTRYPOINTS + # math.h entrypoints + libc.src.math.cosf + libc.src.math.fabs + libc.src.math.fabsf + libc.src.math.fabsl + libc.src.math.fdim + libc.src.math.fdimf + libc.src.math.fdiml + libc.src.math.fmax + libc.src.math.fmaxf + libc.src.math.fmaxl + libc.src.math.fmin + libc.src.math.fminf + libc.src.math.fminl + libc.src.math.sincosf + libc.src.math.sinf +) + +set(TARGET_LLVMLIBC_ENTRYPOINTS + ${TARGET_LIBC_ENTRYPOINTS} + ${TARGET_LIBM_ENTRYPOINTS} +) diff --git a/libc/config/linux/arm/headers.txt b/libc/config/linux/arm/headers.txt new file mode 100644 --- /dev/null +++ b/libc/config/linux/arm/headers.txt @@ -0,0 +1,9 @@ +set(TARGET_PUBLIC_HEADERS + libc.include.ctype + libc.include.errno + libc.include.fenv + libc.include.inttypes + libc.include.math + libc.include.stdlib + libc.include.string +) diff --git a/libc/src/__support/CPP/TypeTraits.h b/libc/src/__support/CPP/TypeTraits.h --- a/libc/src/__support/CPP/TypeTraits.h +++ b/libc/src/__support/CPP/TypeTraits.h @@ -49,8 +49,11 @@ IsSameV || IsSameV || IsSameV || IsSameV || IsSameV || IsSameV || - IsSameV || IsSameV || - IsSameV<__uint128_t, TypeNoCV> || IsSameV<__int128_t, TypeNoCV>; + IsSameV || IsSameV +#ifdef __SIZEOF_INT128__ + || IsSameV<__uint128_t, TypeNoCV> || IsSameV<__int128_t, TypeNoCV> +#endif // __uint128_t + ; }; template struct IsPointerTypeNoCV : public FalseValue {}; diff --git a/libc/src/__support/FPUtil/FloatProperties.h b/libc/src/__support/FPUtil/FloatProperties.h --- a/libc/src/__support/FPUtil/FloatProperties.h +++ b/libc/src/__support/FPUtil/FloatProperties.h @@ -59,6 +59,10 @@ static constexpr BitsType QUIET_NAN_MASK = 0x0008000000000000ULL; }; +// I don't know if this is true on ARM32, but otherwise it tries to use +// uint128 and that doesn't work. +#define LONG_DOUBLE_IS_DOUBLE 1 + #if defined(LONG_DOUBLE_IS_DOUBLE) // Properties for numbers represented in 64 bits long double on Windows // platform. diff --git a/libc/src/string/memory_utils/utils.h b/libc/src/string/memory_utils/utils.h --- a/libc/src/string/memory_utils/utils.h +++ b/libc/src/string/memory_utils/utils.h @@ -17,6 +17,8 @@ // time. #if defined(LLVM_LIBC_ARCH_AARCH64) || defined(LLVM_LIBC_ARCH_X86) #define LLVM_LIBC_CACHELINE_SIZE 64 +#elif defined(LLVM_LIBC_ARCH_ARM) +#define LLVM_LIBC_CACHELINE_SIZE 32 // This number is just a guess. #else #error "Unsupported platform for memory functions." #endif diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake --- a/llvm/cmake/config-ix.cmake +++ b/llvm/cmake/config-ix.cmake @@ -371,7 +371,7 @@ # Define LLVM_HAS_ATOMICS if gcc or MSVC atomic builtins are supported. -include(CheckAtomic) +# include(CheckAtomic) if( LLVM_ENABLE_PIC ) set(ENABLE_PIC 1)