ia64/xen-unstable

view freebsd-5.3-xen-sparse/conf/kern.mk @ 7886:51f91ef6c3b5

Fix x86-64 build.

Signed-off-by: James Bulpin <james@xensource.com>
author jrb44@plym.cl.cam.ac.uk
date Thu Nov 17 13:32:05 2005 +0100 (2005-11-17)
parents 7edc9d4fa41e
children
line source
1 # $FreeBSD: src/sys/conf/kern.mk,v 1.42 2004/05/14 13:35:46 cognet Exp $
3 #
4 # Warning flags for compiling the kernel and components of the kernel.
5 #
6 # Note that the newly added -Wcast-qual is responsible for generating
7 # most of the remaining warnings. Warnings introduced with -Wall will
8 # also pop up, but are easier to fix.
9 .if ${CC} == "icc"
10 #CWARNFLAGS= -w2 # use this if you are terribly bored
11 CWARNFLAGS=
12 .else
13 CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \
14 -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual \
15 -fformat-extensions
16 .endif
17 # -std=c99 anonymous unions are non-compliant
18 #
19 # The following flags are next up for working on:
20 # -W
22 #
23 # On the i386, do not align the stack to 16-byte boundaries. Otherwise GCC
24 # 2.95 adds code to the entry and exit point of every function to align the
25 # stack to 16-byte boundaries -- thus wasting approximately 12 bytes of stack
26 # per function call. While the 16-byte alignment may benefit micro benchmarks,
27 # it is probably an overall loss as it makes the code bigger (less efficient
28 # use of code cache tag lines) and uses more stack (less efficient use of data
29 # cache tag lines)
30 #
31 .if ${MACHINE_ARCH} == "i386" && ${CC} != "icc"
32 CFLAGS+= -mno-align-long-strings -mpreferred-stack-boundary=2
33 INLINE_LIMIT?= 8000
34 .endif
36 #
37 # On the alpha, make sure that we don't use floating-point registers and
38 # allow the use of BWX etc instructions (only needed for low-level i/o).
39 # Also, reserve register t7 to point at per-cpu global variables.
40 #
41 .if ${MACHINE_ARCH} == "alpha"
42 CFLAGS+= -mno-fp-regs -ffixed-8 -Wa,-mev6
43 INLINE_LIMIT?= 15000
44 .endif
46 .if ${MACHINE_ARCH} == "arm"
47 INLINE_LIMIT?= 8000
48 .endif
49 #
50 # For IA-64, we use r13 for the kernel globals pointer and we only use
51 # a very small subset of float registers for integer divides.
52 #
53 .if ${MACHINE_ARCH} == "ia64"
54 CFLAGS+= -ffixed-r13 -mfixed-range=f32-f127 -mno-sdata
55 INLINE_LIMIT?= 15000
56 .endif
58 #
59 # For sparc64 we want medlow code model, and we tell gcc to use floating
60 # point emulation. This avoids using floating point registers for integer
61 # operations which it has a tendency to do.
62 #
63 .if ${MACHINE_ARCH} == "sparc64"
64 CFLAGS+= -mcmodel=medlow -msoft-float
65 INLINE_LIMIT?= 15000
66 .endif
68 #
69 # For AMD64, use a medium model for now. We'll switch to "kernel"
70 # once pmap is ready. Be excessively careful to not generate FPU code.
71 #
72 .if ${MACHINE_ARCH} == "amd64"
73 CFLAGS+= -mcmodel=kernel -mno-red-zone \
74 -mfpmath=387 -mno-sse -mno-sse2 -mno-mmx -mno-3dnow \
75 -msoft-float -fno-asynchronous-unwind-tables
76 INLINE_LIMIT?= 8000
77 .endif
79 #
80 # For PowerPC we tell gcc to use floating point emulation. This avoids using
81 # floating point registers for integer operations which it has a tendency to do.
82 #
83 .if ${MACHINE_ARCH} == "powerpc"
84 CFLAGS+= -msoft-float
85 INLINE_LIMIT?= 15000
86 .endif
88 #
89 # GCC 3.0 and above like to do certain optimizations based on the
90 # assumption that the program is linked against libc. Stop this.
91 #
92 .if ${CC} == "icc"
93 CFLAGS+= -nolib_inline
94 .else
95 CFLAGS+= -ffreestanding
96 .endif
98 .if ${CC} == "icc"
99 CFLAGS+= -restrict
100 .endif