This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][compiler-rt] Option to build compiler-rt without FMV support.
ClosedPublic

Authored by ilinpv on Jan 7 2023, 8:41 AM.

Details

Summary

This commit adds compiler-rt cmake option COMPILER_RT_DISABLE_AARCH64_FMV
which, when enabled, doesn't include function multiversioning features
initilization code in 'builtins' build.

Diff Detail

Event Timeline

ilinpv created this revision.Jan 7 2023, 8:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 7 2023, 8:41 AM
ilinpv requested review of this revision.Jan 7 2023, 8:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 7 2023, 8:41 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
smeenai accepted this revision.Jan 7 2023, 10:48 PM

LGTM, thank you!

This revision is now accepted and ready to land.Jan 7 2023, 10:48 PM
abrachet added inline comments.Jan 9 2023, 7:25 AM
compiler-rt/lib/builtins/cpu_model.c
869–870

This was moved after the #ifndef checks for the various defines like AT_HWCAP and HWCAP_ATOMICS which causes the build to fail if these are not defined. I've created D141285 to fix this

Example failure:

[195/255](34) Building C object CMakeFiles/clang_rt.builtins-aarch64.dir/cpu_model.c.o
FAILED: CMakeFiles/clang_rt.builtins-aarch64.dir/cpu_model.c.o 
/b/s/w/ir/cache/goma/client/gomacc /b/s/w/ir/x/w/staging/llvm_build/./bin/clang --target=aarch64-unknown-linux-gnu --sysroot=/b/s/w/ir/x/w/cipd/linux -DHAS_ASM_LSE -DVISIBILITY_HIDDEN  -O3 -DNDEBUG -DCOMPILER_RT_HAS_FLOAT16 -std=c11 -fPIC -fno-builtin -fvisibility=hidden -fomit-frame-pointer -MD -MT CMakeFiles/clang_rt.builtins-aarch64.dir/cpu_model.c.o -MF CMakeFiles/clang_rt.builtins-aarch64.dir/cpu_model.c.o.d -o CMakeFiles/clang_rt.builtins-aarch64.dir/cpu_model.c.o -c /b/s/w/ir/x/w/llvm-llvm-project/compiler-rt/lib/builtins/cpu_model.c
/b/s/w/ir/x/w/llvm-llvm-project/compiler-rt/lib/builtins/cpu_model.c:881:27: error: use of undeclared identifier 'HWCAP_ATOMICS'
  _Bool result = (hwcap & HWCAP_ATOMICS) != 0;
                          ^
1 error generated.