diff options
author | rmh <rmh@FreeBSD.org> | 2011-10-23 16:27:03 +0000 |
---|---|---|
committer | rmh <rmh@FreeBSD.org> | 2011-10-23 16:27:03 +0000 |
commit | 826b7ad94b28bfd2eab6901334be23f2a3f87206 (patch) | |
tree | db8cfec3807c3dd6c951e25ab93847261c2e38c4 /sys/conf | |
parent | 6762a389b85ca18551064e0c9afb4e709a471fb3 (diff) | |
download | FreeBSD-src-826b7ad94b28bfd2eab6901334be23f2a3f87206.zip FreeBSD-src-826b7ad94b28bfd2eab6901334be23f2a3f87206.tar.gz |
Conditionalize a pair of FreeBSD GCC extensions so that its CFLAGS are only
used with FreeBSD GCC.
Approved by: kib (mentor)
Diffstat (limited to 'sys/conf')
-rw-r--r-- | sys/conf/kern.mk | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index a0a595f..9fc379f 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -1,11 +1,21 @@ # $FreeBSD$ +.if ${CC:T:Mclang} != "clang" +FREEBSD_GCC!= ${CC} --version | grep FreeBSD || true +.endif + # # Warning flags for compiling the kernel and components of the kernel: # +.if ${FREEBSD_GCC} +# FreeBSD extensions, not available in upstream GCC +format_extensions= -fformat-extensions +no_align_long_strings= -mno-align-long-strings +.endif + CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \ -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual \ - -Wundef -Wno-pointer-sign -fformat-extensions \ + -Wundef -Wno-pointer-sign ${format_extensions} \ -Wmissing-include-dirs -fdiagnostics-show-option # # The following flags are next up for working on: @@ -32,7 +42,7 @@ CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \ # .if ${MACHINE_CPUARCH} == "i386" .if ${CC:T:Mclang} != "clang" -CFLAGS+= -mno-align-long-strings -mpreferred-stack-boundary=2 -mno-sse +CFLAGS+= ${no_align_long_strings} -mpreferred-stack-boundary=2 -mno-sse .else CFLAGS+= -mno-aes -mno-avx .endif |