1 This enables building on Mac OS and FreeBSD by adding support to their
2 variants of the sed utility.
4 diff -urN gcc-5.2.0.orig/libgcc/config/t-hardfp gcc-5.2.0/libgcc/config/t-hardfp
5 --- gcc-5.2.0.orig/libgcc/config/t-hardfp 2015-01-05 04:33:28.000000000 -0800
6 +++ gcc-8.1.0/libgcc/config/t-hardfp 2016-04-06 12:04:51.000000000 -0700
9 hardfp_func_list := $(filter-out $(hardfp_exclusions),$(hardfp_func_list))
11 +HOST_OS ?= $(shell uname)
13 # Regexp for matching a floating-point mode.
14 +ifeq ($(HOST_OS), Darwin)
15 +hardfp_mode_regexp := $(shell echo $(hardfp_float_modes) | sed 's/ /|/g')
17 +ifeq ($(HOST_OS), FreeBSD)
18 +hardfp_mode_regexp := $(shell echo $(hardfp_float_modes) | sed 's/ /|/g')
20 hardfp_mode_regexp := $(shell echo $(hardfp_float_modes) | sed 's/ /\\|/g')
24 # Regexp for matching the end of a function name, after the last
25 # floating-point mode.
26 +ifeq ($(HOST_OS), Darwin)
27 +hardfp_suffix_regexp := $(shell echo $(hardfp_int_modes) 2 3 | sed 's/ /|/g')
29 +ifeq ($(HOST_OS), FreeBSD)
30 +hardfp_suffix_regexp := $(shell echo $(hardfp_int_modes) 2 3 | sed 's/ /|/g')
32 hardfp_suffix_regexp := $(shell echo $(hardfp_int_modes) 2 3 | sed 's/ /\\|/g')
36 # Add -D options to define:
37 # FUNC: the function name (e.g. __addsf3)
38 # OP: the function name without the leading __ and with the last
39 # floating-point mode removed (e.g. add3)
40 # TYPE: the last floating-point mode (e.g. sf)
42 +ifeq ($(HOST_OS), Darwin)
43 hardfp_defines_for = \
45 - sed 's/\(.*\)\($(hardfp_mode_regexp)\)\($(hardfp_suffix_regexp)\|\)$$/-DFUNC=__& -DOP_\1\3 -DTYPE=\2/')
46 + sed -E 's/(.*)($(hardfp_mode_regexp))($(hardfp_suffix_regexp)|.*)$$/-DFUNC=__& -DOP_\1\3 -DTYPE=\2/')
48 +ifeq ($(HOST_OS), FreeBSD)
49 +hardfp_defines_for = \
51 + sed -r 's/(.*)($(hardfp_mode_regexp))($(hardfp_suffix_regexp)|.*)$$/-DFUNC=__& -DOP_\1\3 -DTYPE=\2/')
53 +hardfp_defines_for = \
55 + sed 's/\(.*\)\($(hardfp_mode_regexp)\)\($(hardfp_suffix_regexp)\|\)$$/-DFUNC=__& -DOP_\1\3 -DTYPE=\2/')
59 hardfp-o = $(patsubst %,%$(objext),$(hardfp_func_list))
60 $(hardfp-o): %$(objext): $(srcdir)/config/hardfp.c