summaryrefslogtreecommitdiff
path: root/icu-Add-sw64-architecture-compat.patch
blob: d9f639b37e9050360bfeec1afc4494f5e34c14bc (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
From a4fb55ae3de789cf645d4939ed8af9dbaad242ce Mon Sep 17 00:00:00 2001
From: wuzx <wuzx1226@qq.com>
Date: Fri, 18 Nov 2022 02:53:10 +0800
Subject: [PATCH] Add sw64 architecture

Signed-off-by: wuzx <wuzx1226@qq.com>
---
 source/acinclude.m4                   |  6 ++
 source/config.guess                   |  8 +++
 source/config.sub                     |  2 +
 source/config/mh-sw_64-linux-cc       | 87 +++++++++++++++++++++++++++
 source/config/mh-sw_64-linux-gcc      | 85 ++++++++++++++++++++++++++
 source/configure                      |  8 ++-
 source/configure.ac                   |  2 +-
 source/i18n/double-conversion-utils.h |  2 +-
 8 files changed, 197 insertions(+), 3 deletions(-)
 create mode 100644 source/config/mh-sw_64-linux-cc
 create mode 100644 source/config/mh-sw_64-linux-gcc

diff --git a/source/acinclude.m4 b/source/acinclude.m4
index 507f41f..381a91f 100644
--- a/source/acinclude.m4
+++ b/source/acinclude.m4
@@ -21,6 +21,12 @@ case "${host}" in
 	else
 		icu_cv_host_frag=mh-solaris
 	fi ;;
+sw_64*-*-linux-gnu)
+	if test "$GCC" = yes; then
+		icu_cv_host_frag=mh-sw_64-linux-gcc
+	else
+		icu_cv_host_frag=mh-sw_64-linux-cc
+	fi ;;
 alpha*-*-linux-gnu)
 	if test "$GCC" = yes; then
 		icu_cv_host_frag=mh-alpha-linux-gcc
diff --git a/source/config.guess b/source/config.guess
index 31e01ef..1dfe5d5 100644
--- a/source/config.guess
+++ b/source/config.guess
@@ -894,6 +894,14 @@ EOF
 	UNAME_MACHINE=aarch64_be
 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
+    sw_64:Linux:*:*)
+	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+	  SW)   UNAME_MACHINE=sw_64 ;;
+	esac
+	objdump --private-headers /bin/sh | grep -q ld.so.1
+	if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
+	echo ${UNAME_MACHINE}-sunway-linux-${LIBC}
+	exit ;;
     alpha:Linux:*:*)
 	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
 	  EV5)   UNAME_MACHINE=alphaev5 ;;
diff --git a/source/config.sub b/source/config.sub
index fb57947..07dc65e 100644
--- a/source/config.sub
+++ b/source/config.sub
@@ -244,6 +244,7 @@ case $basic_machine in
 	# Some are omitted here because they have special meanings below.
 	1750a | 580 \
 	| a29k \
+	| sw_64 \
 	| aarch64 | aarch64_be \
 	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
 	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
@@ -368,6 +369,7 @@ case $basic_machine in
 	# Recognize the basic CPU types with company name.
 	580-* \
 	| a29k-* \
+	| sw_64-* \
 	| aarch64-* | aarch64_be-* \
 	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
 	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
diff --git a/source/config/mh-sw_64-linux-cc b/source/config/mh-sw_64-linux-cc
new file mode 100644
index 0000000..f27259a
--- /dev/null
+++ b/source/config/mh-sw_64-linux-cc
@@ -0,0 +1,87 @@
+## -*-makefile-*-
+## Copyright (C) 2016 and later: Unicode, Inc. and others.
+## License & terms of use: http://www.unicode.org/copyright.html
+## Sw-64-Linux-specific setup
+## Copyright (c) 1999-2006, International Business Machines Corporation and
+## others. All Rights Reserved.
+
+## Commands to generate dependency files
+#GEN_DEPS.c=	$(CC) $(DEFS) $(CPPFLAGS) -MD -c -msg_quiet
+#GEN_DEPS.cc=	$(CXX) $(DEFS) $(CPPFLAGS) -D__USE_STD_IOSTREAM -c -MD -msg_quiet
+
+## Flags for position independent code
+SHAREDLIBCFLAGS = -fPIC
+SHAREDLIBCXXFLAGS = -fPIC
+SHAREDLIBCPPFLAGS = -DPIC
+
+## Additional flags when building libraries and with threads
+THREADSCPPFLAGS = -D_REENTRANT
+LIBCPPFLAGS =
+
+# The tests need complete IEEE floating point support
+CFLAGS += -ieee
+CXXFLAGS += -ieee
+
+## Commands to compile
+COMPILE.c=	$(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS)  -c -signed -accept nogccinline
+COMPILE.cc=	$(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) -c -signed -D__USE_STD_IOSTREAM -accept nogcc_inline
+
+
+## Commands to link
+LINK.c=		$(CC) -call_shared $(CFLAGS) $(LDFLAGS)
+LINK.cc=	$(CXX) -call_shared $(CXXFLAGS) $(LDFLAGS)
+
+## Compiler switch to embed a runtime search path
+LD_RPATH=
+LD_RPATH_PRE=	-Wl,-rpath,
+
+## Compiler switch to embed a library name
+LD_SONAME = -Wl,-soname -Wl,$(notdir $(MIDDLE_SO_TARGET))
+
+## Shared object suffix
+SO = so
+## Non-shared intermediate object suffix
+STATIC_O = ao
+
+## Compilation rules
+%.$(STATIC_O): $(srcdir)/%.c
+	$(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
+%.o: $(srcdir)/%.c
+	$(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
+
+%.$(STATIC_O): $(srcdir)/%.cpp
+	$(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
+%.o: $(srcdir)/%.cpp
+	$(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
+
+
+## Dependency rules
+#%.d: $(srcdir)/%.c
+#	@echo "generating dependency information for $<"
+#	@$(SHELL) -ec '$(GEN_DEPS.c) $< \
+#		| sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \
+#		[ -s $@ ] || rm -f $@'
+
+#%.d: $(srcdir)/%.cpp
+#	@echo "generating dependency information for $<"
+#	@$(SHELL) -ec '$(GEN_DEPS.cc) $< \
+#		| sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \
+#		[ -s $@ ] || rm -f $@'
+#
+## Versioned libraries rules
+
+%.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION)
+	$(RM) $@ && ln -s ${<F} $@
+%.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR)
+	$(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@
+
+##  Bind internal references
+
+# LDflags that pkgdata will use
+BIR_LDFLAGS= -Wl,-Bsymbolic
+
+# Dependencies [i.e. map files] for the final library
+BIR_DEPS=
+
+## End Linux-specific setup
+
diff --git a/source/config/mh-sw_64-linux-gcc b/source/config/mh-sw_64-linux-gcc
new file mode 100644
index 0000000..a3531d2
--- /dev/null
+++ b/source/config/mh-sw_64-linux-gcc
@@ -0,0 +1,85 @@
+## -*-makefile-*-
+## Copyright (C) 2016 and later: Unicode, Inc. and others.
+## License & terms of use: http://www.unicode.org/copyright.html
+## Linux-specific setup
+## Copyright (c) 1999-2009, International Business Machines Corporation and
+## others. All Rights Reserved.
+
+## Commands to generate dependency files
+GEN_DEPS.c=	$(CC) -E -MM $(DEFS) $(CPPFLAGS)
+GEN_DEPS.cc=	$(CXX) -E -MM $(DEFS) $(CPPFLAGS)
+
+## Flags for position independent code
+SHAREDLIBCFLAGS = -fPIC
+SHAREDLIBCXXFLAGS = -fPIC
+SHAREDLIBCPPFLAGS = -DPIC
+
+## Additional flags when building libraries and with threads
+THREADSCPPFLAGS = -D_REENTRANT
+LIBCPPFLAGS =
+
+# The tests need complete IEEE floating point support
+CFLAGS += -mieee
+CXXFLAGS += -mieee
+
+## Compiler switch to embed a runtime search path
+LD_RPATH=	
+LD_RPATH_PRE=	-Wl,-rpath,
+
+## Compiler switch to embed a library name
+LD_SONAME = -Wl,-soname -Wl,$(notdir $(MIDDLE_SO_TARGET))
+
+
+## Shared library options
+LD_SOOPTIONS= -Wl,-Bsymbolic
+
+## Shared object suffix
+SO = so
+## Non-shared intermediate object suffix
+STATIC_O = ao
+
+## Compilation rules
+%.$(STATIC_O): $(srcdir)/%.c
+	$(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
+%.o: $(srcdir)/%.c
+	$(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
+
+%.$(STATIC_O): $(srcdir)/%.cpp
+	$(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
+%.o: $(srcdir)/%.cpp
+	$(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
+
+
+## Dependency rules
+%.d: $(srcdir)/%.c
+	@echo "generating dependency information for $<"
+	@$(SHELL) -ec '$(GEN_DEPS.c) $< \
+		| sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \
+		[ -s $@ ] || rm -f $@'
+
+%.d: $(srcdir)/%.cpp
+	@echo "generating dependency information for $<"
+	@$(SHELL) -ec '$(GEN_DEPS.cc) $< \
+		| sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \
+		[ -s $@ ] || rm -f $@'
+
+## Versioned libraries rules
+
+%.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION)
+	$(RM) $@ && ln -s ${<F} $@
+%.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR)
+	$(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@
+
+# The type of assembly to write for generating an object file
+GENCCODE_ASSEMBLY=-a gcc
+
+##  Bind internal references
+
+# LDflags that pkgdata will use
+BIR_LDFLAGS= -Wl,-Bsymbolic
+
+# Dependencies [i.e. map files] for the final library
+BIR_DEPS=
+
+## End Linux-specific setup
+
diff --git a/source/configure b/source/configure
index a2ff7e4..a190250 100755
--- a/source/configure
+++ b/source/configure
@@ -5249,6 +5249,12 @@ case "${host}" in
 	else
 		icu_cv_host_frag=mh-solaris
 	fi ;;
+sw_64*-*-linux-gnu)
+	if test "$GCC" = yes; then
+		icu_cv_host_frag=mh-sw_64-linux-gcc
+	else
+		icu_cv_host_frag=mh-sw_64-linux-cc
+	fi ;;
 alpha*-*-linux-gnu)
 	if test "$GCC" = yes; then
 		icu_cv_host_frag=mh-alpha-linux-gcc
@@ -6511,7 +6517,7 @@ if test "$CC" = ccc; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"C compiler set to CCC ${CC}\" " >&5
 $as_echo "\"C compiler set to CCC ${CC}\" " >&6; }
  case "${host}" in
-        alpha*-*-*) U_HAVE_INTTYPES_H=0;
+        alpha*-*-* | sw_64*-*-*) U_HAVE_INTTYPES_H=0;
         CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_INTTYPES_H=0"
  esac
 fi
diff --git a/source/configure.ac b/source/configure.ac
index 425fdc7..6acf133 100644
--- a/source/configure.ac
+++ b/source/configure.ac
@@ -685,7 +685,7 @@ fi
 if test "$CC" = ccc; then
  AC_MSG_RESULT("C compiler set to CCC ${CC}" )
  case "${host}" in
-        alpha*-*-*) U_HAVE_INTTYPES_H=0;
+        alpha*-*-* | sw_64*-*-*) U_HAVE_INTTYPES_H=0;
         CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_INTTYPES_H=0"
  esac
 fi
diff --git a/source/i18n/double-conversion-utils.h b/source/i18n/double-conversion-utils.h
index c937463..7dcdbf8 100644
--- a/source/i18n/double-conversion-utils.h
+++ b/source/i18n/double-conversion-utils.h
@@ -122,7 +122,7 @@ int main(int argc, char** argv) {
     defined(__powerpc__) || defined(__ppc__) || defined(__ppc64__) || \
     defined(_POWER) || defined(_ARCH_PPC) || defined(_ARCH_PPC64) || \
     defined(__sparc__) || defined(__sparc) || defined(__s390__) || \
-    defined(__SH4__) || defined(__alpha__) || \
+    defined(__SH4__) || defined(__alpha__) || defined(__sw_64__) || \
     defined(_MIPS_ARCH_MIPS32R2) || defined(__ARMEB__) ||\
     defined(__AARCH64EL__) || defined(__aarch64__) || defined(__AARCH64EB__) || \
     defined(__riscv) || defined(__e2k__) || \
-- 
2.33.0