Hi, this patch adds support for LIB2FUNCS_EXCLUDE to the objects generated from fixed-bit.c
Currently the backend has no means to filter out undesired functions like it is possible with LIB2FUNCS_EXCLUDE for the functions/objects from libgcc2.c I am planning to add fixed-point support for the avr port. Several functions use hand-written assembler and use non-ABI interfaces to cooperate with gcc. Therefore, the default ABI function that has the same name must not be used. The patch is tested against my local copy that actually adds entries like _addQQ3, _fractQQHQ etc. to LIB2FUNCS_EXCLUDE so that the list has a non-empty intersection with fixed-bit.c If the name "LIB2FUNCS_EXCLUDE" is too confusing, please suppose a different name for the variable. I chose that name because I found it straight forward and intuitive and it does not conflict with the current use. It's rather confusing if LIB2FUNCS_EXCLUDE does not work as expected... The generation of the primary lists by gen-fixed.sh is not changed because it is not easy to pass down several hundreds of entries and the performance is bad. Instead, the lists are generated and processed as usual so that they are kept in sync. The respective dependencies are not generated and the objects are not added to libgcc-[s-]objects. Ok for trunk? Johann libgcc/ * Makefile.in (fixed-funcs,fixed-conv-funcs): filter-out LIB2FUNCS_EXCLUDE before adding them to libgcc-objects, libgcc-s-objects. * fixed-obj.mk: Only expand dependency if $o is not in LIB2FUNCS_EXCLUDE.
Index: Makefile.in =================================================================== --- Makefile.in (revision 190620) +++ Makefile.in (working copy) @@ -763,9 +763,9 @@ iter-to := $(fixed-modes) include $(srcdir)/empty.mk $(patsubst %,$(srcdir)/fixed-obj.mk,$(iter-items)) # Add arithmetic functions to list of objects to be built -libgcc-objects += $(patsubst %,%$(objext),$(fixed-funcs)) +libgcc-objects += $(patsubst %,%$(objext),$(filter-out $(LIB2FUNCS_EXCLUDE),$(fixed-funcs))) ifeq ($(enable_shared),yes) -libgcc-s-objects += $(patsubst %,%_s$(objext),$(fixed-funcs)) +libgcc-s-objects += $(patsubst %,%_s$(objext),$(filter-out $(LIB2FUNCS_EXCLUDE),$(fixed-funcs))) endif # Convert from or to fractional @@ -782,9 +782,9 @@ iter-to := $(fixed-conv-to) include $(srcdir)/empty.mk $(patsubst %,$(srcdir)/fixed-obj.mk,$(iter-items)) # Add conversion functions to list of objects to be built -libgcc-objects += $(patsubst %,%$(objext),$(fixed-conv-funcs)) +libgcc-objects += $(patsubst %,%$(objext),$(filter-out $(LIB2FUNCS_EXCLUDE),$(fixed-conv-funcs))) ifeq ($(enable_shared),yes) -libgcc-s-objects += $(patsubst %,%_s$(objext),$(fixed-conv-funcs)) +libgcc-s-objects += $(patsubst %,%_s$(objext),$(filter-out $(LIB2FUNCS_EXCLUDE),$(fixed-conv-funcs))) endif endif Index: fixed-obj.mk =================================================================== --- fixed-obj.mk (revision 190620) +++ fixed-obj.mk (working copy) @@ -22,6 +22,7 @@ endif #$(info $o$(objext): -DL$($o-label) $($o-opt)) +ifneq ($o,$(filter $o,$(LIB2FUNCS_EXCLUDE))) $o$(objext): %$(objext): $(srcdir)/fixed-bit.c $(gcc_compile) -DL$($*-label) $($*-opt) -c $(srcdir)/fixed-bit.c $(vis_hide) @@ -29,3 +30,4 @@ ifeq ($(enable_shared),yes) $(o)_s$(objext): %_s$(objext): $(srcdir)/fixed-bit.c $(gcc_s_compile) -DL$($*-label) $($*-opt) -c $(srcdir)/fixed-bit.c endif +endif