git: 560cf46476e0 - stable/15 - libllvmminimal: Fix building with LLVM < 21 on riscv64

Jessica Clarke <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.src,gmane.os.freebsd.devel.stable.scm
Message-ID <[email protected]>
The branch stable/15 has been updated by jrtc27:

URL: https://cgit.FreeBSD.org/src/commit/?id=560cf46476e0538f75e8aea4d2ab3a8291dc3e1f

commit 560cf46476e0538f75e8aea4d2ab3a8291dc3e1f
Author:     Jessica Clarke <[email protected]>
AuthorDate: 2026-07-06 16:25:48 +0000
Commit:     Jessica Clarke <[email protected]>
CommitDate: 2026-08-06 18:02:04 +0000

    libllvmminimal: Fix building with LLVM < 21 on riscv64
    
    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.
    
    Reviewed by:    dim, emaste
    Fixes:          770cf0a5f02d ("Fixups after llvm-project main llvmorg-21-init-19288-gface93e724f4 merge")
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D58044
    
    (cherry picked from commit 7a0b9e30a5ba07066caffba51fa82ca3782a5da1)
---
 lib/clang/libllvmminimal/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/clang/libllvmminimal/Makefile b/lib/clang/libllvmminimal/Makefile
index f54974c2d2ca..eaa6a670294d 100644
--- a/lib/clang/libllvmminimal/Makefile
+++ b/lib/clang/libllvmminimal/Makefile
@@ -6,7 +6,7 @@ INTERNALLIB=
 
 SRCDIR=		llvm/lib
 SRCS+=		Demangle/ItaniumDemangle.cpp
-#SRCS+=		Support/ABIBreak.cpp
+SRCS+=		Support/ABIBreak.cpp
 SRCS+=		Support/APFloat.cpp
 SRCS+=		Support/APInt.cpp
 #SRCS+=		Support/Atomic.cpp
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.