Author: rpaulo
Date: Thu Jul 22 18:47:41 2010
New Revision: 210384
URL: http://svn.freebsd.org/changeset/base/210384

Log:
  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>

Modified:
  head/sys/conf/kern.mk
  head/sys/conf/kern.pre.mk
  head/sys/conf/kmod.mk

Modified: head/sys/conf/kern.mk
==============================================================================
--- head/sys/conf/kern.mk       Thu Jul 22 18:44:40 2010        (r210383)
+++ head/sys/conf/kern.mk       Thu Jul 22 18:47:41 2010        (r210384)
@@ -30,8 +30,10 @@ CWARNFLAGS?= -Wall -Wredundant-decls -Wn
 # 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
 

Modified: head/sys/conf/kern.pre.mk
==============================================================================
--- head/sys/conf/kern.pre.mk   Thu Jul 22 18:44:40 2010        (r210383)
+++ head/sys/conf/kern.pre.mk   Thu Jul 22 18:47:41 2010        (r210384)
@@ -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

Modified: head/sys/conf/kmod.mk
==============================================================================
--- head/sys/conf/kmod.mk       Thu Jul 22 18:44:40 2010        (r210383)
+++ head/sys/conf/kmod.mk       Thu Jul 22 18:47:41 2010        (r210384)
@@ -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
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to