6,36 → 6,46 |
|
export SDK_DIR:= $(abspath ../../../../sdk) |
|
cpu_type = i386 |
enable_shared = no |
double_type_size = 64 |
long_double_type_size = 96 |
decimal_float = yes |
enable_vtable_verify = no |
enable_decimal_float = bid |
fixed_point = no |
|
FPBIT = true |
|
DPBIT = true |
D32PBIT = 1 |
D64PBIT = 1 |
D128PBIT = 1 |
#FPBIT = true |
|
# List of functions not to build from libgcc2.c. |
#DPBIT = true |
|
LIB2FUNCS_EXCLUDE = |
|
|
CFLAGS_OPT+= -fomit-frame-pointer -fno-ident -mno-ms-bitfields |
CFLAGS_OPT+= -fbuilding-libgcc -fno-stack-protector |
|
CFLAGS = -c -O2 -DIN_GCC -DIN_LIBGCC2 -DHAVE_CC_TLS -DUSE_EMUTLS -DENABLE_DECIMAL_BID_FORMAT |
CFLAGS = -c -O2 -DIN_GCC -DIN_LIBGCC2 -DHAVE_CC_TLS -DUSE_EMUTLS |
CFLAGS+= -U_Win32 -U_WIN32 -U__MINGW32__ -UWIN32 -U_MSC_VER |
CFLAGS+= -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes |
CFLAGS+= -Wmissing-prototypes -Wold-style-definition $(CFLAGS_OPT) |
CFLAGS+= -Wold-style-definition $(CFLAGS_OPT) |
|
INCLUDES = -I. -I../gcc -I../include |
DECNUMINC = -Iconfig/libbid -DENABLE_DECIMAL_BID_FORMAT |
|
INCLUDES = -I. -I../gcc -I../include $(DECNUMINC) |
|
gcc_compile = $(CC) $(INCLUDES) $(CFLAGS) |
|
# Defined in libgcc2.c, included only in the static library. |
LIB2FUNCS_ST = _eprintf __gcc_bcmp |
|
# List of functions not to build from libgcc2.c. |
LIB2FUNCS_EXCLUDE = |
|
# These might cause a divide overflow trap and so are compiled with |
# unwinder info. |
LIB2_DIVMOD_FUNCS = _divdi3 _moddi3 _udivdi3 _umoddi3 _udiv_w_sdiv _udivmoddi4 |
|
|
|
objext = .o |
|
FPBIT_FUNCS = _pack_sf _unpack_sf _addsub_sf _mul_sf _div_sf \ |
53,7 → 63,128 |
_lt_tf _le_tf _unord_tf _si_to_tf _tf_to_si _negate_tf _make_tf \ |
_tf_to_df _tf_to_sf _thenan_tf _tf_to_usi _usi_to_tf |
|
# Additional sources to handle exceptions; overridden by targets as needed. |
LIB2ADDEH = unwind-dw2.c unwind-dw2-fde.c unwind-sjlj.c unwind-c.c |
LIB2ADDEHSTATIC = $(LIB2ADDEH) |
|
#LIB2ADD = $(srcdir)/config/i386/gthr-win32.c |
EH_MODEL = dw2 |
CUSTOM_CRTSTUFF = yes |
|
|
crtbegin.o: $(srcdir)/config/i386/cygming-crtbegin.c |
|
$(crt_compile) -fno-omit-frame-pointer -c $< |
|
|
crtbeginS.o: $(srcdir)/config/i386/cygming-crtbegin.c |
|
$(crt_compile) -fno-omit-frame-pointer -c $< -DCRTSTUFFS_O |
|
|
# We intentionally use a implementation-reserved init priority of 0, |
|
# so allow the warning. |
|
crtend.o: $(srcdir)/config/i386/cygming-crtend.c |
|
$(crt_compile) -fno-omit-frame-pointer -Wno-error -c $< |
|
# This is an endfile, Use -minline-all-stringops to ensure |
|
# that __builtin_memset doesn't refer to the lib function memset(). |
|
crtfastmath.o: $(srcdir)/config/i386/crtfastmath.c |
|
$(gcc_compile) -mfxsr -msse -c $< |
|
LIB1ASMSRC = i386/cygwin.S |
|
LIB1ASMFUNCS = _chkstk _chkstk_ms |
|
DFP_ENABLE = true |
|
LIB2ADD += config/i386/cpuinfo.c |
|
softfp_float_modes := tf |
softfp_int_modes := si di ti |
|
softfp_extensions := sftf dftf xftf |
|
softfp_truncations := tfsf tfdf tfxf |
|
softfp_exclude_libgcc2 := n |
|
# Omit TImode functions |
|
softfp_int_modes := si di |
|
|
# Provide fallbacks for __builtin_copysignq and __builtin_fabsq. |
|
LIB2ADD += config/i386/32/tf-signs.c |
|
# While emutls.c has nothing to do with EH, it is in LIB2ADDEH* |
# instead of LIB2ADD because that's the way to be sure on some targets |
# (e.g. *-*-darwin*) only one copy of it is linked. |
LIB2ADDEH += emutls.c |
LIB2ADDEHSTATIC += emutls.c |
|
|
softfp_float_funcs = add$(m)3 div$(m)3 eq$(m)2 ge$(m)2 le$(m)2 mul$(m)3 \ |
neg$(m)2 sub$(m)3 unord$(m)2 |
softfp_floatint_funcs = fix$(m)$(i) fixuns$(m)$(i) \ |
float$(i)$(m) floatun$(i)$(m) |
|
softfp_func_list := \ |
$(foreach m,$(softfp_float_modes), \ |
$(softfp_float_funcs) \ |
$(foreach i,$(softfp_int_modes), \ |
$(softfp_floatint_funcs))) \ |
$(foreach e,$(softfp_extensions),extend$(e)2) \ |
$(foreach t,$(softfp_truncations),trunc$(t)2) \ |
$(softfp_extras) |
|
ifeq ($(softfp_exclude_libgcc2),y) |
# This list is taken from mklibgcc.in and doesn't presently allow for |
# 64-bit targets where si should become di and di should become ti. |
softfp_func_list := $(filter-out floatdidf floatdisf fixunsdfsi fixunssfsi \ |
fixunsdfdi fixdfdi fixunssfdi fixsfdi fixxfdi fixunsxfdi \ |
floatdixf fixunsxfsi fixtfdi fixunstfdi floatditf \ |
floatundidf floatundisf floatundixf floatunditf,$(softfp_func_list)) |
endif |
|
softfp_file_list := $(addsuffix .c,$(addprefix soft-fp/,$(softfp_func_list))) |
|
# Disable missing prototype and type limit warnings. The prototypes |
# for the functions in the soft-fp files have not been brought across |
# from glibc. |
|
soft-fp-objects-base = $(basename $(notdir $(softfp_file_list))) |
|
soft-fp-objects = $(addsuffix $(objext), $(soft-fp-objects-base)) \ |
$(addsuffix _s$(objext), $(soft-fp-objects-base)) |
|
$(soft-fp-objects) : INTERNAL_CFLAGS += -Wno-missing-prototypes -Wno-type-limits |
|
LIB2ADD += $(softfp_file_list) |
|
ifneq ($(softfp_exclude_libgcc2),y) |
# Functions in libgcc2.c are excluded for each soft-float mode (a |
# target may have both soft-float and hard-float modes), for the fixed |
# list of integer modes (si and di) for which libgcc2.c defines any |
# such functions. Depending on the target, the si and di symbols may |
# in fact define di and ti functions. |
|
LIB2FUNCS_EXCLUDE += \ |
$(addprefix _,$(foreach m,$(softfp_float_modes), \ |
$(foreach i,si di, \ |
$(softfp_floatint_funcs)))) |
endif |
|
iterator = empty.mk $(patsubst %,static-object.mk,$(iter-items)) |
|
|
lib2funcs = _muldi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3 _cmpdi2 _ucmpdi2 \ |
_clear_cache _trampoline __main _absvsi2 _absvdi2 _addvsi3 \ |
_addvdi3 _subvsi3 _subvdi3 _mulvsi3 _mulvdi3 _negvsi2 _negvdi2 \ |
70,16 → 201,60 |
$(patsubst %,_floatXX%,sf df xf tf) \ |
$(patsubst %,_floatunXX%,sf df xf tf) |
|
ifeq ($(LIB2_SIDITI_CONV_FUNCS),) |
lib2funcs += $(subst XX,si,$(swfloatfuncs)) |
lib2funcs += $(subst XX,di,$(dwfloatfuncs)) |
endif |
|
# These might cause a divide overflow trap and so are compiled with |
# unwinder info. |
LIB2_DIVMOD_FUNCS = _divdi3 _moddi3 _udivdi3 _umoddi3 _udiv_w_sdiv _udivmoddi4 |
|
# Remove any objects from lib2funcs and LIB2_DIVMOD_FUNCS that are |
# defined as optimized assembly code in LIB1ASMFUNCS or as C code |
# in LIB2FUNCS_EXCLUDE. |
lib2funcs := $(filter-out $(LIB2FUNCS_EXCLUDE) $(LIB1ASMFUNCS),$(lib2funcs)) |
LIB2_DIVMOD_FUNCS := $(filter-out $(LIB2FUNCS_EXCLUDE) $(LIB1ASMFUNCS), \ |
$(LIB2_DIVMOD_FUNCS)) |
|
|
# Build lib2funcs. For the static library also include LIB2FUNCS_ST. |
lib2funcs-o = $(patsubst %,%$(objext),$(lib2funcs) $(LIB2FUNCS_ST)) |
|
$(lib2funcs-o): %$(objext): libgcc2.c |
$(gcc_compile) -DL$* -c $< -o $@ |
libgcc-objects += $(lib2funcs-o) |
|
libgcc-objects = |
ifneq ($(LIB2_SIDITI_CONV_FUNCS),) |
# Build libgcc2.c for each conversion function, with a specific |
# L<func> definition and LIBGCC2_UNITS_PER_WORD setting. The DImode |
# functions are built with a wordsize of 4; the TImode functions are |
# built with the same labels, but a wordsize of 8. |
|
sifuncs := $(filter-out $(LIB2FUNCS_EXCLUDE),$(subst XX,si,$(swfloatfuncs))) |
difuncs := $(filter-out $(LIB2FUNCS_EXCLUDE),$(subst XX,di,$(dwfloatfuncs))) |
tifuncs := $(filter-out $(LIB2FUNCS_EXCLUDE),$(subst XX,ti,$(dwfloatfuncs))) |
|
iter-items := $(sifuncs) $(difuncs) $(tifuncs) |
iter-labels := $(sifuncs) $(difuncs) $(difuncs) |
iter-sizes := $(patsubst %,4,$(sifuncs) $(difuncs)) $(patsubst %,8,$(tifuncs)) |
|
include empty.mk $(patsubst %,siditi-object.mk,$(iter-items)) |
|
libgcc-objects += $(patsubst %,%$(objext),$(sifuncs) $(difuncs) $(tifuncs)) |
endif |
|
ifeq ($(LIB2_DIVMOD_EXCEPTION_FLAGS),) |
# Provide default flags for compiling divmod functions, if they haven't been |
# set already by a target-specific Makefile fragment. |
LIB2_DIVMOD_EXCEPTION_FLAGS := -fexceptions -fnon-call-exceptions |
endif |
|
# Build LIB2_DIVMOD_FUNCS. |
lib2-divmod-o = $(patsubst %,%$(objext),$(LIB2_DIVMOD_FUNCS)) |
$(lib2-divmod-o): %$(objext): libgcc2.c |
$(gcc_compile) -DL$* -c $< $(LIB2_DIVMOD_EXCEPTION_FLAGS) -o $@ |
libgcc-objects += $(lib2-divmod-o) |
|
ifeq ($(TPBIT),) |
# _sf_to_tf and _df_to_tf require tp-bit.c being compiled in. |
FPBIT_FUNCS := $(filter-out _sf_to_tf,$(FPBIT_FUNCS)) |
116,6 → 291,71 |
libgcc-objects += $(tpbit-o) |
endif |
|
# Build decimal floating point support. |
ifeq ($(decimal_float),yes) |
|
# If $DFP_ENABLE is set, then we want all data type sizes. |
ifneq ($(DFP_ENABLE),) |
D32PBIT = 1 |
D64PBIT = 1 |
D128PBIT = 1 |
endif |
|
dfp-filenames = |
ifneq ($(D32PBIT)$(D64PBIT)$(D128PBIT),) |
ifeq ($(enable_decimal_float),bid) |
dfp-filenames += bid_decimal_globals bid_decimal_data \ |
bid_binarydecimal bid_convert_data \ |
_isinfd32 _isinfd64 _isinfd128 bid64_noncomp \ |
bid128_noncomp bid128_fma bid_round bid_from_int \ |
bid64_add bid128_add bid64_div bid128_div \ |
bid64_mul bid128_mul bid64_compare bid128_compare \ |
bid128 bid32_to_bid64 bid32_to_bid128 bid64_to_bid128 \ |
bid64_to_int32 bid64_to_int64 \ |
bid64_to_uint32 bid64_to_uint64 \ |
bid128_to_int32 bid128_to_int64 \ |
bid128_to_uint32 bid128_to_uint64 |
else |
dfp-filenames += decContext decNumber decExcept decRound decLibrary decDouble decPacked decQuad decSingle |
endif |
endif |
|
|
dfp-objects = $(patsubst %,%$(objext),$(dfp-filenames)) |
ifeq ($(enable_decimal_float),bid) |
$(dfp-objects): %$(objext): config/libbid/%.c |
else |
$(dfp-objects): %$(objext): ../libdecnumber/%.c |
endif |
$(gcc_compile) -c $< |
libgcc-objects += $(dfp-objects) |
|
decbits-filenames = |
ifneq ($(enable_decimal_float),bid) |
ifneq ($(D32PBIT),) |
decbits-filenames += decimal32 |
endif |
|
ifneq ($(D64PBIT),) |
decbits-filenames += decimal64 |
endif |
|
ifneq ($(D128PBIT),) |
decbits-filenames += decimal128 |
endif |
endif |
|
decbits-objects = $(patsubst %,%$(objext),$(decbits-filenames)) |
ifeq ($(enable_decimal_float),bid) |
$(decbits-objects): %$(objext): config/libbid/%.c |
else |
$(decbits-objects): %$(objext): ../libdecnumber/$(enable_decimal_float)/%.c |
endif |
$(gcc_compile) -c $< |
libgcc-objects += $(decbits-objects) |
|
|
|
# Next build individual support functions. |
D32PBIT_FUNCS = _addsub_sd _div_sd _mul_sd _plus_sd _minus_sd \ |
_eq_sd _ne_sd _lt_sd _gt_sd _le_sd _ge_sd \ |
188,12 → 428,34 |
libgcc-objects += $(d128pbit-o) |
endif |
|
endif |
|
# Build LIB2ADD and LIB2ADD_ST. |
ifneq ($(filter-out %.c %.S %.asm,$(LIB2ADD) $(LIB2ADD_ST)),) |
$(error Unsupported files in LIB2ADD or LIB2ADD_ST.) |
endif |
|
libgcc-objects += $(addsuffix $(objext),$(basename $(notdir $(LIB2ADD)))) |
#libgcc-objects += $(addsuffix $(objext),$(basename $(notdir $(LIB2ADD_ST)))) |
|
c_flags := |
iter-items := $(LIB2ADD) $(LIB2ADD_ST) |
include $(iterator) |
|
c_flags := -fexceptions |
|
#libgcc-objects += $(addsuffix $(objext),$(basename $(notdir $(LIB2ADDEH)))) |
|
iter-items := $(LIB2ADDEH) |
include $(iterator) |
|
|
# targets |
|
all: libgcc.a |
|
libgcc.a : $(lib2funcs-o) $(libgcc-objects) Makefile |
$(AR) crs libgcc.a $(lib2funcs-o) $(libgcc-objects) |
libgcc.a : $(libgcc-objects) Makefile |
$(AR) crs libgcc.a $(libgcc-objects) |
# mv -f libbfd.a $(SDK_DIR)/lib |
|
|