Rev 6533 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
6515 | serge | 1 | |
2 | export AR = kos32-ar |
||
3 | export LD = kos32-ld |
||
4 | export STRIP = kos32-strip |
||
5 | |||
6 | |||
6553 | serge | 7 | |
8 | |||
6515 | serge | 9 | |
10 | |||
6518 | serge | 11 | enable_shared = no |
12 | double_type_size = 64 |
||
6517 | serge | 13 | long_double_type_size = 96 |
14 | decimal_float = yes |
||
15 | enable_vtable_verify = no |
||
6518 | serge | 16 | enable_decimal_float = bid |
6517 | serge | 17 | fixed_point = no |
18 | |||
19 | |||
6521 | serge | 20 | # The rules for compiling them should be in the t-* file for the machine. |
21 | EXTRA_PARTS = crtbegin.o crtend.o crtfastmath.o |
||
22 | |||
6517 | serge | 23 | |
6515 | serge | 24 | CFLAGS_OPT+= -fbuilding-libgcc -fno-stack-protector |
25 | |||
26 | |||
6518 | serge | 27 | CFLAGS+= -U_Win32 -U_WIN32 -U__MINGW32__ -UWIN32 -UWINNT -U_MSC_VER |
6533 | serge | 28 | CFLAGS+= -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes |
6515 | serge | 29 | CFLAGS+= -Wold-style-definition $(CFLAGS_OPT) |
6518 | serge | 30 | |
6515 | serge | 31 | |
6518 | serge | 32 | |
6515 | serge | 33 | |
6527 | serge | 34 | |
6518 | serge | 35 | |
6517 | serge | 36 | |
37 | |||
6518 | serge | 38 | LIB2FUNCS_ST = _eprintf __gcc_bcmp |
39 | |||
40 | |||
41 | LIB2FUNCS_EXCLUDE = |
||
42 | |||
43 | |||
44 | # unwinder info. |
||
45 | LIB2_DIVMOD_FUNCS = _divdi3 _moddi3 _udivdi3 _umoddi3 _udiv_w_sdiv _udivmoddi4 |
||
46 | |||
47 | |||
48 | |||
49 | |||
6515 | serge | 50 | |
51 | |||
6517 | serge | 52 | _fpcmp_parts_sf _compare_sf _eq_sf _ne_sf _gt_sf _ge_sf \ |
53 | _lt_sf _le_sf _unord_sf _si_to_sf _sf_to_si _negate_sf _make_sf \ |
||
54 | _sf_to_df _sf_to_tf _thenan_sf _sf_to_usi _usi_to_sf |
||
55 | |||
56 | |||
57 | _fpcmp_parts_df _compare_df _eq_df _ne_df _gt_df _ge_df \ |
||
58 | _lt_df _le_df _unord_df _si_to_df _df_to_si _negate_df _make_df \ |
||
59 | _df_to_sf _df_to_tf _thenan_df _df_to_usi _usi_to_df |
||
60 | |||
61 | |||
62 | _fpcmp_parts_tf _compare_tf _eq_tf _ne_tf _gt_tf _ge_tf \ |
||
63 | _lt_tf _le_tf _unord_tf _si_to_tf _tf_to_si _negate_tf _make_tf \ |
||
64 | _tf_to_df _tf_to_sf _thenan_tf _tf_to_usi _usi_to_tf |
||
65 | |||
66 | |||
6518 | serge | 67 | LIB2ADDEH = unwind-dw2.c unwind-dw2-fde.c unwind-sjlj.c unwind-c.c |
6521 | serge | 68 | LIB2ADDEHSTATIC = $(LIB2ADDEH) |
6518 | serge | 69 | |
6517 | serge | 70 | |
6527 | serge | 71 | config/i386/kos32-app.c \ |
72 | config/i386/libc-loader.c |
||
73 | |||
74 | |||
6518 | serge | 75 | CUSTOM_CRTSTUFF = yes |
6553 | serge | 76 | |
6518 | serge | 77 | |
78 | |||
6553 | serge | 79 | |
80 | |||
6519 | serge | 81 | |
6518 | serge | 82 | |
6553 | serge | 83 | |
84 | |||
85 | |||
6519 | serge | 86 | |
6553 | serge | 87 | |
88 | |||
6518 | serge | 89 | |
6553 | serge | 90 | |
6518 | serge | 91 | |
6553 | serge | 92 | |
6519 | serge | 93 | |
6553 | serge | 94 | |
6519 | serge | 95 | |
6518 | serge | 96 | |
97 | |||
6553 | serge | 98 | |
6518 | serge | 99 | |
6553 | serge | 100 | |
6519 | serge | 101 | |
6553 | serge | 102 | |
6518 | serge | 103 | |
104 | |||
6527 | serge | 105 | LIB1ASMFUNCS = _chkstk _chkstk_ms _start |
106 | |||
6518 | serge | 107 | |
108 | |||
109 | |||
110 | LIB2ADD += config/i386/sfp-exceptions.c |
||
6553 | serge | 111 | |
6518 | serge | 112 | |
6527 | serge | 113 | |
6553 | serge | 114 | softfp_int_modes := si di ti |
115 | |||
6518 | serge | 116 | |
117 | |||
6553 | serge | 118 | |
6518 | serge | 119 | |
6553 | serge | 120 | |
6518 | serge | 121 | |
122 | |||
123 | |||
6553 | serge | 124 | |
6518 | serge | 125 | |
6553 | serge | 126 | |
127 | |||
6518 | serge | 128 | |
6553 | serge | 129 | |
6518 | serge | 130 | |
131 | |||
132 | # instead of LIB2ADD because that's the way to be sure on some targets |
||
133 | # (e.g. *-*-darwin*) only one copy of it is linked. |
||
134 | LIB2ADDEH += emutls.c |
||
135 | LIB2ADDEHSTATIC += emutls.c |
||
136 | |||
137 | |||
138 | |||
139 | neg$(m)2 sub$(m)3 unord$(m)2 |
||
140 | softfp_floatint_funcs = fix$(m)$(i) fixuns$(m)$(i) \ |
||
141 | float$(i)$(m) floatun$(i)$(m) |
||
142 | |||
143 | |||
144 | $(foreach m,$(softfp_float_modes), \ |
||
145 | $(softfp_float_funcs) \ |
||
146 | $(foreach i,$(softfp_int_modes), \ |
||
147 | $(softfp_floatint_funcs))) \ |
||
148 | $(foreach e,$(softfp_extensions),extend$(e)2) \ |
||
149 | $(foreach t,$(softfp_truncations),trunc$(t)2) \ |
||
150 | $(softfp_extras) |
||
151 | |||
152 | |||
153 | # This list is taken from mklibgcc.in and doesn't presently allow for |
||
154 | # 64-bit targets where si should become di and di should become ti. |
||
155 | softfp_func_list := $(filter-out floatdidf floatdisf fixunsdfsi fixunssfsi \ |
||
156 | fixunsdfdi fixdfdi fixunssfdi fixsfdi fixxfdi fixunsxfdi \ |
||
157 | floatdixf fixunsxfsi fixtfdi fixunstfdi floatditf \ |
||
158 | floatundidf floatundisf floatundixf floatunditf,$(softfp_func_list)) |
||
159 | endif |
||
160 | |||
161 | |||
162 | |||
163 | |||
164 | # for the functions in the soft-fp files have not been brought across |
||
165 | # from glibc. |
||
166 | |||
167 | |||
168 | |||
169 | |||
170 | $(addsuffix _s$(objext), $(soft-fp-objects-base)) |
||
171 | |||
172 | |||
173 | |||
174 | |||
175 | |||
176 | |||
177 | # Functions in libgcc2.c are excluded for each soft-float mode (a |
||
178 | # target may have both soft-float and hard-float modes), for the fixed |
||
179 | # list of integer modes (si and di) for which libgcc2.c defines any |
||
180 | # such functions. Depending on the target, the si and di symbols may |
||
181 | # in fact define di and ti functions. |
||
182 | |||
183 | |||
184 | $(addprefix _,$(foreach m,$(softfp_float_modes), \ |
||
185 | $(foreach i,si di, \ |
||
186 | $(softfp_floatint_funcs)))) |
||
187 | endif |
||
188 | |||
189 | |||
190 | |||
191 | |||
192 | |||
6515 | serge | 193 | _clear_cache _trampoline __main _absvsi2 _absvdi2 _addvsi3 \ |
194 | _addvdi3 _subvsi3 _subvdi3 _mulvsi3 _mulvdi3 _negvsi2 _negvdi2 \ |
||
195 | _ctors _ffssi2 _ffsdi2 _clz _clzsi2 _clzdi2 _ctzsi2 _ctzdi2 \ |
||
196 | _popcount_tab _popcountsi2 _popcountdi2 _paritysi2 _paritydi2 \ |
||
197 | _powisf2 _powidf2 _powixf2 _powitf2 _mulsc3 _muldc3 _mulxc3 \ |
||
198 | _multc3 _divsc3 _divdc3 _divxc3 _divtc3 _bswapsi2 _bswapdi2 \ |
||
199 | _clrsbsi2 _clrsbdi2 |
||
6517 | serge | 200 | |
6515 | serge | 201 | |
6517 | serge | 202 | |
6515 | serge | 203 | |
204 | $(patsubst %,_fixuns%XX,sf df xf tf) \ |
||
205 | $(patsubst %,_floatXX%,sf df xf tf) \ |
||
206 | $(patsubst %,_floatunXX%,sf df xf tf) |
||
207 | |||
208 | |||
6518 | serge | 209 | lib2funcs += $(subst XX,si,$(swfloatfuncs)) |
210 | lib2funcs += $(subst XX,di,$(dwfloatfuncs)) |
||
211 | endif |
||
212 | |||
6515 | serge | 213 | |
6518 | serge | 214 | # unwinder info. |
215 | LIB2_DIVMOD_FUNCS = _divdi3 _moddi3 _udivdi3 _umoddi3 _udiv_w_sdiv _udivmoddi4 |
||
216 | |||
217 | |||
218 | # defined as optimized assembly code in LIB1ASMFUNCS or as C code |
||
219 | # in LIB2FUNCS_EXCLUDE. |
||
220 | lib2funcs := $(filter-out $(LIB2FUNCS_EXCLUDE) $(LIB1ASMFUNCS),$(lib2funcs)) |
||
221 | LIB2_DIVMOD_FUNCS := $(filter-out $(LIB2FUNCS_EXCLUDE) $(LIB1ASMFUNCS), \ |
||
222 | $(LIB2_DIVMOD_FUNCS)) |
||
223 | |||
224 | |||
6519 | serge | 225 | |
6518 | serge | 226 | |
6519 | serge | 227 | $(lib1asmfuncs-o): %$(objext): config/$(LIB1ASMSRC) |
228 | $(gcc_compile) -DL$* -xassembler-with-cpp -c $< -o $@ |
||
229 | libgcc-objects += $(lib1asmfuncs-o) |
||
230 | |||
231 | |||
232 | |||
233 | |||
6518 | serge | 234 | lib2funcs-o = $(patsubst %,%$(objext),$(lib2funcs) $(LIB2FUNCS_ST)) |
6517 | serge | 235 | $(lib2funcs-o): %$(objext): libgcc2.c |
236 | $(gcc_compile) -DL$* -c $< -o $@ |
||
237 | libgcc-objects += $(lib2funcs-o) |
||
6518 | serge | 238 | |
6517 | serge | 239 | |
6518 | serge | 240 | # Build libgcc2.c for each conversion function, with a specific |
241 | # L |
||
242 | # functions are built with a wordsize of 4; the TImode functions are |
||
243 | # built with the same labels, but a wordsize of 8. |
||
244 | |||
6517 | serge | 245 | |
6518 | serge | 246 | difuncs := $(filter-out $(LIB2FUNCS_EXCLUDE),$(subst XX,di,$(dwfloatfuncs))) |
247 | tifuncs := $(filter-out $(LIB2FUNCS_EXCLUDE),$(subst XX,ti,$(dwfloatfuncs))) |
||
248 | |||
249 | |||
250 | iter-labels := $(sifuncs) $(difuncs) $(difuncs) |
||
251 | iter-sizes := $(patsubst %,4,$(sifuncs) $(difuncs)) $(patsubst %,8,$(tifuncs)) |
||
252 | |||
253 | |||
254 | |||
255 | |||
256 | endif |
||
257 | |||
258 | |||
259 | # Provide default flags for compiling divmod functions, if they haven't been |
||
260 | # set already by a target-specific Makefile fragment. |
||
261 | LIB2_DIVMOD_EXCEPTION_FLAGS := -fexceptions -fnon-call-exceptions |
||
262 | endif |
||
263 | |||
264 | |||
265 | lib2-divmod-o = $(patsubst %,%$(objext),$(LIB2_DIVMOD_FUNCS)) |
||
266 | $(lib2-divmod-o): %$(objext): libgcc2.c |
||
267 | $(gcc_compile) -DL$* -c $< $(LIB2_DIVMOD_EXCEPTION_FLAGS) -o $@ |
||
268 | libgcc-objects += $(lib2-divmod-o) |
||
269 | |||
270 | |||
6517 | serge | 271 | # _sf_to_tf and _df_to_tf require tp-bit.c being compiled in. |
272 | FPBIT_FUNCS := $(filter-out _sf_to_tf,$(FPBIT_FUNCS)) |
||
273 | DPBIT_FUNCS := $(filter-out _df_to_tf,$(DPBIT_FUNCS)) |
||
274 | endif |
||
275 | |||
276 | |||
277 | DPBIT_FUNCS := $(filter-out $(LIB2FUNCS_EXCLUDE),$(DPBIT_FUNCS)) |
||
278 | TPBIT_FUNCS := $(filter-out $(LIB2FUNCS_EXCLUDE),$(TPBIT_FUNCS)) |
||
279 | |||
280 | |||
281 | |||
282 | |||
283 | ifneq ($(FPBIT),) |
||
284 | fpbit-o = $(patsubst %,%$(objext),$(FPBIT_FUNCS)) |
||
285 | $(fpbit-o): %$(objext): $(fpbit-src) |
||
286 | $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DFLOAT $(FPBIT_CFLAGS) -c $< -o $@ |
||
287 | libgcc-objects += $(fpbit-o) |
||
288 | endif |
||
289 | |||
290 | |||
291 | ifneq ($(DPBIT),) |
||
292 | dpbit-o = $(patsubst %,%$(objext),$(DPBIT_FUNCS)) |
||
293 | $(dpbit-o): %$(objext): $(fpbit-src) |
||
294 | $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* $(DPBIT_CFLAGS) -c $< -o $@ |
||
295 | libgcc-objects += $(dpbit-o) |
||
296 | endif |
||
297 | |||
298 | |||
299 | ifneq ($(TPBIT),) |
||
300 | tpbit-o = $(patsubst %,%$(objext),$(TPBIT_FUNCS)) |
||
301 | $(tpbit-o): %$(objext): $(fpbit-src) |
||
302 | $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DTFLOAT $(TPBIT_CFLAGS) -c $< -o $@ |
||
303 | libgcc-objects += $(tpbit-o) |
||
304 | endif |
||
305 | |||
306 | |||
6518 | serge | 307 | ifeq ($(decimal_float),yes) |
308 | |||
309 | |||
310 | ifneq ($(DFP_ENABLE),) |
||
311 | D32PBIT = 1 |
||
312 | D64PBIT = 1 |
||
313 | D128PBIT = 1 |
||
314 | endif |
||
315 | |||
316 | |||
317 | ifneq ($(D32PBIT)$(D64PBIT)$(D128PBIT),) |
||
318 | ifeq ($(enable_decimal_float),bid) |
||
319 | dfp-filenames += bid_decimal_globals bid_decimal_data \ |
||
320 | bid_binarydecimal bid_convert_data \ |
||
321 | _isinfd32 _isinfd64 _isinfd128 bid64_noncomp \ |
||
322 | bid128_noncomp bid128_fma bid_round bid_from_int \ |
||
323 | bid64_add bid128_add bid64_div bid128_div \ |
||
324 | bid64_mul bid128_mul bid64_compare bid128_compare \ |
||
325 | bid128 bid32_to_bid64 bid32_to_bid128 bid64_to_bid128 \ |
||
326 | bid64_to_int32 bid64_to_int64 \ |
||
327 | bid64_to_uint32 bid64_to_uint64 \ |
||
328 | bid128_to_int32 bid128_to_int64 \ |
||
329 | bid128_to_uint32 bid128_to_uint64 |
||
330 | else |
||
331 | dfp-filenames += decContext decNumber decExcept decRound decLibrary decDouble decPacked decQuad decSingle |
||
332 | endif |
||
333 | endif |
||
334 | |||
335 | |||
336 | |||
337 | ifeq ($(enable_decimal_float),bid) |
||
338 | $(dfp-objects): %$(objext): config/libbid/%.c |
||
339 | else |
||
340 | $(dfp-objects): %$(objext): ../libdecnumber/%.c |
||
341 | endif |
||
342 | $(gcc_compile) -c $< |
||
343 | libgcc-objects += $(dfp-objects) |
||
344 | |||
345 | |||
346 | ifneq ($(enable_decimal_float),bid) |
||
347 | ifneq ($(D32PBIT),) |
||
348 | decbits-filenames += decimal32 |
||
349 | endif |
||
350 | |||
351 | |||
352 | decbits-filenames += decimal64 |
||
353 | endif |
||
354 | |||
355 | |||
356 | decbits-filenames += decimal128 |
||
357 | endif |
||
358 | endif |
||
359 | |||
360 | |||
361 | ifeq ($(enable_decimal_float),bid) |
||
362 | $(decbits-objects): %$(objext): config/libbid/%.c |
||
363 | else |
||
364 | $(decbits-objects): %$(objext): ../libdecnumber/$(enable_decimal_float)/%.c |
||
365 | endif |
||
366 | $(gcc_compile) -c $< |
||
367 | libgcc-objects += $(decbits-objects) |
||
368 | |||
369 | |||
370 | |||
371 | |||
6517 | serge | 372 | D32PBIT_FUNCS = _addsub_sd _div_sd _mul_sd _plus_sd _minus_sd \ |
373 | _eq_sd _ne_sd _lt_sd _gt_sd _le_sd _ge_sd \ |
||
374 | _sd_to_si _sd_to_di _sd_to_usi _sd_to_udi \ |
||
375 | _si_to_sd _di_to_sd _usi_to_sd _udi_to_sd \ |
||
376 | _sd_to_sf _sd_to_df _sd_to_xf _sd_to_tf \ |
||
377 | _sf_to_sd _df_to_sd _xf_to_sd _tf_to_sd \ |
||
378 | _sd_to_dd _sd_to_td _unord_sd _conv_sd |
||
379 | |||
380 | |||
381 | _eq_dd _ne_dd _lt_dd _gt_dd _le_dd _ge_dd \ |
||
382 | _dd_to_si _dd_to_di _dd_to_usi _dd_to_udi \ |
||
383 | _si_to_dd _di_to_dd _usi_to_dd _udi_to_dd \ |
||
384 | _dd_to_sf _dd_to_df _dd_to_xf _dd_to_tf \ |
||
385 | _sf_to_dd _df_to_dd _xf_to_dd _tf_to_dd \ |
||
386 | _dd_to_sd _dd_to_td _unord_dd _conv_dd |
||
387 | |||
388 | |||
389 | _eq_td _ne_td _lt_td _gt_td _le_td _ge_td \ |
||
390 | _td_to_si _td_to_di _td_to_usi _td_to_udi \ |
||
391 | _si_to_td _di_to_td _usi_to_td _udi_to_td \ |
||
392 | _td_to_sf _td_to_df _td_to_xf _td_to_tf \ |
||
393 | _sf_to_td _df_to_td _xf_to_td _tf_to_td \ |
||
394 | _td_to_sd _td_to_dd _unord_td _conv_td |
||
395 | |||
396 | |||
397 | ifneq ($(D32PBIT),) |
||
398 | D32PBIT_FUNCS:=$(filter-out _plus_sd _minus_sd _conv_sd, $(D32PBIT_FUNCS)) |
||
399 | endif |
||
400 | |||
401 | |||
402 | D64PBIT_FUNCS:=$(filter-out _plus_dd _minus_dd _conv_dd, $(D64PBIT_FUNCS)) |
||
403 | endif |
||
404 | |||
405 | |||
406 | D128PBIT_FUNCS:=$(filter-out _plus_td _minus_td _conv_td, $(D128PBIT_FUNCS)) |
||
407 | endif |
||
408 | endif |
||
409 | |||
410 | |||
411 | d32pbit-o = $(patsubst %,%$(objext),$(D32PBIT_FUNCS)) |
||
412 | ifeq ($(enable_decimal_float),bid) |
||
413 | $(d32pbit-o): %$(objext): config/libbid/%.c |
||
414 | else |
||
415 | $(d32pbit-o): %$(objext): $(srcdir)/dfp-bit.c |
||
416 | endif |
||
417 | $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DWIDTH=32 -c $< -o $@ |
||
418 | libgcc-objects += $(d32pbit-o) |
||
419 | endif |
||
420 | |||
421 | |||
422 | d64pbit-o = $(patsubst %,%$(objext),$(D64PBIT_FUNCS)) |
||
423 | ifeq ($(enable_decimal_float),bid) |
||
424 | $(d64pbit-o): %$(objext): config/libbid/%.c |
||
425 | else |
||
426 | $(d64pbit-o): %$(objext): $(srcdir)/dfp-bit.c |
||
427 | endif |
||
428 | $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DWIDTH=64 -c $< |
||
429 | libgcc-objects += $(d64pbit-o) |
||
430 | endif |
||
431 | |||
432 | |||
433 | d128pbit-o = $(patsubst %,%$(objext),$(D128PBIT_FUNCS)) |
||
434 | ifeq ($(enable_decimal_float),bid) |
||
435 | $(d128pbit-o): %$(objext): config/libbid/%.c |
||
436 | else |
||
437 | $(d128pbit-o): %$(objext): $(srcdir)/dfp-bit.c |
||
438 | endif |
||
439 | $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DWIDTH=128 -c $< |
||
440 | libgcc-objects += $(d128pbit-o) |
||
441 | endif |
||
442 | |||
443 | |||
6518 | serge | 444 | |
445 | |||
446 | ifneq ($(filter-out %.c %.S %.asm,$(LIB2ADD) $(LIB2ADD_ST)),) |
||
447 | $(error Unsupported files in LIB2ADD or LIB2ADD_ST.) |
||
448 | endif |
||
449 | |||
450 | |||
451 | libgcc-objects += $(addsuffix $(objext),$(basename $(notdir $(LIB2ADD_ST)))) |
||
6521 | serge | 452 | |
6518 | serge | 453 | |
454 | iter-items := $(LIB2ADD) $(LIB2ADD_ST) |
||
455 | include $(iterator) |
||
456 | |||
457 | |||
458 | |||
459 | |||
6520 | serge | 460 | |
6518 | serge | 461 | |
462 | include $(iterator) |
||
463 | |||
464 | |||
465 | |||
6515 | serge | 466 | |
467 | |||
468 | |||
469 | |||
6518 | serge | 470 | $(AR) crs libgcc.a $(libgcc-objects) |
471 | |||
6515 | serge | 472 | |
6553 | serge | 473 | mv -f libgcc.a $(INSTALLDIR)/libgcc.a |
474 | libgcc-objects> |
||
6515 | serge | 475 | |
6553 | serge | 476 | |
6515 | serge | 477 |