Print this page
7029 want per-process exploit mitigation features (secflags)
7030 want basic address space layout randomization (aslr)
7031 noexec_user_stack should be a secflag
7032 want a means to forbid mappings around NULL.
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/lib/libc/Makefile.targ
+++ new/usr/src/lib/libc/Makefile.targ
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
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 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 23 # Use is subject to license terms.
24 24 #
25 25 #
26 26
27 27 # libc build rules
28 28
29 29 #
30 30 # This first rule picks up optimized sources for libc variants.
31 31 #
32 32 pics/%.o: $(OPTIMIZED_LIBCBASE)/gen/%.s
33 33 $(BUILD.s)
34 34 $(POST_PROCESS_O)
35 35
36 36 pics/%.o: $(LIBCBASE)/crt/%.c
37 37 $(COMPILE.c) -o $@ $<
38 38 $(POST_PROCESS_O)
39 39
40 40 pics/%.o: $(LIBCBASE)/crt/%.s
41 41 $(BUILD.s)
42 42 $(POST_PROCESS_O)
43 43
44 44 pics/%.o: $(LIBCBASE)/gen/%.c
45 45 $(COMPILE.c) -o $@ $<
46 46 $(POST_PROCESS_O)
47 47
48 48 pics/%.o: $(LIBCBASE)/gen/%.s
49 49 $(BUILD.s)
50 50 $(POST_PROCESS_O)
51 51
52 52 pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/gen/%.s
53 53 $(BUILD.s)
54 54 $(POST_PROCESS_O)
55 55
56 56 pics/_stack_grow.o: $(LIBCBASE)/../$(TARGET_ARCH)/gen/_stack_grow.s
57 57 $(BUILD.s) $(LIBCBASE)/../$(TARGET_ARCH)/gen/_stack_grow.s
58 58 $(POST_PROCESS_O)
59 59
60 60 pics/%.o: $(LIBCBASE)/fp/%.c
61 61 $(COMPILE.c) -o $@ $<
62 62 $(POST_PROCESS_O)
63 63
64 64 pics/%.o: $(LIBCBASE)/../$(MACH)/fp/%.c
65 65 $(COMPILE.c) -o $@ $<
66 66 $(POST_PROCESS_O)
67 67
68 68 pics/%.o: $(LIBCBASE)/fp/%.s
69 69 $(BUILD.s)
70 70 $(POST_PROCESS_O)
71 71
72 72 pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/fp/%.c
73 73 $(COMPILE.c) -o $@ $<
74 74 $(POST_PROCESS_O)
75 75
76 76 pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/fp/%.s
77 77 $(BUILD.s)
78 78 $(POST_PROCESS_O)
79 79
80 80 pics/%.o: $(LIBCBASE)/sys/%.c
81 81 $(COMPILE.c) -o $@ $<
82 82 $(POST_PROCESS_O)
83 83
84 84 pics/%.o: $(LIBCBASE)/../common/sys/%.s
85 85 $(BUILD.s)
86 86 $(POST_PROCESS_O)
87 87
88 88 pics/%.o: $(LIBCBASE)/sys/%.s
89 89 $(BUILD.s)
90 90 $(POST_PROCESS_O)
91 91
92 92 pics/%.o: $(LIBCBASE)/../$(MACH)/sys/%.s
93 93 $(BUILD.s)
94 94 $(POST_PROCESS_O)
95 95
96 96 pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/sys/%.c
97 97 $(COMPILE.c) -o $@ $<
98 98 $(POST_PROCESS_O)
99 99
100 100 pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/sys/%.s
101 101 $(BUILD.s)
102 102 $(POST_PROCESS_O)
103 103
104 104 # rules to build large file aware objects (xxx64.o from xxx.s or xxx.c)
105 105
106 106 pics/%64.o: $(LIBCBASE)/../common/sys/%.s
107 107 $(BUILD.s)
108 108 $(POST_PROCESS_O)
109 109
110 110 pics/%64.o: $(LIBCBASE)/sys/%.s
111 111 $(BUILD.s)
112 112 $(POST_PROCESS_O)
113 113
114 114 pics/%64.o: $(LIBCBASE)/gen/%.c
115 115 $(COMPILE.c) -o $@ $<
116 116 $(POST_PROCESS_O)
117 117
118 118 pics/%64.o: $(LIBCBASE)/../port/gen/%.c
119 119 $(COMPILE.c) -o $@ $<
120 120 $(POST_PROCESS_O)
121 121
122 122 pics/%64.o: $(LIBCBASE)/../port/sys/%.c
123 123 $(COMPILE.c) -o $@ $<
124 124 $(POST_PROCESS_O)
125 125
126 126 pics/%64.o: $(LIBCBASE)/../port/print/%.c
127 127 $(COMPILE.c) -o $@ $<
128 128 $(POST_PROCESS_O)
129 129
130 130 pics/%64.o: $(LIBCBASE)/../port/regex/%.c
131 131 $(COMPILE.c) -DM_I18N_MB -DI18N \
132 132 -I$(LIBCBASE)/../port/regex \
133 133 -I$(LIBCBASE)/../port/gen -o $@ $<
134 134 $(POST_PROCESS_O)
135 135
136 136 pics/%64.o: $(LIBCBASE)/../port/stdio/%.c
137 137 $(COMPILE.c) -o $@ $<
138 138 $(POST_PROCESS_O)
139 139
140 140 pics/%_w.o: $(LIBCBASE)/../port/stdio/%.c
141 141 $(COMPILE.c) -o $@ $<
142 142 $(POST_PROCESS_O)
143 143
144 144 pics/%_w.o: $(LIBCBASE)/../port/print/%.c
145 145 $(COMPILE.c) -o $@ $<
146 146 $(POST_PROCESS_O)
147 147
148 148 pics/%_pos.o: $(LIBCBASE)/../port/i18n/%.c
149 149 $(COMPILE.c) -o $@ $<
150 150 $(POST_PROCESS_O)
151 151
152 152 pics/%_sbyte.o: $(LIBCBASE)/../port/i18n/%.c
153 153 $(COMPILE.c) -o $@ $<
154 154 $(POST_PROCESS_O)
155 155
156 156 pics/%_possbyte.o: $(LIBCBASE)/../port/i18n/%.c
157 157 $(COMPILE.c) -o $@ $<
158 158 $(POST_PROCESS_O)
159 159
160 160 pics/%_longlong.o: $(LIBCBASE)/../port/i18n/%.c
161 161 $(COMPILE.c) -o $@ $<
162 162 $(POST_PROCESS_O)
163 163
164 164 # libc build rules for objects built from "portable" source in ../port
165 165
166 166 pics/%.o: $(LIBCBASE)/../port/fp/%.c
167 167 $(COMPILE.c) \
168 168 -I$(LIBCBASE)/../port/fp -o $@ $<
169 169 $(POST_PROCESS_O)
170 170
171 171 pics/%.o: $(LIBCBASE)/../port/i18n/%.c
172 172 $(COMPILE.c) \
173 173 -I$(LIBCBASE)/../port/i18n -o $@ $<
174 174 $(POST_PROCESS_O)
175 175
176 176 # gen rules
177 177 pics/%.o %.o: $(LIBCBASE)/../port/gen/%.c
178 178 $(COMPILE.c) -o $@ $<
179 179 $(POST_PROCESS_O)
180 180
181 181 # locale rules
182 182 pics/%.o %.o: $(LIBCBASE)/../port/locale/%.c
183 183 $(COMPILE.c) -o $@ $<
184 184 $(POST_PROCESS_O)
185 185
186 186 # print rules
187 187 pics/%.o: $(LIBCBASE)/../port/print/%.c
188 188 $(COMPILE.c) -o $@ $<
189 189 $(POST_PROCESS_O)
190 190
191 191 # regex rules
192 192 pics/%.o: $(LIBCBASE)/../port/regex/%.c
193 193 $(COMPILE.c) -DM_I18N_MB -DI18N \
194 194 -I$(LIBCBASE)/../port/regex \
195 195 -I$(LIBCBASE)/../port/gen -o $@ $<
196 196 $(POST_PROCESS_O)
197 197
198 198 # stdio rules
199 199 pics/%.o: $(LIBCBASE)/../port/stdio/%.c
200 200 $(COMPILE.c) -o $@ $<
201 201 $(POST_PROCESS_O)
202 202
203 203 # c89 print, stdio rules
204 204 pics/%_c89.o: $(LIBCBASE)/../port/print/%.c
205 205 $(COMPILE.c) -o $@ $<
206 206 $(POST_PROCESS_O)
207 207
208 208 pics/%_c89.o: $(LIBCBASE)/../port/stdio/%.c
209 209 $(COMPILE.c) -o $@ $<
210 210 $(POST_PROCESS_O)
211 211
212 212 # aio rules
213 213 pics/%.o: $(LIBCBASE)/../port/aio/%.c
214 214 $(COMPILE.c) -o $@ $<
215 215 $(POST_PROCESS_O)
216 216
217 217 # rt rules
218 218 pics/%.o: $(LIBCBASE)/../port/rt/%.c
219 219 $(COMPILE.c) -o $@ $<
220 220 $(POST_PROCESS_O)
221 221
222 222 # tpool rules
223 223 pics/%.o: $(LIBCBASE)/../port/tpool/%.c
224 224 $(COMPILE.c) -o $@ $<
225 225 $(POST_PROCESS_O)
226 226
227 227 # threads rules
228 228 pics/%.o: $(LIBCBASE)/../port/threads/%.c
229 229 $(COMPILE.c) -o $@ $<
230 230 $(POST_PROCESS_O)
231 231
232 232 pics/%.o: $(LIBCBASE)/threads/%.c
233 233 $(COMPILE.c) -o $@ $<
234 234 $(POST_PROCESS_O)
235 235
236 236 pics/%.o: $(LIBCBASE)/threads/%.s
237 237 $(BUILD.s)
238 238 $(POST_PROCESS_O)
239 239
240 240 pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/threads/%.c
241 241 $(COMPILE.c) -o $@ $<
242 242 $(POST_PROCESS_O)
243 243
244 244 pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/threads/%.s
245 245 $(BUILD.s)
246 246 $(POST_PROCESS_O)
247 247
248 248 pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/unwind/%.c
249 249 $(COMPILE.c) -o $@ $<
250 250 $(POST_PROCESS_O)
251 251
252 252 pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/unwind/%.s
253 253 $(BUILD.s)
254 254 $(POST_PROCESS_O)
255 255
256 256 pics/%.o: $(LIBCBASE)/../port/unwind/%.c
257 257 $(COMPILE.c) -o $@ $<
258 258 $(POST_PROCESS_O)
259 259
260 260 pics/%.o: $(LIBCBASE)/../$(MACH)/unwind/%.s
261 261 $(BUILD.s)
262 262 $(POST_PROCESS_O)
263 263
264 264 pics/%.o: $(LIBCBASE)/../port/sys/%.c
265 265 $(COMPILE.c) -o $@ $<
266 266 $(POST_PROCESS_O)
267 267
268 268 pics/%.o: $(LIBCBASE)/../../common/common/%.c
269 269 $(COMPILE.c) -o $@ $<
270 270 $(POST_PROCESS_O)
271 271
272 272 pics/%.o: $(LIBCBASE)/$(CRTSRCS)/%.s
273 273 $(BUILD.s)
274 274 $(POST_PROCESS_O)
275 275
276 276 # $(SRC)/common rules
277 277 pics/%.o: $(SRC)/common/atomic/$(TARGETMACH)/%.s
278 278 $(BUILD.s)
279 279 $(POST_PROCESS_O)
280 280
281 281 $(COMOBJS:%=pics/%): $(SRC)/common/util/$$(@F:.o=.c)
282 282 $(COMPILE.c) -o $@ $(SRC)/common/util/$(@F:.o=.c)
↓ open down ↓ |
282 lines elided |
↑ open up ↑ |
283 283 $(POST_PROCESS_O)
284 284
285 285 $(XATTROBJS:%=pics/%): $(SRC)/common/xattr/$$(@F:.o=.c)
286 286 $(COMPILE.c) -o $@ $(SRC)/common/xattr/$(@F:.o=.c)
287 287 $(POST_PROCESS_O)
288 288
289 289 $(DTRACEOBJS:%=pics/%): $(SRC)/common/dtrace/$$(@F:.o=.c)
290 290 $(COMPILE.c) -o $@ $(SRC)/common/dtrace/$(@F:.o=.c)
291 291 $(POST_PROCESS_O)
292 292
293 +$(SECFLAGSOBJS:%=pics/%): $(SRC)/common/secflags/$$(@F:.o=.c)
294 + $(COMPILE.c) -o $@ $(SRC)/common/secflags/$(@F:.o=.c)
295 + $(POST_PROCESS_O)
296 +
293 297 $(UNICODEOBJS:%=pics/%): $(SRC)/common/unicode/$$(@F:.o=.c)
294 298 $(COMPILE.c) -o $@ $(SRC)/common/unicode/$(@F:.o=.c)
295 299 $(POST_PROCESS_O)
296 300
297 301 $(CHACHAOBJS:%=pics/%): $(SRC)/common/crypto/chacha/$$(@F:.o=.c)
298 302 $(COMPILE.c) -I$(SRC)/common/crypto/chacha -DKEYSTREAM_ONLY \
299 303 -o $@ $(SRC)/common/crypto/chacha/$(@F:.o=.c)
300 304 $(POST_PROCESS_O)
301 305
302 306 # DTrace rules
303 307 pics/%.o: $(LIBCBASE)/../port/threads/%.d $(THREADSOBJS:%=pics/%)
304 308 $(COMPILE.d) -C -xlazyload -s $< -o $@ $(THREADSOBJS:%=pics/%)
305 309 $(POST_PROCESS_O)
306 310
307 311 include $(SRC)/lib/Makefile.targ
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX