Fri Feb 21 20:45:12 2014 UTC ()
Use code model small for LLVM, it should be equivalent to GCC's medlow.


(joerg)
diff -r1.73 -r1.74 src/sys/arch/sparc64/conf/Makefile.sparc64

cvs diff -r1.73 -r1.74 src/sys/arch/sparc64/conf/Makefile.sparc64 (switch to unified diff)

--- src/sys/arch/sparc64/conf/Makefile.sparc64 2013/03/19 19:59:40 1.73
+++ src/sys/arch/sparc64/conf/Makefile.sparc64 2014/02/21 20:45:12 1.74
@@ -1,164 +1,166 @@ @@ -1,164 +1,166 @@
1# $NetBSD: Makefile.sparc64,v 1.73 2013/03/19 19:59:40 christos Exp $ 1# $NetBSD: Makefile.sparc64,v 1.74 2014/02/21 20:45:12 joerg Exp $
2 2
3#========================================================================= 3#=========================================================================
4# 4#
5# ***** WARNING ****** 5# ***** WARNING ******
6# 6#
7# ANYONE WHO CHANGES THIS MAKEFILE AND DOES NOT TEST BOTH A 32-BIT 7# ANYONE WHO CHANGES THIS MAKEFILE AND DOES NOT TEST BOTH A 32-BIT
8# AND 64-BIT KERNEL WILL BE SHOT. 8# AND 64-BIT KERNEL WILL BE SHOT.
9# 9#
10#========================================================================= 10#=========================================================================
11 11
12 12
13# Makefile for NetBSD 13# Makefile for NetBSD
14# 14#
15# This makefile is constructed from a machine description: 15# This makefile is constructed from a machine description:
16# config machineid 16# config machineid
17# Most changes should be made in the machine description 17# Most changes should be made in the machine description
18# /sys/arch/sparc64/conf/``machineid'' 18# /sys/arch/sparc64/conf/``machineid''
19# after which you should do 19# after which you should do
20# config machineid 20# config machineid
21# Machine generic makefile changes should be made in 21# Machine generic makefile changes should be made in
22# /sys/arch/sparc64/conf/Makefile.sparc64 22# /sys/arch/sparc64/conf/Makefile.sparc64
23# after which config should be rerun for all machines of that type. 23# after which config should be rerun for all machines of that type.
24# 24#
25# To specify debugging, add the config line: makeoptions DEBUG="-g" 25# To specify debugging, add the config line: makeoptions DEBUG="-g"
26# A better way is to specify -g only for a few files. 26# A better way is to specify -g only for a few files.
27# 27#
28# makeoptions DEBUGLIST="uvm* trap if_*" 28# makeoptions DEBUGLIST="uvm* trap if_*"
29 29
30# Default to 32-bit. Set the MACHINE_ARCH accordingly. 30# Default to 32-bit. Set the MACHINE_ARCH accordingly.
31# 31#
32# You must also be using the correct toolchain or the kernel build 32# You must also be using the correct toolchain or the kernel build
33# will fail. 33# will fail.
34# 34#
35LP64?= no 35LP64?= no
36.if ${LP64} == "yes" 36.if ${LP64} == "yes"
37MACHINE_ARCH=sparc64 37MACHINE_ARCH=sparc64
38.else 38.else
39MACHINE_ARCH=sparc 39MACHINE_ARCH=sparc
40.endif 40.endif
41 41
42USETOOLS?= no 42USETOOLS?= no
43NEED_OWN_INSTALL_TARGET?=no 43NEED_OWN_INSTALL_TARGET?=no
44.include <bsd.own.mk> 44.include <bsd.own.mk>
45 45
46## 46##
47## (1) port identification 47## (1) port identification
48## 48##
49SPARC64= $S/arch/sparc64 49SPARC64= $S/arch/sparc64
50GENASSYM_CONF= ${SPARC64}/sparc64/genassym.cf 50GENASSYM_CONF= ${SPARC64}/sparc64/genassym.cf
51 51
52## 52##
53## (2) compile settings 53## (2) compile settings
54## 54##
55CPPFLAGS+= -Dsparc64 -D__sparc64__ 55CPPFLAGS+= -Dsparc64 -D__sparc64__
56.if ${LP64} == "yes" 56.if ${LP64} == "yes"
57# 64-bit kernels 57# 64-bit kernels
58CPPFLAGS+= -D_LP64 -Wa,-Av9a 58CPPFLAGS+= -D_LP64 -Wa,-Av9a
59AFLAGS+= -Wa,-Av9a 59AFLAGS+= -Wa,-Av9a
60.if defined(PROF) 60.if defined(PROF)
61# Profiling is only supported in the medium low memory model. 61# Profiling is only supported in the medium low memory model.
62CFLAGS+= -mcmodel=medlow 62CFLAGS+= ${${ACTIVE_CC} == "gcc":? -mcmodel=medlow :}
 63CFLAGS+= ${${ACTIVE_CC} == "clang":? -mcmodel=small :}
63.else 64.else
64# Since the kernel resides in the lower 32 bits, use medium low for now anyway. 65# Since the kernel resides in the lower 32 bits, use medium low for now anyway.
65CFLAGS+= -mcmodel=medlow 66CFLAGS+= ${${ACTIVE_CC} == "gcc":? -mcmodel=medlow :}
 67CFLAGS+= ${${ACTIVE_CC} == "clang":? -mcmodel=small :}
66.endif 68.endif
67.else 69.else
68# 32-bit kernels 70# 32-bit kernels
69CPPFLAGS+= -m32 -Wa,-Av8plusa -mcpu=ultrasparc 71CPPFLAGS+= -m32 -Wa,-Av8plusa -mcpu=ultrasparc
70AFLAGS+= -Wa,-Av8plusa 72AFLAGS+= -Wa,-Av8plusa
71.endif 73.endif
72CFLAGS+= -mno-fpu 74CFLAGS+= -mno-fpu
73AFLAGS+= -x assembler-with-cpp 75AFLAGS+= -x assembler-with-cpp
74 76
75## 77##
76## (3) libkern and compat 78## (3) libkern and compat
77## 79##
78OPT_MODULAR= %MODULAR% 80OPT_MODULAR= %MODULAR%
79.if !empty(OPT_MODULAR) 81.if !empty(OPT_MODULAR)
80KERN_AS= obj 82KERN_AS= obj
81.else 83.else
82KERN_AS= library 84KERN_AS= library
83.endif 85.endif
84 86
85## 87##
86## (4) local objects, compile rules, and dependencies 88## (4) local objects, compile rules, and dependencies
87## 89##
88MD_OBJS= locore.o copy.o mp_subr.o 90MD_OBJS= locore.o copy.o mp_subr.o
89MD_CFILES= 91MD_CFILES=
90MD_SFILES= ${SPARC64}/sparc64/locore.s ${SPARC64}/sparc64/copy.S \ 92MD_SFILES= ${SPARC64}/sparc64/locore.s ${SPARC64}/sparc64/copy.S \
91 ${SPARC64}/sparc64/mp_subr.S 93 ${SPARC64}/sparc64/mp_subr.S
92 94
93locore.o: ${SPARC64}/sparc64/locore.s assym.h 95locore.o: ${SPARC64}/sparc64/locore.s assym.h
94 ${NORMAL_S} 96 ${NORMAL_S}
95 97
96copy.o: ${SPARC64}/sparc64/copy.S assym.h 98copy.o: ${SPARC64}/sparc64/copy.S assym.h
97 ${NORMAL_S} 99 ${NORMAL_S}
98 100
99mp_subr.o: ${SPARC64}/sparc64/mp_subr.S assym.h 101mp_subr.o: ${SPARC64}/sparc64/mp_subr.S assym.h
100 ${NORMAL_S} 102 ${NORMAL_S}
101 103
102# Our libkern needs stuff from assym.h for memcpy and memset. 104# Our libkern needs stuff from assym.h for memcpy and memset.
103dependkernlib: assym.h 105dependkernlib: assym.h
104 106
105## 107##
106## (5) link settings 108## (5) link settings
107## 109##
108TEXTADDR?= 01000000 110TEXTADDR?= 01000000
109LINKFORMAT= -T ${SPARC64}/conf/${KERN_LDSCRIPT} 111LINKFORMAT= -T ${SPARC64}/conf/${KERN_LDSCRIPT}
110.if ${LP64} == "yes" 112.if ${LP64} == "yes"
111KERN_LDSCRIPT?= kern.ldscript 113KERN_LDSCRIPT?= kern.ldscript
112.else 114.else
113KERN_LDSCRIPT?= kern32.ldscript 115KERN_LDSCRIPT?= kern32.ldscript
114.endif 116.endif
115 117
116## 118##
117## (6) port specific target dependencies 119## (6) port specific target dependencies
118## 120##
119 121
120# depend on CPU configuration 122# depend on CPU configuration
121bwtwo.o cgsix.o cgthree.o cgtwo.o cons.o dma.o esp.o fb.o if_ie.o: Makefile 123bwtwo.o cgsix.o cgthree.o cgtwo.o cons.o dma.o esp.o fb.o if_ie.o: Makefile
122ms.c obio.o zs.c autoconf.o clock.o cpu.o disksubr.o locore.o: Makefile 124ms.c obio.o zs.c autoconf.o clock.o cpu.o disksubr.o locore.o: Makefile
123machdep.o mem.o openprom.o pmap.o vm_machdep.o: Makefile 125machdep.o mem.o openprom.o pmap.o vm_machdep.o: Makefile
124 126
125cpu_in_cksum.o lock_stubs.o: assym.h 127cpu_in_cksum.o lock_stubs.o: assym.h
126 128
127## 129##
128## (7) misc settings 130## (7) misc settings
129## 131##
130 132
131# define .MAIN _before_ the make() check, so that implicit target 133# define .MAIN _before_ the make() check, so that implicit target
132# would be defined 134# would be defined
133.MAIN: all 135.MAIN: all
134 136
135.if make(depend) || make(all) || make(dependall) 137.if make(depend) || make(all) || make(dependall)
136.BEGIN: 138.BEGIN:
137 @rm -f sparc && \ 139 @rm -f sparc && \
138 ln -s $S/arch/sparc/include sparc 140 ln -s $S/arch/sparc/include sparc
139.endif 141.endif
140 142
141## 143##
142## (8) config(8) generated machinery 144## (8) config(8) generated machinery
143## 145##
144%INCLUDES 146%INCLUDES
145 147
146%OBJS 148%OBJS
147 149
148%CFILES 150%CFILES
149 151
150%SFILES 152%SFILES
151 153
152%LOAD 154%LOAD
153 155
154%RULES 156%RULES
155 157
156## 158##
157## (9) port independent kernel machinery 159## (9) port independent kernel machinery
158## 160##
159.include "$S/conf/Makefile.kern.inc" 161.include "$S/conf/Makefile.kern.inc"
160 162
161## 163##
162## (10) Appending make options. 164## (10) Appending make options.
163## 165##
164%MAKEOPTIONSAPPEND 166%MAKEOPTIONSAPPEND