[flang-commits] [compiler-rt] [lld] [lldb] [llvm] [clang] [flang] [mlir] [libcxx] [builtins] Refactor cpu_model support to reduce #if nesting. NFCI (PR #75635)

Arthur Eubanks via flang-commits flang-commits at lists.llvm.org
Tue Dec 19 16:38:12 PST 2023


aeubanks wrote:

still seeing Android errors
```
 [275/404] Building C object CMakeFiles/clang_rt.builtins-aarch64.dir/cpu_model/aarch64.c.o
 FAILED: CMakeFiles/clang_rt.builtins-aarch64.dir/cpu_model/aarch64.c.o 
 /b/s/w/ir/cache/builder/src/third_party/llvm-build/Release+Asserts/./bin/clang --target=aarch64-linux-android21 --sysroot=/b/s/w/ir/cache/builder/src/third_party/llvm-build-tools/debian_bullseye_amd64_sysroot -DHAS_ASM_LSE -DVISIBILITY_HIDDEN  --sysroot=/b/s/w/ir/cache/builder/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --unwindlib=none -mbranch-protection=standard -O2 -g -DNDEBUG -fno-lto -std=c11 -fPIC -fno-builtin -fvisibility=hidden -fomit-frame-pointer -DCOMPILER_RT_HAS_FLOAT16 -MD -MT CMakeFiles/clang_rt.builtins-aarch64.dir/cpu_model/aarch64.c.o -MF CMakeFiles/clang_rt.builtins-aarch64.dir/cpu_model/aarch64.c.o.d -o CMakeFiles/clang_rt.builtins-aarch64.dir/cpu_model/aarch64.c.o -c /b/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/lib/builtins/cpu_model/aarch64.c
 clang: warning: argument unused during compilation: '--unwindlib=none' [-Wunused-command-line-argument]
 In file included from /b/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/lib/builtins/cpu_model/aarch64.c:41:
 /b/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/lib/builtins/cpu_model/aarch64/lse_atomics/android.inc:6:3: error: void function '__isExynos9810' should not return a value [-Wreturn-type]
     6 |   return __system_property_get("ro.arch", arch) > 0 &&
       |   ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     7 |     strncmp(arch, "exynos9810", sizeof("exynos9810") - 1) == 0;
       |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 /b/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/lib/builtins/cpu_model/aarch64/lse_atomics/android.inc:11:25: error: call to undeclared function 'getauxval'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    11 |   unsigned long hwcap = getauxval(AT_HWCAP);
       |                         ^
 /b/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/lib/builtins/cpu_model/aarch64/lse_atomics/android.inc:11:35: error: use of undeclared identifier 'AT_HWCAP'
    11 |   unsigned long hwcap = getauxval(AT_HWCAP);
       |                                   ^
 /b/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/lib/builtins/cpu_model/aarch64/lse_atomics/android.inc:12:27: error: use of undeclared identifier 'HWCAP_ATOMICS'
    12 |   _Bool result = (hwcap & HWCAP_ATOMICS) != 0;
       |                           ^
 /b/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/lib/builtins/cpu_model/aarch64/lse_atomics/android.inc:23:5: error: statement requires expression of scalar type ('void' invalid)
    23 |     if (__isExynos9810())
       |     ^   ~~~~~~~~~~~~~~~~
 In file included from /b/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/lib/builtins/cpu_model/aarch64.c:135:
 In file included from /b/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/lib/builtins/cpu_model/aarch64/fmv/mrs.inc:2:
 /b/s/w/ir/cache/builder/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/sys/auxv.h:53:19: error: conflicting types for 'getauxval'
    53 | unsigned long int getauxval(unsigned long int __type) __INTRODUCED_IN(18);
       |                   ^
 /b/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/lib/builtins/cpu_model/aarch64/lse_atomics/android.inc:11:25: note: previous implicit declaration is here
    11 |   unsigned long hwcap = getauxval(AT_HWCAP);
       |                         ^
 In file included from /b/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/lib/builtins/cpu_model/aarch64.c:136:
 /b/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/lib/builtins/cpu_model/aarch64/fmv/android.inc:25:3: error: statement requires expression of scalar type ('void' invalid)
    25 |   if (__isExynos9810())
       |   ^   ~~~~~~~~~~~~~~~~
 7 errors generated.
```


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


More information about the flang-commits mailing list