1999-08-28 00:22:10 +00:00
|
|
|
# $FreeBSD$
|
1996-10-08 22:10:49 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Warning flags for compiling the kernel and components of the kernel.
|
|
|
|
#
|
2001-07-22 00:12:23 +00:00
|
|
|
# Note that the newly added -Wcast-qual is responsible for generating
|
|
|
|
# most of the remaining warnings. Warnings introduced with -Wall will
|
|
|
|
# also pop up, but are easier to fix.
|
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
2004-03-12 21:36:12 +00:00
|
|
|
.if ${CC} == "icc"
|
|
|
|
#CWARNFLAGS= -w2 # use this if you are terribly bored
|
|
|
|
CWARNFLAGS=
|
|
|
|
.else
|
2001-09-10 06:23:33 +00:00
|
|
|
CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \
|
|
|
|
-Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual \
|
2007-05-19 04:45:54 +00:00
|
|
|
${_wundef} -Wno-pointer-sign -fformat-extensions
|
2006-05-30 19:18:01 +00:00
|
|
|
.if !defined(NO_UNDEF)
|
|
|
|
_wundef= -Wundef
|
|
|
|
.endif
|
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
2004-03-12 21:36:12 +00:00
|
|
|
.endif
|
1999-01-29 10:57:18 +00:00
|
|
|
#
|
|
|
|
# The following flags are next up for working on:
|
|
|
|
# -W
|
1999-01-27 22:53:58 +00:00
|
|
|
|
1999-11-17 07:30:35 +00:00
|
|
|
#
|
|
|
|
# On the i386, do not align the stack to 16-byte boundaries. Otherwise GCC
|
|
|
|
# 2.95 adds code to the entry and exit point of every function to align the
|
|
|
|
# stack to 16-byte boundaries -- thus wasting approximately 12 bytes of stack
|
|
|
|
# per function call. While the 16-byte alignment may benefit micro benchmarks,
|
2000-04-24 08:50:15 +00:00
|
|
|
# it is probably an overall loss as it makes the code bigger (less efficient
|
1999-11-17 07:30:35 +00:00
|
|
|
# use of code cache tag lines) and uses more stack (less efficient use of data
|
2005-03-31 22:53:58 +00:00
|
|
|
# cache tag lines). Explicitly prohibit the use of SSE and other SIMD
|
|
|
|
# operations inside the kernel itself. These operations are exclusively
|
|
|
|
# reserved for user applications.
|
1999-11-17 07:30:35 +00:00
|
|
|
#
|
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
2004-03-12 21:36:12 +00:00
|
|
|
.if ${MACHINE_ARCH} == "i386" && ${CC} != "icc"
|
2005-03-15 18:43:36 +00:00
|
|
|
CFLAGS+= -mno-align-long-strings -mpreferred-stack-boundary=2 \
|
2005-07-15 11:45:30 +00:00
|
|
|
-mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3
|
2004-03-03 09:35:06 +00:00
|
|
|
INLINE_LIMIT?= 8000
|
1999-11-17 07:30:35 +00:00
|
|
|
.endif
|
|
|
|
|
2004-05-14 13:35:46 +00:00
|
|
|
.if ${MACHINE_ARCH} == "arm"
|
|
|
|
INLINE_LIMIT?= 8000
|
|
|
|
.endif
|
2000-10-16 20:04:52 +00:00
|
|
|
#
|
|
|
|
# For IA-64, we use r13 for the kernel globals pointer and we only use
|
|
|
|
# a very small subset of float registers for integer divides.
|
|
|
|
#
|
|
|
|
.if ${MACHINE_ARCH} == "ia64"
|
2007-05-19 04:45:54 +00:00
|
|
|
CFLAGS+= -ffixed-r13 -mfixed-range=f32-f127 -fpic #-mno-sdata
|
2003-11-04 23:29:17 +00:00
|
|
|
INLINE_LIMIT?= 15000
|
2000-10-16 20:04:52 +00:00
|
|
|
.endif
|
2001-09-10 06:23:33 +00:00
|
|
|
|
2003-02-28 06:49:59 +00:00
|
|
|
#
|
|
|
|
# For sparc64 we want medlow code model, and we tell gcc to use floating
|
|
|
|
# point emulation. This avoids using floating point registers for integer
|
|
|
|
# operations which it has a tendency to do.
|
|
|
|
#
|
|
|
|
.if ${MACHINE_ARCH} == "sparc64"
|
2006-11-26 23:16:46 +00:00
|
|
|
CFLAGS+= -mcmodel=medany -msoft-float
|
2003-11-04 23:29:17 +00:00
|
|
|
INLINE_LIMIT?= 15000
|
2003-02-28 06:49:59 +00:00
|
|
|
.endif
|
|
|
|
|
2003-04-30 22:22:29 +00:00
|
|
|
#
|
2005-03-31 22:53:58 +00:00
|
|
|
# For AMD64, we explicitly prohibit the use of FPU, SSE and other SIMD
|
|
|
|
# operations inside the kernel itself. These operations are exclusively
|
|
|
|
# reserved for user applications.
|
2003-04-30 22:22:29 +00:00
|
|
|
#
|
|
|
|
.if ${MACHINE_ARCH} == "amd64"
|
2003-05-23 05:04:54 +00:00
|
|
|
CFLAGS+= -mcmodel=kernel -mno-red-zone \
|
2003-05-30 01:06:58 +00:00
|
|
|
-mfpmath=387 -mno-sse -mno-sse2 -mno-mmx -mno-3dnow \
|
|
|
|
-msoft-float -fno-asynchronous-unwind-tables
|
2004-02-06 20:40:04 +00:00
|
|
|
INLINE_LIMIT?= 8000
|
2003-04-30 22:22:29 +00:00
|
|
|
.endif
|
|
|
|
|
2003-12-07 09:56:30 +00:00
|
|
|
#
|
|
|
|
# For PowerPC we tell gcc to use floating point emulation. This avoids using
|
|
|
|
# floating point registers for integer operations which it has a tendency to do.
|
|
|
|
#
|
|
|
|
.if ${MACHINE_ARCH} == "powerpc"
|
|
|
|
CFLAGS+= -msoft-float
|
|
|
|
INLINE_LIMIT?= 15000
|
|
|
|
.endif
|
|
|
|
|
2001-09-10 06:23:33 +00:00
|
|
|
#
|
|
|
|
# GCC 3.0 and above like to do certain optimizations based on the
|
|
|
|
# assumption that the program is linked against libc. Stop this.
|
|
|
|
#
|
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
2004-03-12 21:36:12 +00:00
|
|
|
.if ${CC} == "icc"
|
|
|
|
CFLAGS+= -nolib_inline
|
|
|
|
.else
|
2001-09-10 06:23:33 +00:00
|
|
|
CFLAGS+= -ffreestanding
|
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
2004-03-12 21:36:12 +00:00
|
|
|
.endif
|
|
|
|
|
|
|
|
.if ${CC} == "icc"
|
|
|
|
CFLAGS+= -restrict
|
|
|
|
.endif
|