From d484564cf91380c5652b2400eb03443e1650ec70 Mon Sep 17 00:00:00 2001 From: rpaulo Date: Thu, 22 Jul 2010 18:47:41 +0000 Subject: 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(-) (limited to 'sys/conf') 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 -- cgit v1.1