--- libgcc/config/t-hardfp.orig 2017-01-01 23:07:43.000000000 +1100 +++ libgcc/config/t-hardfp 2017-05-18 13:25:46.910783000 +1000 @@ -59,12 +59,16 @@ hardfp_func_list := $(filter-out $(hardfp_exclusions),$(hardfp_func_list)) +hardfp_suffixes := $(hardfp_int_modes) 2 3 + # Regexp for matching a floating-point mode. hardfp_mode_regexp := $(shell echo $(hardfp_float_modes) | sed 's/ /\\|/g') +hardfp_mode_regexp_awk := $(shell echo $(hardfp_float_modes) | sed 's/ /|/g') # Regexp for matching the end of a function name, after the last # floating-point mode. -hardfp_suffix_regexp := $(shell echo $(hardfp_int_modes) 2 3 | sed 's/ /\\|/g') +hardfp_suffix_regexp := $(shell echo $(hardfp_suffixes) | sed 's/ /\\|/g') +hardfp_suffix_regexp_awk := $(shell echo $(hardfp_suffixes) | sed 's/ /|/g') # Add -D options to define: # FUNC: the function name (e.g. __addsf3) @@ -73,12 +77,20 @@ # TYPE: the last floating-point mode (e.g. sf) hardfp_defines_for = \ $(shell echo $1 | \ - sed 's/\(.*\)\($(hardfp_mode_regexp)\)\($(hardfp_suffix_regexp)\|\)$$/-DFUNC=__& -DOP_\1\3 -DTYPE=\2/') + $(AWK) 'BEGIN{split("$(hardfp_mode_regexp_awk)",mode,"|"); \ + split("$(hardfp_suffix_regexp_awk)",suffix,"|")} \ + { sfx=""; for (s in suffix) if (match($$0, suffix[s]"$$")) { sfx=suffix[s]; break; } \ + o=substr($$0,0,length($$0)-length(sfx)); \ + for (m in mode) { if (match(o, mode[m]"$$")) { \ + op=substr(o,0,length(o)-length(mode[m])); \ + print"-DFUNC=__"$$0" -DOP_" op sfx" -DTYPE="mode[m];exit; }}}') hardfp-o = $(patsubst %,%$(objext),$(hardfp_func_list)) $(hardfp-o): %$(objext): $(srcdir)/config/hardfp.c @echo "Mode = $(hardfp_mode_regexp)" @echo "Suffix = $(hardfp_suffix_regexp)" + $(info $(call hardfp_defines_for, $*)) + $(info $$*=$*) $(gcc_compile) $(call hardfp_defines_for, $*) -c $< $(vis_hide) -Wno-missing-prototypes libgcc-objects += $(hardfp-o)