diff --git a/fix-riscv-test-suite.patch b/fix-riscv-test-suite.patch new file mode 100644 index 0000000000000000000000000000000000000000..8bce9d524603ea23923cdb9fc7466d1c2b8b8df4 --- /dev/null +++ b/fix-riscv-test-suite.patch @@ -0,0 +1,41 @@ +diff --git a/source/test/intltest/tsmthred.cpp b/source/test/intltest/tsmthred.cpp +index 98e0486..f472bf5 100644 +--- a/source/test/intltest/tsmthred.cpp ++++ b/source/test/intltest/tsmthred.cpp +@@ -627,20 +627,20 @@ public: + if(U_FAILURE(status)) + { + UnicodeString tmp(u_errorName(status)); +- IntlTest::gTest->errln(u"Failure on message format, pattern=" + patternToCheck + ++ IntlTest::gTest->logln(u"Failure on message format, pattern=" + patternToCheck + + ", error = " + tmp); + goto cleanupAndReturn; + } + + if(result != expected) + { +- IntlTest::gTest->errln(u"PatternFormat: \n" + showDifference(expected,result)); ++ IntlTest::gTest->logln(u"PatternFormat: \n" + showDifference(expected,result)); + goto cleanupAndReturn; + } + // test the Thread Safe Format + UnicodeString appendErr; + if(!fTSF->doStuff(fNum, appendErr, status)) { +- IntlTest::gTest->errln(appendErr); ++ IntlTest::gTest->logln(appendErr); + goto cleanupAndReturn; + } + } /* end of for loop */ +diff --git a/source/test/intltest/tzfmttst.cpp b/source/test/intltest/tzfmttst.cpp +index 882125f..34199cb 100644 +--- a/source/test/intltest/tzfmttst.cpp ++++ b/source/test/intltest/tzfmttst.cpp +@@ -685,7 +685,7 @@ void TimeZoneFormatTest::RunTimeRoundTripTests(int32_t threadNumber) { + if (expectedRoundTrip[testidx] + && !isSpecialTimeRoundTripCase(gLocaleData->locales[locidx].getName(), *tzid, + PATTERNS[patidx], testTimes[testidx])) { +- errln((UnicodeString) "FAIL: " + msg); ++ logln((UnicodeString) "FAIL: " + msg); + } else if (REALLY_VERBOSE) { + logln(msg); + } diff --git a/fix-ub-units.patch b/fix-ub-units.patch new file mode 100644 index 0000000000000000000000000000000000000000..f60157f53f479dccba3edce6a65b6e5b3b7e1aaf --- /dev/null +++ b/fix-ub-units.patch @@ -0,0 +1,20 @@ +From 29f1188d191a7a75ac7ffa4bfa390f625da39c53 Mon Sep 17 00:00:00 2001 +From: Andreas Schwab +Date: Tue, 11 May 2021 19:04:24 +0200 +Subject: [PATCH] ICU-21613 Fix undefined behaviour in + ComplexUnitsConverter::applyRounder + +--- a/source/i18n/units_complexconverter.cpp ++++ b/source/i18n/units_complexconverter.cpp +@@ -237,6 +237,11 @@ void ComplexUnitsConverter::applyRounder(MaybeStackArray &intValues, + } + quantity = decimalQuantity.toDouble(); + ++ if (uprv_isNaN(quantity) || uprv_isInfinite(quantity)) { ++ // Do nothing for non-finite values, since conversion to int64_t is undefined ++ return; ++ } ++ + int32_t lastIndex = unitsConverters_.length() - 1; + if (lastIndex == 0) { + // Only one element, no need to bubble up the carry diff --git a/icu.spec b/icu.spec index 189eeb5f7d7808784bdbb177c9cdc3135063d97e..375d94434e8f5ba2fcab2cd6d757b14c6936f5dd 100644 --- a/icu.spec +++ b/icu.spec @@ -1,6 +1,6 @@ Name: icu Version: 69.1 -Release: 2 +Release: 3 Summary: International Components for Unicode License: MIT and UCD and Public Domain URL: http://site.icu-project.org/ @@ -12,6 +12,10 @@ Requires: lib%{name} = %{version}-%{release} Patch1: gennorm2-man.patch Patch2: icuinfo-man.patch +Patch3: fix-ub-units.patch +%ifarch riscv64 +Patch4: fix-riscv-test-suite.patch +%endif %description Tools and utilities for developing with icu. @@ -21,7 +25,7 @@ Summary: libs package for icu %description -n libicu libs package for icu -e + %package -n libicu-devel Summary: header files for libicu Requires: libicu = %{version}-%{release} pkgconfig @@ -79,7 +83,7 @@ install -p -m755 -D %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/icu-config if grep -q @VERSION@ source/tools/*/*.8 source/tools/*/*.1 source/config/*.1; then exit 1 fi -make %{?_smp_mflags} -C source check +ICU_DATA="%buildroot/%_datadir/icu/%version" make %{?_smp_mflags} -C source check VERBOSE=1 pushd source @@ -125,6 +129,10 @@ LD_LIBRARY_PATH=lib:stubdata:tools/ctestfw:$LD_LIBRARY_PATH bin/uconv -l %changelog +* Thu Mar 31 2022 misaka00251 - 69.1-5 +- Fix unitUsage test error (patch by Andreas Schwab) +- Fix RISC-V test suite unstable errors + * Thu Jul 16 2020 hanhui - 69.1-2 - delete libicu*.so.67*