diff --git a/lib/clang/libclang/Makefile b/lib/clang/libclang/Makefile --- a/lib/clang/libclang/Makefile +++ b/lib/clang/libclang/Makefile @@ -14,6 +14,10 @@ # 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 --- a/lib/clang/liblldb/Makefile +++ b/lib/clang/liblldb/Makefile @@ -10,6 +10,10 @@ 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 --- a/lib/clang/libllvm/Makefile +++ b/lib/clang/libllvm/Makefile @@ -14,6 +14,10 @@ # 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