From 3cc97e66addb3532882679005aeff2acfd3d9f50 Mon Sep 17 00:00:00 2001 From: Rui Paulo Date: Thu, 22 Jul 2010 18:47:41 +0000 Subject: [PATCH] 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 --- sys/conf/kern.mk | 6 ++++-- sys/conf/kern.pre.mk | 6 +++--- 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 55f7d998bc1a..5676057d3d4b 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 b4747f71c9ac..5c22abd48ddd 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 b817b1ba6592..764252061713 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