From 4c0dfd5959bd499754e3fc9a7ce37c1d5ece31f7 Mon Sep 17 00:00:00 2001 From: Brooks Davis Date: Fri, 17 May 2024 16:47:22 +0100 Subject: [PATCH] arm: fail early on gcc builds Since at least 2022 (see https://reviews.freebsd.org/D36754), it has not been possible to build armv6/armv7 with gcc due to atomics macros gcc doesn't like. Prevent developers doing due diligance from wasting time and CPU cycles on this combination as it just fails to build in libc. Reviewed by: imp, andrew Differential Revision: https://reviews.freebsd.org/D45193 --- Makefile.inc1 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Makefile.inc1 b/Makefile.inc1 index 0728df1221a0..1bf4212b1d5e 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -172,6 +172,13 @@ LIBCOMPAT_INCLUDE_DIRS+= i386 LIBCOMPAT_INCLUDE_DIRS+= arm .endif +.if ((defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == "gcc") || \ + (!defined(X_COMPILER_TYPE) && ${COMPILER_TYPE} == "gcc")) +.if ${TARGET} == "arm" +.error "armv6/armv7 build are broken with gcc. See https://reviews.freebsd.org/D36754" +.endif +.endif + .if ${.MAKE.OS} != "FreeBSD" CROSSBUILD_HOST=${.MAKE.OS} .if ${.MAKE.OS} != "Linux" && ${.MAKE.OS} != "Darwin"