From 4f62503eca463f47252085a9c04bed567ab1e3f86dc90d5278a883428c2980a7 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Mon, 8 Mar 2021 12:54:07 +0000 Subject: [PATCH] Accepting request 877696 from home:Guillaume_G:branches:openSUSE:Factory:ARM - Backport patch to fix 2 tests on aarch64: * 1618.patch - boo#1182645 OBS-URL: https://build.opensuse.org/request/show/877696 OBS-URL: https://build.opensuse.org/package/show/X11:common:Factory/icu?expand=0&rev=139 --- icu-1618.patch | 43 +++++++++++++++++++++++++++++++++++++++++++ icu.changes | 6 ++++++ icu.spec | 2 ++ 3 files changed, 51 insertions(+) create mode 100644 icu-1618.patch diff --git a/icu-1618.patch b/icu-1618.patch new file mode 100644 index 0000000..4dfbaaa --- /dev/null +++ b/icu-1618.patch @@ -0,0 +1,43 @@ +From 7045a80e08a5f662b9588ad9f0b8a5c1cd558bce Mon Sep 17 00:00:00 2001 +From: Frank Tang +Date: Fri, 5 Mar 2021 02:29:58 +0000 +Subject: [PATCH] ICU-21521 Fix cast of uprv_strcmp + +See #1618 +[Update from guillaume: drop 1st hunk for backporting] +--- + source/common/locid.cpp | 18 +++++++++++++++--- + 1 file changed, 15 insertions(+), 3 deletions(-) + +diff --git a/source/common/locid.cpp b/source/common/locid.cpp +index 448c1de5e44..2d005b23542 100644 +--- a/source/common/locid.cpp ++++ b/source/common/locid.cpp +@@ -1618,8 +1622,12 @@ AliasReplacer::outputToString( + out.append(SEP_CHAR, status); + } + variants.sort([](UElement e1, UElement e2) -> int8_t { +- return uprv_strcmp( ++ // uprv_strcmp return int and in some platform, such as arm64-v8a, ++ // it may return positive values > 127 which cause the casted value ++ // of int8_t negative. ++ int res = uprv_strcmp( + (const char*)e1.pointer, (const char*)e2.pointer); ++ return (res == 0) ? 0 : ((res > 0) ? 1 : -1); + }, status); + int32_t variantsStart = out.length(); + for (int32_t i = 0; i < variants.size(); i++) { +@@ -1680,8 +1688,12 @@ AliasReplacer::replace(const Locale& locale, CharString& out, UErrorCode& status + + // Sort the variants + variants.sort([](UElement e1, UElement e2) -> int8_t { +- return uprv_strcmp( ++ // uprv_strcmp return int and in some platform, such as arm64-v8a, ++ // it may return positive values > 127 which cause the casted value ++ // of int8_t negative. ++ int res = uprv_strcmp( + (const char*)e1.pointer, (const char*)e2.pointer); ++ return (res == 0) ? 0 : ((res > 0) ? 1 : -1); + }, status); + + // A changed count to assert when loop too many times. diff --git a/icu.changes b/icu.changes index a8fce09..972ac6b 100644 --- a/icu.changes +++ b/icu.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Mar 8 07:33:00 UTC 2021 - Guillaume GARDET + +- Backport patch to fix 2 tests on aarch64: + * 1618.patch - boo#1182645 + ------------------------------------------------------------------- Mon Mar 1 13:37:17 UTC 2021 - Martin Liška diff --git a/icu.spec b/icu.spec index 85a5aee..25fe5cd 100644 --- a/icu.spec +++ b/icu.spec @@ -44,6 +44,8 @@ Patch4: icu-fix-install-mode-files.diff Patch6: icu-error-reporting.diff Patch7: icu-avoid-x87-excess-precision.diff Patch8: locale.diff +# PATCH-FIX-UPSTREAM - https://github.com/unicode-org/icu/pull/1618 +Patch9: icu-1618.patch BuildRequires: fdupes BuildRequires: gcc-c++ BuildRequires: pkg-config