Subversion Repositories Kolibri OS

Rev

Rev 6519 | Rev 6521 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

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