#56854 shows a backwards compatibility problem when builtins of compiler-rt don't follow ABI. We need to prevent to fall into the trap again for BF16.
bkramer t.p.northover FreddyYe
- rGf061cfb31730: [compiler-rt][BF16] Provide __truncdfbf2 and __truncsfbf2 only when __bf16 is…
rG0729d00135cc: Reland "[compiler-rt][BF16] Provide __truncsfbf2 only when __bf16 is available"
rGab4e5ed441d4: Reland "[compiler-rt][BF16] Provide __truncsfbf2 only when __bf16 is available"
rG0ae2a41d803d: [compiler-rt][BF16] Provide __truncsfbf2 only when __bf16 is available
Thank! I have found some clues in the log:
[1104/4435] Building C object CMakeFiles/clang_rt.builtins_x86_64_iossim.dir/truncdfbf2.c.o ... ... [1168/4435] Building C object CMakeFiles/clang_rt.builtins_armv7_ios.dir/truncdfbf2.c.o FAILED: CMakeFiles/clang_rt.builtins_armv7_ios.dir/truncdfbf2.c.o /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/./bin/clang --target=x86_64-apple-darwin19.5.0 -O3 -DNDEBUG -arch armv7 -isysroot ...
So the X86 runtimes are built successfully as expected. The problem is we are building armv7 target using the same cmake configure generated for X86 which enabled -DCOMPILER_RT_HAS_BFLOAT16. Let me think about how to solve the problem. But I wonder if it is also a problem for the buildbot?
Do not compile truncdfbf2.c and truncsfbf2.c if __bf16 is not supported.
This solves buildbot error "error: ISO C requires a translation unit to contain at least one declaration [-Werror,-Wempty-translation-unit]"