Subversion Repositories Kolibri OS

Rev

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