summaryrefslogtreecommitdiffstats
path: root/sys/conf/kmod.mk
diff options
context:
space:
mode:
authortrhodes <trhodes@FreeBSD.org>2004-03-12 21:36:12 +0000
committertrhodes <trhodes@FreeBSD.org>2004-03-12 21:36:12 +0000
commit1492567af172581341359256c68e5f7ce6a2298f (patch)
tree92d1817354827751fba22c16fc2fbfed658a79c4 /sys/conf/kmod.mk
parent50a11e8dfda32bba358edc8869ab6f0e91f610b3 (diff)
downloadFreeBSD-src-1492567af172581341359256c68e5f7ce6a2298f.zip
FreeBSD-src-1492567af172581341359256c68e5f7ce6a2298f.tar.gz
This are the build infrastructure changes to allow to use the
Intel C/C++ compiler (lang/icc) to build the kernel. The icc CPUTYPE CFLAGS use icc v7 syntax, icc v8 moans about them, but doesn't abort. They also produce CPU specific code (new instructions of the CPU, not only CPU specific scheduling), so if you get coredumps with signal 4 (SIGILL, illegal instruction) you've used the wrong CPUTYPE. Incarnations of this patch survive gcc compiles and my make universe. I use it on my desktop. To use it update share/mk, add /usr/local/intel/compiler70/ia32/bin (icc v7, works) or /usr/local/intel_cc_80/bin (icc v8, doesn't work) to your PATH, make sure you have a new kernel compile directory (e.g. MYKERNEL_icc) and run CFLAGS="-O2 -ip" CC=icc make depend CFLAGS="-O2 -ip" CC=icc make in it. Don't compile with -ipo, the build infrastructure uses ld directly to link the kernel and the modules, but -ipo needs the link step to be performed with Intel's linker. Problems with icc v8: - panic: npx0 cannot be emulated on an SMP system - UP: first start of /bin/sh results in a FP exception Parts of this commit contains suggestions or submissions from Marius Strobl <marius@alchemy.franken.de>. Reviewed by: silence on -arch Submitted by: netchild
Diffstat (limited to 'sys/conf/kmod.mk')
-rw-r--r--sys/conf/kmod.mk15
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk
index 0766b71..c303061 100644
--- a/sys/conf/kmod.mk
+++ b/sys/conf/kmod.mk
@@ -70,6 +70,10 @@ OBJCOPY?= objcopy
.SUFFIXES: .out .o .c .cc .cxx .C .y .l .s .S
+.if ${CC} == "icc"
+_ICC_CFLAGS:= ${CFLAGS:C/(-x[^M^K^W]+)[MKW]+|-x[MKW]+/\1/}
+CFLAGS= ${_ICC_CFLAGS}
+.endif
CFLAGS+= ${COPTS} -D_KERNEL
CFLAGS+= -DKLD_MODULE
@@ -78,7 +82,12 @@ CFLAGS+= -DKLD_MODULE
# such paths after -nostdinc. It doesn't seem to be possible to
# add to the front of `make' variable.
_ICFLAGS:= ${CFLAGS:M-I*}
-CFLAGS+= -nostdinc -I- ${INCLMAGIC} ${_ICFLAGS}
+.if ${CC} == "icc"
+NOSTDINC= -X
+.else
+NOSTDINC= -nostdinc
+.endif
+CFLAGS+= ${NOSTDINC} -I- ${INCLMAGIC} ${_ICFLAGS}
.if defined(KERNBUILDDIR)
CFLAGS+= -include ${KERNBUILDDIR}/opt_global.h
.endif
@@ -102,11 +111,15 @@ CFLAGS+= -I${DESTDIR}/usr/include
CFLAGS+= -I@/../include -I${DESTDIR}/usr/include
.endif # @
+.if ${CC} != "icc"
CFLAGS+= -finline-limit=${INLINE_LIMIT}
+.endif
# Disallow common variables, and if we end up with commons from
# somewhere unexpected, allocate storage for them in the module itself.
+.if ${CC} != "icc"
CFLAGS+= -fno-common
+.endif
LDFLAGS+= -d -warn-common
CFLAGS+= ${DEBUG_FLAGS}
OpenPOWER on IntegriCloud