summaryrefslogtreecommitdiffstats
path: root/sys/conf
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2015-01-05 12:28:22 +0000
committerimp <imp@FreeBSD.org>2015-01-05 12:28:22 +0000
commit2c0af1c89755a8fe945b4e1746f37c1fa2a87439 (patch)
tree7d5f53ed6c06720d9d9f32e3b8dd14d5c4d77b6c /sys/conf
parent47d4a0fc0c187c95706f48032f8a97325b9c056a (diff)
downloadFreeBSD-src-2c0af1c89755a8fe945b4e1746f37c1fa2a87439.zip
FreeBSD-src-2c0af1c89755a8fe945b4e1746f37c1fa2a87439.tar.gz
Clang's 3.5 integrated assembler now handles these files correctly (it
has support for the .codeXX directives). However, it is desirable, for a time, to allow kernels to be built with clang 3.4. Historically, it has been advantageous to allow stable X-1 to build kernels the old way (so long as the impact of doing so is small), and this restores that ability. Also, centralize the addition of ${ASM_CFLAGS.${.IMPSRC}}, place it in kern.mk rather than kern.pre.mk so that all modules can benefit, and give the same treatment to CFLAGS in kern.mk as well.
Diffstat (limited to 'sys/conf')
-rw-r--r--sys/conf/Makefile.amd643
-rw-r--r--sys/conf/Makefile.i3863
-rw-r--r--sys/conf/Makefile.pc982
-rw-r--r--sys/conf/kern.mk15
-rw-r--r--sys/conf/kern.pre.mk8
5 files changed, 18 insertions, 13 deletions
diff --git a/sys/conf/Makefile.amd64 b/sys/conf/Makefile.amd64
index d34359f..696ef55 100644
--- a/sys/conf/Makefile.amd64
+++ b/sys/conf/Makefile.amd64
@@ -37,6 +37,9 @@ INCLUDES+= -I$S/contrib/libfdt
CFLAGS+= -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer
.endif
+ASM_CFLAGS.acpi_wakecode.S= ${CLANG_NO_IAS34}
+ASM_CFLAGS.mpboot.S= ${CLANG_NO_IAS34}
+
%BEFORE_DEPEND
%OBJS
diff --git a/sys/conf/Makefile.i386 b/sys/conf/Makefile.i386
index 621ebff..6b1eca4 100644
--- a/sys/conf/Makefile.i386
+++ b/sys/conf/Makefile.i386
@@ -32,6 +32,9 @@ S= ../../..
INCLUDES+= -I$S/contrib/libfdt
+ASM_CFLAGS.acpi_wakecode.S= ${CLANG_NO_IAS34}
+ASM_CFLAGS.mpboot.s= ${CLANG_NO_IAS34}
+
%BEFORE_DEPEND
%OBJS
diff --git a/sys/conf/Makefile.pc98 b/sys/conf/Makefile.pc98
index 28d0956..9d0f25b 100644
--- a/sys/conf/Makefile.pc98
+++ b/sys/conf/Makefile.pc98
@@ -30,6 +30,8 @@ S= ../../..
.endif
.include "$S/conf/kern.pre.mk"
+ASM_CFLAGS.mpboot.s= ${CLANG_NO_IAS34}
+
%BEFORE_DEPEND
%OBJS
diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk
index 3cf3d94..157f5b5 100644
--- a/sys/conf/kern.mk
+++ b/sys/conf/kern.mk
@@ -29,9 +29,16 @@ NO_WSOMETIMES_UNINITIALIZED= -Wno-error-sometimes-uninitialized
CWARNEXTRA?= -Wno-error-tautological-compare -Wno-error-empty-body \
-Wno-error-parentheses-equality -Wno-error-unused-function \
-Wno-error-pointer-sign -Wno-error-format -Wno-error-parentheses
+
+CLANG_NO_IAS= -no-integrated-as
+.if ${COMPILER_VERSION} < 30500
+# XXX: clang < 3.5 integrated-as doesn't grok .codeNN directives
+CLANG_NO_IAS34= -no-integrated-as
+.endif
.endif
.if ${COMPILER_TYPE} == "gcc"
+GCC_MS_EXTENSIONS= -fms-extensions
.if ${COMPILER_VERSION} >= 40300
# Catch-all for all the things that are in our tree, but for which we're
# not yet ready for this compiler. Note: we likely only really "support"
@@ -168,9 +175,8 @@ CFLAGS+= -fstack-protector
CFLAGS+= -gdwarf-2
.endif
-CFLAGS+= ${CWARNEXTRA}
-
-CFLAGS+= ${CFLAGS.${COMPILER_TYPE}}
+CFLAGS+= ${CWARNEXTRA} ${CWARNFLAGS} ${CWARNFLAGS.${.IMPSRC:T}}
+CFLAGS+= ${CFLAGS.${COMPILER_TYPE}} ${CFLAGS.${.IMPSRC}}
# Tell bmake not to mistake standard targets for things to be searched for
# or expect to ever be up-to-date.
@@ -199,6 +205,3 @@ CFLAGS+= -std=iso9899:1999
.else # CSTD
CFLAGS+= -std=${CSTD}
.endif # CSTD
-
-# Pull in any CWARNFLAGS the modules have added.
-CFLAGS+= ${CWARNFLAGS} ${CWARNFLAGS.${.IMPSRC:T}}
diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk
index 21a4290..48982c5 100644
--- a/sys/conf/kern.pre.mk
+++ b/sys/conf/kern.pre.mk
@@ -103,13 +103,7 @@ CFLAGS.gcc+=${CFLAGS_ARCH_PARAMS}
WERROR?= -Werror
# XXX LOCORE means "don't declare C stuff" not "for locore.s".
-ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${CFLAGS}
-
-.if ${COMPILER_TYPE} == "clang"
-CLANG_NO_IAS= -no-integrated-as
-.else
-GCC_MS_EXTENSIONS= -fms-extensions
-.endif
+ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${CFLAGS} ${ASM_CFLAGS.${.IMPSRC}}
.if defined(PROFLEVEL) && ${PROFLEVEL} >= 1
CFLAGS+= -DGPROF
OpenPOWER on IntegriCloud