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>
This commit is contained in:
Rui Paulo 2010-07-22 18:47:41 +00:00
parent 82040afcf3
commit 3cc97e66ad
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=210384
3 changed files with 8 additions and 6 deletions

View file

@ -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

View file

@ -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

View file

@ -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