xref: /AOO41X/main/icu/icu4c-4_2_1-src.patch (revision 0be829e89df8207c463d2783f522cb6ccd638828)
1diff -ru misc/icu/source/common/putil.c misc/build/icu/source/common/putil.c
2--- misc/icu/source/common/putil.c	2009-07-01 20:50:38.000000000 +0200
3+++ misc/build/icu/source/common/putil.c	2024-06-14 21:17:04.184218726 +0200
4@@ -52,7 +52,7 @@
5 Poorly upgraded Solaris machines can't have this defined.
6 Cleanly installed Solaris can use this #define.
7 */
8-#if !defined(_XOPEN_SOURCE_EXTENDED) && (!defined(__STDC_VERSION__) || __STDC_VERSION__ >= 199901L)
9+#if !defined(_XOPEN_SOURCE_EXTENDED) && (!defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L)
10 #define _XOPEN_SOURCE_EXTENDED 1
11 #endif
12
13diff -ru misc/icu/source/common/uloc.c misc/build/icu/source/common/uloc.c
14--- misc/icu/source/common/uloc.c	2009-07-01 20:50:38.000000000 +0200
15+++ misc/build/icu/source/common/uloc.c	2024-06-14 21:25:59.612644465 +0200
16@@ -1736,7 +1736,7 @@
17                 int32_t variantLen = _deleteVariant(variant, uprv_min(variantSize, (nameCapacity-len)), variantToCompare, n);
18                 len -= variantLen;
19                 if (variantLen > 0) {
20-                    if (name[len-1] == '_') { /* delete trailing '_' */
21+                    if (len > 0 && name[len-1] == '_') { /* delete trailing '_' */
22                         --len;
23                     }
24                     addKeyword = VARIANT_MAP[j].keyword;
25@@ -1744,7 +1744,7 @@
26                     break;
27                 }
28             }
29-            if (name[len-1] == '_') { /* delete trailing '_' */
30+            if (len > 0 && name[len-1] == '_') { /* delete trailing '_' */
31                 --len;
32             }
33         }
34diff -ru misc/icu/source/config/mh-bsd-gcc misc/build/icu/source/config/mh-bsd-gcc
35--- misc/icu/source/config/mh-bsd-gcc	2009-07-01 20:50:48.000000000 +0200
36+++ misc/build/icu/source/config/mh-bsd-gcc	2024-06-14 21:16:18.187059931 +0200
37@@ -18,8 +18,12 @@
38
39 ## Compiler switch to embed a runtime search path
40 LD_RPATH=
41-LD_RPATH_PRE=	-Wl,-rpath,
42+LD_RPATH_PRE=	-Wl,-z,origin -Wl,-rpath,
43
44+## Force RPATH=$ORIGIN to locate own dependencies w/o need for LD_LIBRARY_PATH
45+## (incl. the C++ runtime libs potentially found in the URE lib dir):
46+ENABLE_RPATH=YES
47+RPATHLDFLAGS=${LD_RPATH_PRE}'$$ORIGIN:$$ORIGIN/../ure-link/lib'
48 ## Compiler switch to embed a library name
49 LD_SONAME = -Wl,-soname -Wl,$(notdir $(MIDDLE_SO_TARGET))
50
51diff -ru misc/icu/source/config/mh-darwin misc/build/icu/source/config/mh-darwin
52--- misc/icu/source/config/mh-darwin	2009-07-01 20:50:48.000000000 +0200
53+++ misc/build/icu/source/config/mh-darwin	2024-06-14 21:19:02.155170814 +0200
54@@ -25,7 +25,7 @@
55 SHLIB.cc=	$(CXX) -dynamiclib -dynamic $(CXXFLAGS) $(LDFLAGS)
56
57 ## Compiler switches to embed a library name and version information
58-LD_SONAME = -Wl,-compatibility_version -Wl,$(SO_TARGET_VERSION_MAJOR) -Wl,-current_version -Wl,$(SO_TARGET_VERSION) -install_name $(notdir $(MIDDLE_SO_TARGET))
59+LD_SONAME = -Wl,-compatibility_version -Wl,$(SO_TARGET_VERSION_MAJOR) -Wl,-current_version -Wl,$(SO_TARGET_VERSION) -install_name @executable_path/$(notdir $(FINAL_SO_TARGET))
60
61 ## Compiler switch to embed a runtime search path
62 LD_RPATH=
63@@ -41,10 +41,6 @@
64 ## Non-shared intermediate object suffix
65 STATIC_O = ao
66
67-## Override Versioned target for a shared library.
68-FINAL_SO_TARGET=  $(basename $(SO_TARGET)).$(SO_TARGET_VERSION).$(SO)
69-MIDDLE_SO_TARGET= $(basename $(SO_TARGET)).$(SO_TARGET_VERSION_MAJOR).$(SO)
70-
71 ## Compilation rules
72 %.$(STATIC_O): $(srcdir)/%.c
73 	$(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
74@@ -76,15 +72,9 @@
75
76 ## Versioned libraries rules
77
78-%.$(SO_TARGET_VERSION_MAJOR).$(SO): %.$(SO_TARGET_VERSION).$(SO)
79+%.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION)
80 	$(RM) $@ && ln -s ${<F} $@
81-%.$(SO): %.$(SO_TARGET_VERSION_MAJOR).$(SO)
82-	$(RM) $@ && ln -s ${*F}.$(SO_TARGET_VERSION).$(SO) $@
83-
84-# tzcode option
85-TZORIG_EXTRA_CFLAGS=-DSTD_INSPIRED
86-
87-# genren opts
88-GENREN_PL_OPTS=-x Mach-O -n '-g' -p '| c++filt'
89+%.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR)
90+	$(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@
91
92 ## End Darwin-specific setup
93diff -ru misc/icu/source/config/mh-linux misc/build/icu/source/config/mh-linux
94--- misc/icu/source/config/mh-linux	2009-07-01 20:50:48.000000000 +0200
95+++ misc/build/icu/source/config/mh-linux	2024-06-14 21:19:31.827909846 +0200
96@@ -20,6 +20,11 @@
97 LD_RPATH=
98 LD_RPATH_PRE = -Wl,-rpath,
99
100+## Force RPATH=$ORIGIN to locate own dependencies w/o need for LD_LIBRARY_PATH
101+## (incl. the C++ runtime libs potentially found in the URE lib dir):
102+ENABLE_RPATH=YES
103+RPATHLDFLAGS=${LD_RPATH_PRE}'$$ORIGIN:$$ORIGIN/../ure-link/lib'
104+
105 ## These are the library specific LDFLAGS
106 LDFLAGSICUDT=-nodefaultlibs -nostdlib
107
108diff -ru misc/icu/source/config/mh-mingw misc/build/icu/source/config/mh-mingw
109--- misc/icu/source/config/mh-mingw	2009-07-01 20:50:48.000000000 +0200
110+++ misc/build/icu/source/config/mh-mingw	2024-06-14 21:20:44.741721341 +0200
111@@ -76,6 +76,8 @@
112 # Current full path directory for use in source code in a -D compiler option.
113 #CURR_SRCCODE_FULL_DIR=$(subst /,\\\\,$(shell pwd -W))#M# for MSYS
114 CURR_SRCCODE_FULL_DIR=$(subst \,/,$(shell cmd /c cd))#M# for Cygwin shell
115+SRCDIR_DEPEND=$(shell cd $(SRCDIR) && pwd)
116+DATAFILEPATHS_DEPEND=$(foreach p,$(DATAFILEPATHS),$(shell cd $(dir $(p)) && pwd)/$(notdir $(p)))
117
118 ## Compilation rules
119 %.$(STATIC_O): $(srcdir)/%.c
120diff -ru misc/icu/source/config/mh-solaris misc/build/icu/source/config/mh-solaris
121--- misc/icu/source/config/mh-solaris	2009-07-01 20:50:48.000000000 +0200
122+++ misc/build/icu/source/config/mh-solaris	2024-06-14 21:22:01.599625394 +0200
123@@ -18,17 +18,21 @@
124
125 ## Commands to link
126 ## For Sun Workshop, use CC to link to bring in C++ runtime
127-LINK.c=		$(CXX) $(CXXFLAGS) $(LDFLAGS)
128-LINK.cc=	$(CXX) $(CXXFLAGS) $(LDFLAGS)
129+LINK.c=		$(CXX) $(CXXFLAGS) $(LDFLAGS) -norunpath
130+LINK.cc=	$(CXX) $(CXXFLAGS) $(LDFLAGS) -norunpath
131
132 ## Commands to make a shared library
133 SHLIB.c=	$(CC) $(CFLAGS) $(LDFLAGS) -G
134-SHLIB.cc=	$(CXX) $(CXXFLAGS) $(LDFLAGS) -G
135+SHLIB.cc=	$(CXX) $(CXXFLAGS) $(LDFLAGS) -G -norunpath
136
137 ## Compiler switch to embed a runtime search path
138 LD_RPATH=	-R
139 LD_RPATH_PRE=
140
141+## Force RPATH=$ORIGIN to locate own dependencies w/o need for LD_LIBRARY_PATH
142+ENABLE_RPATH=YES
143+RPATHLDFLAGS=${LD_RPATH}'$$ORIGIN'
144+
145 #LIBRARY_PATH_PREFIX=/usr/lib/lwp:
146
147 ## Compiler switch to embed a library name
148diff -ru misc/icu/source/layout/ArabicShaping.cpp misc/build/icu/source/layout/ArabicShaping.cpp
149--- misc/icu/source/layout/ArabicShaping.cpp	2009-07-01 20:51:24.000000000 +0200
150+++ misc/build/icu/source/layout/ArabicShaping.cpp	2024-06-14 21:23:05.557119301 +0200
151@@ -79,7 +79,6 @@
152 #define markFeatureMask 0x00040000UL
153 #define mkmkFeatureMask 0x00020000UL
154
155-#define NO_FEATURES   0
156 #define ISOL_FEATURES (isolFeatureMask | ligaFeatureMask | msetFeatureMask | markFeatureMask | ccmpFeatureMask | rligFeatureMask | caltFeatureMask | dligFeatureMask | cswhFeatureMask | cursFeatureMask | kernFeatureMask | mkmkFeatureMask)
157
158 #define SHAPE_MASK 0xF0000000UL
159@@ -174,11 +173,7 @@
160         LEUnicode c = chars[in];
161         ShapeType t = getShapeType(c);
162
163-        if (t == ST_NOSHAPE_NONE) {
164-            glyphStorage.setAuxData(out, NO_FEATURES, success);
165-        } else {
166-            glyphStorage.setAuxData(out, ISOL_FEATURES, success);
167-        }
168+        glyphStorage.setAuxData(out, ISOL_FEATURES, success);
169
170         if ((t & MASK_TRANSPARENT) != 0) {
171             continue;
172diff -ru misc/icu/source/tools/genuca/genuca.cpp misc/build/icu/source/tools/genuca/genuca.cpp
173--- misc/icu/source/tools/genuca/genuca.cpp	2009-07-01 20:50:40.000000000 +0200
174+++ misc/build/icu/source/tools/genuca/genuca.cpp	2024-06-14 21:27:57.031211233 +0200
175@@ -395,7 +395,7 @@
176                        copyright, status);
177
178     if(U_FAILURE(*status)) {
179-        fprintf(stderr, "Error: unable to create %s"INVC_DATA_NAME", error %s\n", outputDir, u_errorName(*status));
180+        fprintf(stderr, "Error: unable to create %s" INVC_DATA_NAME ", error %s\n", outputDir, u_errorName(*status));
181         return;
182     }
183
184@@ -757,7 +757,7 @@
185                        copyright, status);
186
187     if(U_FAILURE(*status)) {
188-        fprintf(stderr, "Error: unable to create %s"UCA_DATA_NAME", error %s\n", outputDir, u_errorName(*status));
189+        fprintf(stderr, "Error: unable to create %s" UCA_DATA_NAME ", error %s\n", outputDir, u_errorName(*status));
190         return;
191     }
192
193@@ -904,9 +904,9 @@
194       {0x20000, 0x2A6D6, UCOL_SPECIAL_FLAG | (CJK_IMPLICIT_TAG << 24)  },  //6 CJK_IMPLICIT_TAG,   /* 0x20000-0x2A6D6*/
195       {0x2F800, 0x2FA1D, UCOL_SPECIAL_FLAG | (CJK_IMPLICIT_TAG << 24)  },  //7 CJK_IMPLICIT_TAG,   /* 0x2F800-0x2FA1D*/
196 #endif
197-      {0xAC00, 0xD7B0, UCOL_SPECIAL_FLAG | (HANGUL_SYLLABLE_TAG << 24) },  //0 HANGUL_SYLLABLE_TAG,/* AC00-D7AF*/
198+      {0xAC00, 0xD7B0, static_cast<int32_t>(UCOL_SPECIAL_FLAG | (HANGUL_SYLLABLE_TAG << 24)) },  //0 HANGUL_SYLLABLE_TAG,/* AC00-D7AF*/
199       //{0xD800, 0xDC00, UCOL_SPECIAL_FLAG | (LEAD_SURROGATE_TAG << 24)  },  //1 LEAD_SURROGATE_TAG,  /* D800-DBFF*/
200-      {0xDC00, 0xE000, UCOL_SPECIAL_FLAG | (TRAIL_SURROGATE_TAG << 24) },  //2 TRAIL_SURROGATE DC00-DFFF
201+      {0xDC00, 0xE000, static_cast<int32_t>(UCOL_SPECIAL_FLAG | (TRAIL_SURROGATE_TAG << 24)) },  //2 TRAIL_SURROGATE DC00-DFFF
202       // Now directly handled in the collation code by the swapCJK function.
203       //{0x3400, 0x4DB6, UCOL_SPECIAL_FLAG | (CJK_IMPLICIT_TAG << 24)    },  //3 CJK_IMPLICIT_TAG,   /* 0x3400-0x4DB5*/
204       //{0x4E00, 0x9FA6, UCOL_SPECIAL_FLAG | (CJK_IMPLICIT_TAG << 24)    },  //4 CJK_IMPLICIT_TAG,   /* 0x4E00-0x9FA5*/
205
206--- misc/icu/source/configure	2009-07-01 14:51:26.000000000 -0400
207+++ misc/build/icu/source/configure	2024-10-19 16:35:02.000000000 -0400
208@@ -7061,8 +7061,10 @@
209 	# Check for potential -arch flags.  It is not universal unless
210 	# there are some -arch flags.  Note that *ppc* also matches
211 	# ppc64.  This check is also rather less than ideal.
212+	echo "${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}"
213 	case "${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}" in  #(
214-	  *-arch*ppc*|*-arch*i386*|*-arch*x86_64*) ac_cv_c_bigendian=universal;;
215+	  *-arch*i386*|*-arch*x86_64*) ac_cv_c_bigendian=no;;
216+	  *-arch*ppc*) ac_cv_c_bigendian=yes;;
217 	esac
218 else
219   $as_echo "$as_me: failed program was:" >&5
220--- misc/icu/source/i18n/uspoof.cpp	2009-07-01 14:50:10.000000000 -0400
221+++ misc/build/icu/source/i18n/uspoof.cpp	2024-10-19 16:36:44.000000000 -0400
222@@ -366,7 +366,7 @@
223         // u_strToUTF8() in preflight mode is an easy way to do it.
224         U_ASSERT(position16 <= len16);
225         u_strToUTF8(NULL, 0, position, text16, position16, status);
226-        if (position > 0) {
227+        if (position) {
228             // position is the required buffer length from u_strToUTF8, which includes
229             // space for a terminating NULL, which we don't want, hence the -1.
230             *position -= 1;
231