diff options
author | rpaulo <rpaulo@FreeBSD.org> | 2010-07-22 18:47:41 +0000 |
---|---|---|
committer | rpaulo <rpaulo@FreeBSD.org> | 2010-07-22 18:47:41 +0000 |
commit | d484564cf91380c5652b2400eb03443e1650ec70 (patch) | |
tree | 16fbc4bc2e5cafd76cfeaf6dcec6949da82be2bd /sys/conf | |
parent | 9fdab3dd154ee91e1d08bbea36e9c641cb1925bd (diff) | |
download | FreeBSD-src-d484564cf91380c5652b2400eb03443e1650ec70.zip FreeBSD-src-d484564cf91380c5652b2400eb03443e1650ec70.tar.gz |
Handle a few corner cases for clang like we did with icc. These should
reduce the number of warnings seen while building the kernel.
Submitted by: Dimitry Andric <dimitry at andric.com>
Diffstat (limited to 'sys/conf')
-rw-r--r-- | sys/conf/kern.mk | 6 | ||||
-rw-r--r-- | sys/conf/kern.pre.mk | 6 | ||||
-rw-r--r-- | sys/conf/kmod.mk | 2 |
3 files changed, 8 insertions, 6 deletions
diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index 55f7d99..5676057 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -30,8 +30,10 @@ CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \ # reserved for user applications. # .if ${MACHINE_ARCH} == "i386" && ${CC} != "icc" -CFLAGS+= -mno-align-long-strings -mpreferred-stack-boundary=2 \ - -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 +.if ${CC} != "clang" +CFLAGS+= -mno-align-long-strings -mpreferred-stack-boundary=2 +.endif +CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 INLINE_LIMIT?= 8000 .endif diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk index b4747f7..5c22abd 100644 --- a/sys/conf/kern.pre.mk +++ b/sys/conf/kern.pre.mk @@ -92,7 +92,7 @@ INCLUDES+= -I$S/dev/cxgb CFLAGS= ${COPTFLAGS} ${C_DIALECT} ${DEBUG} ${CWARNFLAGS} CFLAGS+= ${INCLUDES} -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -.if ${CC} != "icc" +.if ${CC} != "icc" && ${CC} != "clang" CFLAGS+= -fno-common -finline-limit=${INLINE_LIMIT} .if ${MACHINE_CPUARCH} != "mips" CFLAGS+= --param inline-unit-growth=100 @@ -109,8 +109,8 @@ WERROR?= -Werror ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${CFLAGS} .if defined(PROFLEVEL) && ${PROFLEVEL} >= 1 -.if ${CC} == "icc" -.error "Profiling doesn't work with icc yet" +.if ${CC} == "icc" || ${CC} == "clang" +.error "Profiling doesn't work with icc or clang yet" .endif CFLAGS+= -DGPROF -falign-functions=16 .if ${PROFLEVEL} >= 2 diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk index b817b1b..7642520 100644 --- a/sys/conf/kmod.mk +++ b/sys/conf/kmod.mk @@ -114,7 +114,7 @@ CFLAGS+= -I. -I@ # for example. CFLAGS+= -I@/contrib/altq -.if ${CC} != "icc" +.if ${CC} != "icc" && ${CC} != "clang" CFLAGS+= -finline-limit=${INLINE_LIMIT} CFLAGS+= --param inline-unit-growth=100 CFLAGS+= --param large-function-growth=1000 |