Page MenuHomeFreeBSD

libllvmminimal: Fix building with LLVM < 21 on riscv64
ClosedPublic

Authored by jrtc27 on Sun, Jul 5, 3:57 PM.
Tags
None
Referenced Files
F162738986: D58044.id.diff
Thu, Jul 16, 9:02 AM
Unknown Object (File)
Thu, Jul 16, 3:36 AM
Unknown Object (File)
Thu, Jul 16, 12:18 AM
Unknown Object (File)
Wed, Jul 15, 7:29 AM
Unknown Object (File)
Wed, Jul 15, 7:29 AM
Unknown Object (File)
Tue, Jul 14, 1:22 PM
Unknown Object (File)
Tue, Jul 14, 1:01 PM
Unknown Object (File)
Mon, Jul 13, 8:55 AM
Subscribers

Details

Summary

On most architectures we end up not needing ABIBreak.cpp as, although
some of the sources here do reference EnableABIBreakingChecks (or, if
assertions are disabled, DisableABIBreakingChecks) at a source level, we
compile with -ffunction-sections and -fdata-sections, and link with
--gc-sections, and it happens to be the case that all references can be
GC'ed. However, prior to LLVM 21, the RISC-V backend did not apply
-fdata-sections to .sdata, where references to these symbols end up, and
for some files we're building with such references we end up not being
able to GC .sdata due to the other unrelated data in it, meaning that we
do in fact need to build ABIBreak.cpp.

Whilst we could make this conditional on the architecture, it's a tiny
file, and it's a bit fragile to rely on GC behaviour, so just include it
unconditionally.

Fixes: 770cf0a5f02d ("Fixups after llvm-project main llvmorg-21-init-19288-gface93e724f4 merge")
MFC after: 1 week

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 74528
Build 71411: arc lint + arc unit