#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.
Details
- Reviewers
bkramer t.p.northover FreddyYe - Commits
- 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
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Works for me. This will still have the 32 bit x86 problem we're seeing on FreeBSD though.
@pengfei This patch broke the macOS bot : https://green.lab.llvm.org/green/job/lldb-cmake/45984/
Thanks @mib for the information. It's odd. The reland patch should have solved the problem. I'll keep watching on the following build results. Thanks!
The failure seems also to be happening with the reland patch (ab4e5ed441d475ead43bc4ce1cdef842688292f4), so I reverted it. Let me know if you need help reproducing the issue :)
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]"