diff options
author | brucec <brucec@FreeBSD.org> | 2011-05-14 11:26:00 +0000 |
---|---|---|
committer | brucec <brucec@FreeBSD.org> | 2011-05-14 11:26:00 +0000 |
commit | d37f1bd21ec79d44d6bafe72ac7a38faaec51c2e (patch) | |
tree | 99490c6982a8472d17036183990f0e6353d02735 /sys/conf/kern.mk | |
parent | c3c15582fd9fd8090ba32903c221ff11efab1f49 (diff) | |
download | FreeBSD-src-d37f1bd21ec79d44d6bafe72ac7a38faaec51c2e.zip FreeBSD-src-d37f1bd21ec79d44d6bafe72ac7a38faaec51c2e.tar.gz |
gcc and clang semantics imply certain -mno-* flags when other certain -mno-*
flags are also specified. This change makes use of this behaviour and removes
unneeded -mno-* flags.
Note that clang does not yet enable AVX support for any CPU. However at some
point in the future it will and since we definitely want to disable it for the
kernel, we might as well add the -mno-avx flag now.
Submitted by: arundel
Diffstat (limited to 'sys/conf/kern.mk')
-rw-r--r-- | sys/conf/kern.mk | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index 23ad3e2..58ab6ee 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -25,11 +25,21 @@ CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \ # operations inside the kernel itself. These operations are exclusively # reserved for user applications. # +# gcc: +# Setting -mno-mmx implies -mno-3dnow +# Setting -mno-sse implies -mno-sse2, -mno-sse3 and -mno-ssse3 +# +# clang: +# Setting -mno-mmx implies -mno-3dnow, -mno-3dnowa, -mno-sse, -mno-sse2, +# -mno-sse3, -mno-ssse3, -mno-sse41 and -mno-sse42 +# .if ${MACHINE_CPUARCH} == "i386" .if ${CC:T:Mclang} != "clang" -CFLAGS+= -mno-align-long-strings -mpreferred-stack-boundary=2 +CFLAGS+= -mno-align-long-strings -mpreferred-stack-boundary=2 -mno-sse +.else +CFLAGS+= -mno-aes -mno-avx .endif -CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float +CFLAGS+= -mno-mmx -msoft-float INLINE_LIMIT?= 8000 .endif @@ -61,10 +71,23 @@ INLINE_LIMIT?= 15000 # operations inside the kernel itself. These operations are exclusively # reserved for user applications. # +# gcc: +# Setting -mno-mmx implies -mno-3dnow +# Setting -mno-sse implies -mno-sse2, -mno-sse3, -mno-ssse3 and -mfpmath=387 +# +# clang: +# Setting -mno-mmx implies -mno-3dnow, -mno-3dnowa, -mno-sse, -mno-sse2, +# -mno-sse3, -mno-ssse3, -mno-sse41 and -mno-sse42 +# (-mfpmath= is not supported) +# .if ${MACHINE_CPUARCH} == "amd64" -CFLAGS+= -mcmodel=kernel -mno-red-zone \ - -mfpmath=387 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 \ - -msoft-float -fno-asynchronous-unwind-tables +.if ${CC:T:Mclang} != "clang" +CFLAGS+= -mno-sse +.else +CFLAGS+= -mno-aes -mno-avx +.endif +CFLAGS+= -mcmodel=kernel -mno-red-zone -mno-mmx -msoft-float \ + -fno-asynchronous-unwind-tables INLINE_LIMIT?= 8000 .endif |