Print this page
10908 Simplify SMAP relocations with krtld
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/i86pc/Makefile.rules
+++ new/usr/src/uts/i86pc/Makefile.rules
1 1 #
2 2 # CDDL HEADER START
3 3 #
4 4 # The contents of this file are subject to the terms of the
5 5 # Common Development and Distribution License (the "License").
6 6 # You may not use this file except in compliance with the License.
7 7 #
8 8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 # or http://www.opensolaris.org/os/licensing.
10 10 # See the License for the specific language governing permissions
11 11 # and limitations under the License.
12 12 #
13 13 # When distributing Covered Code, include this CDDL HEADER in each
14 14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 # If applicable, add the following below this CDDL HEADER, with the
↓ open down ↓ |
15 lines elided |
↑ open up ↑ |
16 16 # fields enclosed by brackets "[]" replaced with your own identifying
17 17 # information: Portions Copyright [yyyy] [name of copyright owner]
18 18 #
19 19 # CDDL HEADER END
20 20 #
21 21
22 22 #
23 23 # Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
24 24 # Copyright 2015 Igor Kozhukhov <ikozhukhov@gmail.com>
25 25 # Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
26 +# Copyright (c) 2017 Joyent, Inc.
26 27 #
27 28
28 29 # This Makefile defines the build rules for the directory uts/i86pc
29 30 # and its children. These are the source files which are i86pc
30 31 # "implementation architecture" dependent.
31 32 #
32 33 # The following two-level ordering must be maintained in this file.
33 34 # Lines are sorted first in order of decreasing specificity based on
34 35 # the first directory component. That is, i86pc rules come before
35 36 # intel rules come before common rules.
36 37 #
37 38 # Lines whose initial directory components are equal are sorted
38 39 # alphabetically by the remaining components.
39 40
40 41 #
41 42 # Section 1a: C object build rules
42 43 #
43 44 $(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/conf/%.c
44 45 $(COMPILE.c) -o $@ $<
45 46 $(CTFCONVERT_O)
46 47
47 48 $(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/cpu/amd_opteron/%.c
48 49 $(COMPILE.c) -o $@ $<
49 50 $(CTFCONVERT_O)
50 51
51 52 $(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/cpu/authenticamd/%.c
52 53 $(COMPILE.c) -o $@ $<
53 54 $(CTFCONVERT_O)
54 55
55 56 $(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/cpu/generic_cpu/%.c
56 57 $(COMPILE.c) -o $@ $<
57 58 $(CTFCONVERT_O)
58 59
59 60 $(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/cpu/genuineintel/%.c
60 61 $(COMPILE.c) -o $@ $<
61 62 $(CTFCONVERT_O)
62 63
63 64 $(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/%.c
64 65 $(COMPILE.c) -o $@ $<
65 66 $(CTFCONVERT_O)
66 67
67 68 $(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/acpi_drv/%.c
68 69 $(COMPILE.c) -o $@ $<
69 70 $(CTFCONVERT_O)
70 71
71 72 $(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/fipe/%.c
72 73 $(COMPILE.c) -o $@ $<
73 74 $(CTFCONVERT_O)
74 75
75 76 $(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/acpi/acpidev/%.c
76 77 $(COMPILE.c) -o $@ $<
77 78 $(CTFCONVERT_O)
78 79
79 80 $(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/acpi/acpinex/%.c
80 81 $(COMPILE.c) -o $@ $<
81 82 $(CTFCONVERT_O)
82 83
83 84 SBD_IOCTL = $(UTSBASE)/i86pc/sys/sbd_ioctl.h
84 85 DRMACH_IO = $(UTSBASE)/i86pc/io/acpi/drmach_acpi
85 86 DRMACH_GENERR = $(DRMACH_IO)/sbdgenerr
86 87 DR_IO = $(UTSBASE)/i86pc/io/dr
87 88 DR_GENERR = $(DR_IO)/sbdgenerr
88 89
89 90 $(DRMACH_GENERR): $(DR_IO)/sbdgenerr.pl
90 91 $(RM) $@
91 92 $(CAT) $(DR_IO)/sbdgenerr.pl > $@
92 93 $(CHMOD) +x $@
93 94
94 95 $(DRMACH_IO)/drmach_err.c: $(DRMACH_GENERR) $(SBD_IOCTL)
95 96 $(RM) $@
96 97 $(DRMACH_GENERR) EX86 < $(SBD_IOCTL) > $(DRMACH_IO)/drmach_err.c
97 98
98 99 $(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/acpi/drmach_acpi/%.c
99 100 $(COMPILE.c) -o $@ $<
100 101 $(CTFCONVERT_O)
101 102
102 103 $(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/amd_iommu/%.c
103 104 $(COMPILE.c) -o $@ $<
104 105 $(CTFCONVERT_O)
105 106
106 107 $(DR_GENERR): $(DR_IO)/sbdgenerr.pl
107 108 $(RM) $@
108 109 $(CAT) $(DR_IO)/sbdgenerr.pl > $@
109 110 $(CHMOD) +x $@
110 111
111 112 $(DR_IO)/dr_err.c: $(DR_GENERR) $(SBD_IOCTL)
112 113 $(RM) $@
113 114 $(DR_GENERR) ESBD < $(SBD_IOCTL) > $(DR_IO)/dr_err.c
114 115
115 116 $(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/dr/%.c
116 117 $(COMPILE.c) -o $@ $<
117 118 $(CTFCONVERT_O)
118 119
119 120 $(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/ioat/%.c
120 121 $(COMPILE.c) -o $@ $<
121 122 $(CTFCONVERT_O)
122 123
123 124 $(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/pci/%.c
124 125 $(COMPILE.c) -o $@ $<
125 126 $(CTFCONVERT_O)
126 127
127 128 $(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/pciex/%.c
128 129 $(COMPILE.c) -o $@ $<
129 130 $(CTFCONVERT_O)
130 131
131 132 $(OBJS_DIR)/%.o: $(UTSBASE)/intel/io/pciex/hotplug/%.c
132 133 $(COMPILE.c) -o $@ $<
133 134 $(CTFCONVERT_O)
134 135
135 136 $(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/pcplusmp/%.c
136 137 $(COMPILE.c) -o $@ $<
137 138 $(CTFCONVERT_O)
138 139
139 140 $(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/pcplusmp/%.s
140 141 $(COMPILE.s) -o $@ $<
141 142
142 143 $(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/apix/%.c
143 144 $(COMPILE.c) -o $@ $<
144 145 $(CTFCONVERT_O)
145 146
146 147 $(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/ppm/%.c
147 148 $(COMPILE.c) -o $@ $<
148 149 $(CTFCONVERT_O)
149 150
150 151 $(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/ppm/%.s
151 152 $(COMPILE.s) -o $@ $<
152 153
153 154 $(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/psm/%.c
154 155 $(COMPILE.c) -o $@ $<
155 156 $(CTFCONVERT_O)
156 157
157 158 $(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/psm/%.s
158 159 $(COMPILE.s) -o $@ $<
159 160
160 161 $(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/tzmon/%.c
161 162 $(COMPILE.c) -o $@ $<
162 163 $(CTFCONVERT_O)
163 164
164 165 $(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/ml/%.s
165 166 $(COMPILE.s) -o $@ $<
166 167
167 168 $(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/os/%.c
168 169 $(COMPILE.c) -_gcc=-fno-stack-protector -o $@ $<
169 170 $(CTFCONVERT_O)
170 171
171 172 $(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/os/cpupm/%.c
172 173 $(COMPILE.c) -o $@ $<
173 174 $(CTFCONVERT_O)
174 175
175 176 $(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/boot/%.c
176 177 $(COMPILE.c) -o $@ $<
177 178 $(CTFCONVERT_O)
178 179
179 180 $(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/vm/%.c
180 181 $(COMPILE.c) -o $@ $<
181 182 $(CTFCONVERT_O)
182 183
183 184 $(OBJS_DIR)/%.o: $(UTSBASE)/common/io/%.c
184 185 $(COMPILE.c) -o $@ $<
185 186 $(CTFCONVERT_O)
186 187
187 188 $(OBJS_DIR)/%.o: $(UTSBASE)/common/io/ppm/%.c
188 189 $(COMPILE.c) -o $@ $<
189 190 $(CTFCONVERT_O)
190 191
191 192 $(OBJS_DIR)/%.o: $(UTSBASE)/common/io/pciex/%.c
192 193 $(COMPILE.c) -o $@ $<
193 194 $(CTFCONVERT_O)
194 195
195 196 $(OBJS_DIR)/%.o: $(UTSBASE)/common/os/%.c
196 197 $(COMPILE.c) -o $@ $<
197 198 $(CTFCONVERT_O)
198 199
199 200 $(OBJS_DIR)/%.o: $(SRC)/common/dis/i386/%.c
200 201 $(COMPILE.c) -o $@ $<
201 202 $(CTFCONVERT_O)
202 203
203 204 $(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/gfx_private/%.c
204 205 $(COMPILE.c) -o $@ $<
205 206 $(CTFCONVERT_O)
206 207
207 208 $(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/io/xsvc/%.c
208 209 $(COMPILE.c) -o $@ $<
209 210 $(CTFCONVERT_O)
210 211
211 212 $(OBJS_DIR)/%.o: $(UTSBASE)/common/xen/os/%.c
212 213 $(COMPILE.c) -o $@ $<
213 214 $(CTFCONVERT_O)
214 215
215 216 $(OBJS_DIR)/%.o: $(UTSBASE)/i86pc/dboot/%.c
216 217 $(COMPILE.c) -o $@ $<
217 218 $(CTFCONVERT_O)
218 219
219 220 #
220 221 # dboot stuff is always 32 bit, linked to run with phys_addr == virt_addr
221 222 #
222 223 DBOOT_OBJS_DIR = dboot/$(OBJS_DIR)
223 224 DBOOT_MACH_32 = -D_BOOT_TARGET_i386
224 225 DBOOT_MACH_64 = -D_BOOT_TARGET_amd64
225 226 DBOOT_DEFS = -D_BOOT $(DBOOT_MACH_$(CLASS))
226 227 DBOOT_DEFS += -D_MACHDEP -U_KERNEL -D_I32LPx
227 228 DBOOT_FLAGS = $(CCVERBOSE) $(CSTD) $(CERRWARN) $(CCNOAUTOINLINE)
228 229
229 230 DBOOT_CC_INCL = -I$(SRC)/common -I$(SRC)/common/util $(INCLUDE_PATH)
230 231 DBOOT_AS_INCL = $(AS_INC_PATH)
231 232
232 233 DBOOT_AS = $(ONBLD_TOOLS)/bin/$(MACH)/aw
233 234
234 235 $(DBOOT_OBJS_DIR)/%.o: $(UTSBASE)/i86pc/boot/%.c
235 236 $(i386_CC) $(DBOOT_FLAGS) -O $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
236 237
237 238 $(DBOOT_OBJS_DIR)/%.o: $(UTSBASE)/i86pc/dboot/%.c
238 239 $(i386_CC) $(DBOOT_FLAGS) -O $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
239 240
240 241 $(DBOOT_OBJS_DIR)/%.o: $(UTSBASE)/intel/ia32/%.s
241 242 $(DBOOT_AS) -P -D_ASM $(DBOOT_DEFS) $(DBOOT_AS_INCL) -o $@ $<
242 243
243 244 $(DBOOT_OBJS_DIR)/%.o: $(SRC)/common/font/%.c
244 245 $(i386_CC) $(DBOOT_FLAGS) -O $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
245 246
246 247 $(DBOOT_OBJS_DIR)/$(FONT).c: $(FONT_DIR)/$(FONT_SRC).bdf
247 248 $(VTFONTCVT) -f source -o $@ $(FONT_DIR)/$(FONT_SRC).bdf
248 249
249 250 $(DBOOT_OBJS_DIR)/%.o: $(DBOOT_OBJS_DIR)/%.c
250 251 $(i386_CC) $(DBOOT_FLAGS) -O $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
251 252
252 253 $(DBOOT_OBJS_DIR)/%.o: $(COMMONBASE)/crypto/sha1/%.c
253 254 $(i386_CC) $(DBOOT_FLAGS) -O $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
254 255
255 256 $(DBOOT_OBJS_DIR)/%.o: $(DBOOT_OBJS_DIR)/%.c
256 257 $(i386_CC) $(DBOOT_FLAGS) -O $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
257 258
258 259 $(DBOOT_OBJS_DIR)/%.o: $(COMMONBASE)/util/%.c
259 260 $(i386_CC) $(DBOOT_FLAGS) -O $(DBOOT_DEFS) $(DBOOT_CC_INCL) -c -o $@ $<
260 261
261 262 $(DBOOT_OBJS_DIR)/%.o: $(COMMONBASE)/util/i386/%.s
262 263 $(DBOOT_AS) -P -D_ASM $(DBOOT_DEFS) $(DBOOT_AS_INCL) -o $@ $<
263 264
264 265 $(DBOOT_OBJS_DIR)/%.o: $(UTSBASE)/i86pc/dboot/%.s
265 266 $(DBOOT_AS) -P -D_ASM $(DBOOT_DEFS) $(DBOOT_AS_INCL) -o $@ $<
266 267
267 268 #
268 269 # Stuff to build bios_call.o for the kernel.
269 270 #
270 271 MAPFILE_BIOS = $(UTSBASE)/i86pc/conf/Mapfile.bios
271 272 $(OBJS_DIR)/bios_call.o: $(UTSBASE)/i86pc/ml/bios_call_src.s
272 273 $(COMPILE.s) -o $(OBJS_DIR)/bios_call_src.o \
273 274 $(UTSBASE)/i86pc/ml/bios_call_src.s
274 275 $(LD) -dn -M $(MAPFILE_BIOS) \
275 276 -o $(OBJS_DIR)/bios_call_src $(OBJS_DIR)/bios_call_src.o
276 277 @echo " .data" > $(OBJS_DIR)/bios_call.s
277 278 @echo " .globl bios_image" >> $(OBJS_DIR)/bios_call.s
278 279 @echo "bios_image:" >> $(OBJS_DIR)/bios_call.s
279 280 $(ELFEXTRACT) $(OBJS_DIR)/bios_call_src >> $(OBJS_DIR)/bios_call.s
280 281 @echo " .align 4" >> $(OBJS_DIR)/bios_call.s
281 282 @echo " .globl bios_size" >> $(OBJS_DIR)/bios_call.s
282 283 @echo "bios_size:" >> $(OBJS_DIR)/bios_call.s
283 284 @echo " .long . - bios_image" >> $(OBJS_DIR)/bios_call.s
284 285 $(COMPILE.s) -o $@ $(OBJS_DIR)/bios_call.s
285 286
286 287 #
287 288 # Stuff to build fb_swtch.o for the kernel.
288 289 #
289 290 MAPFILE_FBSWTCH = $(UTSBASE)/i86pc/conf/Mapfile.fb_swtch
290 291 $(OBJS_DIR)/fb_swtch.o: $(UTSBASE)/i86pc/ml/fb_swtch_src.s
291 292 $(COMPILE.s) -o $(OBJS_DIR)/fb_swtch_src.o \
292 293 $(UTSBASE)/i86pc/ml/fb_swtch_src.s
293 294 $(LD) -dn -M $(MAPFILE_FBSWTCH) \
294 295 -o $(OBJS_DIR)/fb_swtch_src $(OBJS_DIR)/fb_swtch_src.o
295 296 @echo " .data" > $(OBJS_DIR)/fb_swtch.s
296 297 @echo " .globl fb_swtch_image" >> $(OBJS_DIR)/fb_swtch.s
297 298 @echo "fb_swtch_image:" >> $(OBJS_DIR)/fb_swtch.s
298 299 $(ELFEXTRACT) $(OBJS_DIR)/fb_swtch_src >> $(OBJS_DIR)/fb_swtch.s
299 300 @echo " .align 4" >> $(OBJS_DIR)/fb_swtch.s
300 301 @echo " .globl fb_swtch_size" >> $(OBJS_DIR)/fb_swtch.s
301 302 @echo "fb_swtch_size:" >> $(OBJS_DIR)/fb_swtch.s
302 303 @echo " .long . - fb_swtch_image" >> $(OBJS_DIR)/fb_swtch.s
303 304 $(COMPILE.s) -o $@ $(OBJS_DIR)/fb_swtch.s
304 305
305 306 # ridiculous contortions ---
306 307 ATOMIC_SUBDIR_32 = i386
307 308 ATOMIC_SUBDIR_64 = amd64
↓ open down ↓ |
272 lines elided |
↑ open up ↑ |
308 309 ATOMIC_SUBDIR = $(ATOMIC_SUBDIR_$(CLASS))
309 310
310 311 $(OBJS_DIR)/%.o: $(SRC)/common/atomic/$(ATOMIC_SUBDIR)/%.s
311 312 $(COMPILE.s) -o $@ $<
312 313
313 314 #
314 315 # dtrace stubs
315 316 #
316 317
317 318 $(OBJS_DIR)/dtracestubs.s: $(UNIX_O) $(LIBS)
318 - $(NM) -u $(UNIX_O) $(LIBS) | $(GREP) __dtrace_probe_ | $(SORT) | \
319 + $(NM) -u $(UNIX_O) $(LIBS) | \
320 + $(EGREP) '(__dtrace_probe_|smap_(disable|enable))' | $(SORT) | \
319 321 $(UNIQ) | $(AWK) '{ \
320 322 printf("\t.globl %s\n\t.type %s,@function\n%s:\n", \
321 323 $$1, $$1, $$1); }' > $(OBJS_DIR)/dtracestubs.s
322 324
323 325 $(DTRACESTUBS): $(DTRACESTUBS_O)
324 326 $(BUILD.SO) $(DTRACESTUBS_O)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX