On 9 Feb 2026, at 16:28, John Baldwin <[email protected]> wrote: > > The branch main has been updated by jhb: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=ee73475119ff7aa98bd11828625d524f6ab87f06 > > commit ee73475119ff7aa98bd11828625d524f6ab87f06 > Author: John Baldwin <[email protected]> > AuthorDate: 2026-02-09 16:26:52 +0000 > Commit: John Baldwin <[email protected]> > CommitDate: 2026-02-09 16:26:52 +0000 > > llvm: Link private LLVM libraries against compiler_rt for aarch64 > > This is required for GCC which uses libcalls for outlined atomics.
This doesn’t seem right, they’re provided by libgcc.a, so why aren’t they being pulled in? libcompiler_rt.a doesn’t even have the symbols. Jessica > Reviewed by: dim > Differential Revision: https://reviews.freebsd.org/D55157 > --- > lib/clang/libclang/Makefile | 4 ++++ > lib/clang/liblldb/Makefile | 4 ++++ > lib/clang/libllvm/Makefile | 4 ++++ > 3 files changed, 12 insertions(+) > > diff --git a/lib/clang/libclang/Makefile b/lib/clang/libclang/Makefile > index 56f6fd374fe5..1b24d5cbf4cf 100644 > --- a/lib/clang/libclang/Makefile > +++ b/lib/clang/libclang/Makefile > @@ -14,6 +14,10 @@ PRIVATELIB= > # Work around "relocation R_PPC_GOT16 out of range" errors > PICFLAG= -fPIC > .endif > +.if ${MACHINE_CPUARCH} == "aarch64" > +# Only required for GCC > +LIBADD+= compiler_rt > +.endif > .endif > > SHARED_CXXFLAGS+= -UPIC # To avoid compile errors > diff --git a/lib/clang/liblldb/Makefile b/lib/clang/liblldb/Makefile > index aa9e90b2f6f2..b2da21c2990e 100644 > --- a/lib/clang/liblldb/Makefile > +++ b/lib/clang/liblldb/Makefile > @@ -10,6 +10,10 @@ PACKAGE= lldb > SHLIB_CXX= lldb > SHLIB_MAJOR= 19 > PRIVATELIB= > +.if ${MACHINE_CPUARCH} == "aarch64" > +# Only required for GCC > +LIBADD+= compiler_rt > +.endif > .endif > > SHARED_CXXFLAGS+= -UPIC # To avoid compile errors > diff --git a/lib/clang/libllvm/Makefile b/lib/clang/libllvm/Makefile > index 05128550827a..9b2a272d2c67 100644 > --- a/lib/clang/libllvm/Makefile > +++ b/lib/clang/libllvm/Makefile > @@ -14,6 +14,10 @@ PRIVATELIB= > # Work around "relocation R_PPC_GOT16 out of range" errors > PICFLAG= -fPIC > .endif > +.if ${MACHINE_CPUARCH} == "aarch64" > +# Only required for GCC > +LIBADD+= compiler_rt > +.endif > CFLAGS+= -DLLVM_BUILD_LLVM_DYLIB > .endif > >
