Index: lib/libcompiler_rt/Makefile.inc =================================================================== --- lib/libcompiler_rt/Makefile.inc +++ lib/libcompiler_rt/Makefile.inc @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + CRTARCH= ${MACHINE_CPUARCH:C/amd64/x86_64/} CRTSRC= ${SRCTOP}/contrib/llvm-project/compiler-rt/lib/builtins @@ -18,6 +20,9 @@ SRCF+= ashlti3 SRCF+= ashrdi3 SRCF+= ashrti3 +SRCF+= atomic +SRCF+= bswapdi2 +SRCF+= bswapsi2 SRCF+= clear_cache SRCF+= clzdi2 SRCF+= clzsi2 @@ -121,6 +126,10 @@ SRCF+= umodsi3 SRCF+= umodti3 +.if "${COMPILER_TYPE}" == "clang" +CFLAGS.atomic.c+= -Wno-atomic-alignment +.endif + # Avoid using SSE2 instructions on i386, if unsupported. .if ${MACHINE_CPUARCH} == "i386" && empty(MACHINE_CPU:Msse2) SRCS+= floatdidf.c @@ -213,12 +222,6 @@ SRCF+= stdatomic .endif -.if "${COMPILER_TYPE}" == "clang" && \ - (${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpcspe") -SRCS+= atomic.c -CFLAGS.atomic.c+= -Wno-atomic-alignment -.endif - .for file in ${SRCF} .if ${MACHINE_ARCH:Marmv[67]*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") \ && exists(${CRTSRC}/${CRTARCH}/${file}vfp.S) @@ -240,19 +243,11 @@ SRCS+= aeabi_memset.S SRCS+= aeabi_uidivmod.S SRCS+= aeabi_uldivmod.S -SRCS+= bswapdi2.S -SRCS+= bswapsi2.S SRCS+= switch16.S SRCS+= switch32.S SRCS+= switch8.S SRCS+= switchu8.S SRCS+= sync_synchronize.S -.endif - -# On some archs GCC-6.3 requires bswap32 built-in. -.if ${MACHINE_CPUARCH} == "mips" || ${MACHINE_CPUARCH} == "riscv" -SRCS+= bswapdi2.c -SRCS+= bswapsi2.c .endif .if ${MACHINE_ARCH:Mriscv*sf}