Page MenuHomeFreeBSD

libllvmminimal: Fix building with LLVM < 21 on riscv64
ClosedPublic

Authored by jrtc27 on Jul 5 2026, 3:57 PM.
Tags
None
Referenced Files
F170574214: D58044.id181374.diff
Sat, Sep 5, 11:36 AM
Unknown Object (File)
Fri, Sep 4, 5:17 PM
Unknown Object (File)
Fri, Sep 4, 3:55 PM
Unknown Object (File)
Fri, Sep 4, 7:25 AM
Unknown Object (File)
Fri, Sep 4, 5:57 AM
Unknown Object (File)
Thu, Sep 3, 9:13 PM
Unknown Object (File)
Thu, Sep 3, 7:52 PM
Unknown Object (File)
Thu, Sep 3, 5:16 PM
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