summaryrefslogtreecommitdiff
path: root/util/crossgcc/patches/gcc-5.3.0_libgcc.patch
blob: fd4b2545db5eead34e95ea1aa860282603b27608 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
diff -urN gcc-5.2.0.orig/libgcc/config/t-hardfp gcc-5.2.0/libgcc/config/t-hardfp
--- gcc-5.2.0.orig/libgcc/config/t-hardfp	2015-01-05 04:33:28.000000000 -0800
+++ gcc-5.3.0/libgcc/config/t-hardfp	2016-04-06 12:04:51.000000000 -0700
@@ -59,21 +59,52 @@
 
 hardfp_func_list := $(filter-out $(hardfp_exclusions),$(hardfp_func_list))
 
+HOST_OS ?= $(shell uname)
+
 # Regexp for matching a floating-point mode.
+ifeq ($(HOST_OS), Darwin)
+hardfp_mode_regexp := $(shell echo $(hardfp_float_modes) | sed 's/ /|/g')
+else
+ifeq ($(HOST_OS), FreeBSD)
+hardfp_mode_regexp := $(shell echo $(hardfp_float_modes) | sed 's/ /|/g')
+else
 hardfp_mode_regexp := $(shell echo $(hardfp_float_modes) | sed 's/ /\\|/g')
+endif
+endif
 
 # Regexp for matching the end of a function name, after the last
 # floating-point mode.
+ifeq ($(HOST_OS), Darwin)
+hardfp_suffix_regexp := $(shell echo $(hardfp_int_modes) 2 3 | sed 's/ /|/g')
+else
+ifeq ($(HOST_OS), FreeBSD)
+hardfp_suffix_regexp := $(shell echo $(hardfp_int_modes) 2 3 | sed 's/ /|/g')
+else
 hardfp_suffix_regexp := $(shell echo $(hardfp_int_modes) 2 3 | sed 's/ /\\|/g')
+endif
+endif
 
 # Add -D options to define:
 #   FUNC: the function name (e.g. __addsf3)
 #   OP:   the function name without the leading __ and with the last
 #            floating-point mode removed (e.g. add3)
 #   TYPE: the last floating-point mode (e.g. sf)
+
+ifeq ($(HOST_OS), Darwin)
 hardfp_defines_for = \
   $(shell echo $1 | \
-    sed 's/\(.*\)\($(hardfp_mode_regexp)\)\($(hardfp_suffix_regexp)\|\)$$/-DFUNC=__& -DOP_\1\3 -DTYPE=\2/')
+    sed -E 's/(.*)($(hardfp_mode_regexp))($(hardfp_suffix_regexp)|.*)$$/-DFUNC=__& -DOP_\1\3 -DTYPE=\2/')
+else
+ifeq ($(HOST_OS), FreeBSD)
+hardfp_defines_for = \
+  $(shell echo $1 | \
+    sed -r 's/(.*)($(hardfp_mode_regexp))($(hardfp_suffix_regexp)|.*)$$/-DFUNC=__& -DOP_\1\3 -DTYPE=\2/')
+else
+hardfp_defines_for = \
+  $(shell echo $1 | \
+    sed 's/\(.*\)\($(hardfp_mode_regexp)\)\($(hardfp_suffix_regexp)\|\)$$/-DFUNC=__& -DOP_\1\3 -DTYPE=\2/')
+endif
+endif
 
 hardfp-o = $(patsubst %,%$(objext),$(hardfp_func_list))
 $(hardfp-o): %$(objext): $(srcdir)/config/hardfp.c