Subversion Repositories Kolibri OS

Rev

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