From b347c22846038a070ea576e904771178acf5a302 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Fri, 21 Apr 2023 15:06:51 -0700 Subject: [PATCH] cross-build: Add common compatibility headers after OS-specific ones The current order is rather counter-intuitive and it appears to work fine if we swap the order. Pull Request: https://github.com/freebsd/freebsd-src/pull/725 Reviewed by: imp --- tools/build/mk/Makefile.boot | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/build/mk/Makefile.boot b/tools/build/mk/Makefile.boot index 138dff45930b..3bbb183021b2 100644 --- a/tools/build/mk/Makefile.boot +++ b/tools/build/mk/Makefile.boot @@ -35,7 +35,6 @@ LIBZ:=${WORLDTMP}/legacy/usr/lib/libz.a CFLAGS+= -Werror=implicit-function-declaration -Werror=implicit-int \ -Werror=return-type -Wundef CFLAGS+= -DHAVE_NBTOOL_CONFIG_H=1 -CFLAGS+= -I${SRCTOP}/tools/build/cross-build/include/common # This is needed for code that compiles for pre-C11 C standards CWARNFLAGS.clang+=-Wno-typedef-redefinition # bsd.sys.mk explicitly turns on -Wsystem-headers, but that's extremely @@ -69,6 +68,11 @@ CFLAGS+= -idirafter ${SRCTOP}/contrib/libarchive/libarchive .endif .endif # ${.MAKE.OS} != "FreeBSD" +.if ${.MAKE.OS} != "FreeBSD" +# Add the common compatibility headers after the OS-specific ones. +CFLAGS+= -I${SRCTOP}/tools/build/cross-build/include/common +.endif + # we do not want to capture dependencies referring to the above UPDATE_DEPENDFILE= no