aboutsummaryrefslogtreecommitdiff
path: root/sys/conf/kern.mk
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-01-28 18:36:33 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-01-28 18:36:33 +0000
commitaccc510ac3c00e86db2eeea29eee57b44731ea02 (patch)
tree5c2eb21e60f14755f5af187db56f48df51e05f31 /sys/conf/kern.mk
parenta45fd13259bf169fd38914b6a277b20baa322e7d (diff)
downloadsrc-accc510ac3c00e86db2eeea29eee57b44731ea02.tar.gz
src-accc510ac3c00e86db2eeea29eee57b44731ea02.zip
Since clang 3.6.0 now implements the archetype 'freebsd_kprintf' for
__attribute__((format(...))), and the -fformat-extensions flag was removed, introduce a new macro in bsd.sys.mk to choose the right variant of compile flag for the used compiler, and use it. Also add something similar to kern.mk, since including bsd.sys.mk from that file will anger Warner. :-) Note that bsd.sys.mk does not support the MK_FORMAT_EXTENSIONS knob used in kern.mk, since that knob is only available in kern.opts.mk, not in src.opts.mk. We might want to add it later, to more easily support external compilers for building world (in particular, sys/boot).
Notes
Notes: svn path=/projects/clang360-import/; revision=277842
Diffstat (limited to 'sys/conf/kern.mk')
-rw-r--r--sys/conf/kern.mk2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk
index b964151437e7..bfc447379a2b 100644
--- a/sys/conf/kern.mk
+++ b/sys/conf/kern.mk
@@ -58,6 +58,8 @@ CWARNEXTRA?= -Wno-uninitialized
# to be disabled. WARNING: format checking is disabled in this case.
.if ${MK_FORMAT_EXTENSIONS} == "no"
FORMAT_EXTENSIONS= -Wno-format
+.elif ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 30600
+FORMAT_EXTENSIONS= -D__printf__=__freebsd_kprintf__
.else
FORMAT_EXTENSIONS= -fformat-extensions
.endif