summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2012-06-03 20:35:41 +0000
committerdim <dim@FreeBSD.org>2012-06-03 20:35:41 +0000
commita0a31e8b37066f40c455b46339ef12ec8a9ad5e0 (patch)
tree37e981a92a2453b2d59fd54246a225fcf318f59f /share
parentc875946e795a2d59b25dfe0f44ff168c598074d7 (diff)
downloadFreeBSD-src-a0a31e8b37066f40c455b46339ef12ec8a9ad5e0.zip
FreeBSD-src-a0a31e8b37066f40c455b46339ef12ec8a9ad5e0.tar.gz
During buildworld and buildkernel, define EARLY_BUILD in the earlier
stages (build-tools, cross-tools, etc) of the build, so we can detect in bsd.*.mk whether to pass compiler-specific flags to ${CC}. In particular, this commit will allow using WITH_CLANG_IS_CC when the base compiler is still gcc, and when ${CC}, ${CXX} and ${CPP} are left at their defaults. The early stages will then be built using gcc, and no clang-specific flags will be passed to it. The later stages will be built as usual. The EARLY_BUILD define can also serve other uses, such as building the world stage C++ executables with libc++ instead of libstdc++: during the early build stages, we cannot assume libc++ is already available, so we must still build with libstdc++ at that time. MFC after: 1 week
Diffstat (limited to 'share')
-rw-r--r--share/mk/bsd.sys.mk9
1 files changed, 6 insertions, 3 deletions
diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk
index f023750..28c1a18 100644
--- a/share/mk/bsd.sys.mk
+++ b/share/mk/bsd.sys.mk
@@ -61,7 +61,8 @@ CWARNFLAGS+= -Wno-uninitialized
CWARNFLAGS+= -Wno-pointer-sign
# Clang has more warnings enabled by default, and when using -Wall, so if WARNS
# is set to low values, these have to be disabled explicitly.
-.if ${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang"
+.if (${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang") && \
+ !defined(EARLY_BUILD)
.if ${WARNS} <= 6
CWARNFLAGS+= -Wno-empty-body -Wno-string-plus-int
.endif # WARNS <= 6
@@ -88,7 +89,8 @@ WFORMAT= 1
.if ${WFORMAT} > 0
#CWARNFLAGS+= -Wformat-nonliteral -Wformat-security -Wno-format-extra-args
CWARNFLAGS+= -Wformat=2 -Wno-format-extra-args
-.if ${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang"
+.if (${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang") && \
+ !defined(EARLY_BUILD)
.if ${WARNS} <= 3
CWARNFLAGS+= -Wno-format-nonliteral
.endif # WARNS <= 3
@@ -109,7 +111,8 @@ CWARNFLAGS+= -Wno-format
CWARNFLAGS+= -Wno-unknown-pragmas
.endif # IGNORE_PRAGMA
-.if ${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang"
+.if (${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang") && \
+ !defined(EARLY_BUILD)
CLANG_NO_IAS= -no-integrated-as
CLANG_OPT_SMALL= -mstack-alignment=8 -mllvm -inline-threshold=3\
-mllvm -enable-load-pre=false -mllvm -simplifycfg-dup-ret
OpenPOWER on IntegriCloud