Patch grib_api_internal.h for big endian test suite issue (upstream bug SUP-2410)

This commit is contained in:
Mamoru TASAKA 2021-12-01 21:04:23 +09:00
parent a0b1b4222e
commit aa2a12089c
2 changed files with 47 additions and 3 deletions

View File

@ -0,0 +1,39 @@
From 8cc6b5ee3ac27355ae95c4ce0d60d4e70ad9bbd6 Mon Sep 17 00:00:00 2001
From: Mamoru TASAKA <mtasaka@fedoraproject.org>
Date: Wed, 1 Dec 2021 20:23:31 +0900
Subject: [PATCH] grib_api_internal.h: reverse definition of FAST_BIG_ENDIAN
In grib_api_internal.h, currently on big endian system, FAST_BIG_ENDIAN is defined
if GRIB_MEM_ALIGN is *not* defined.
On the other hand, for example in src/grib_bits.c, when FAST_BIG_ENDIAN is defined
"grib_bits_fast_big_endian.c" is included, otherwise "grib_bits_any_endian.c" is
included.
As "grib_bits_any_endian.c" is used also in x86_64 system, it is reasonable to think that
the original intention is that "grib_bits_fast_big_endian.c" needs some alignment
condition, and uses such condition for optimization, otherwise "grib_bits_any_endian.c"
should be used, so it is natural to think that the condition on grib_api_internal.h
is opposite.
---
src/grib_api_internal.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/grib_api_internal.h b/src/grib_api_internal.h
index 3b8fae3c..0c8fcf17 100644
--- a/src/grib_api_internal.h
+++ b/src/grib_api_internal.h
@@ -40,9 +40,9 @@ extern "C" {
#if IS_BIG_ENDIAN
#if GRIB_MEM_ALIGN
-#define FAST_BIG_ENDIAN 0
-#else
#define FAST_BIG_ENDIAN 1
+#else
+#define FAST_BIG_ENDIAN 0
#endif
#endif
--
2.33.1

View File

@ -1,6 +1,6 @@
Name: eccodes
Version: 2.23.0
Release: 1%{?dist}
Release: 2%{?dist}
Summary: WMO data format decoding and encoding
# force the shared libraries to have these so versions
@ -52,6 +52,10 @@ Patch2: eccodes-test-grib_to_netcdf.patch
# https://software.ecmwf.int/issues/browse/SUP-2073
# (and again, unfortunately this issue is not public)
# grib_api_internal.h: reverse definition of FAST_BIG_ENDIAN
# https://jira.ecmwf.int/browse/SUP-2410
Patch3: eccodes-grib_api_internal.h-reverse-definition-of-FAST_BIG_E.patch
BuildRequires: cmake3
BuildRequires: gcc
BuildRequires: gcc-gfortran
@ -97,8 +101,6 @@ Obsoletes: grib_api < %{final_grib_api_version}
# as explained in bugzilla #1562066
ExcludeArch: i686
# as explained in bugzilla #1562076
ExcludeArch: s390x
# as explained in bugzilla #1562084
ExcludeArch: armv7hl
@ -350,6 +352,9 @@ ctest3 -V %{?_smp_mflags}
%doc %{_datadir}/doc/%{name}/
%changelog
* Wed Dec 1 2021 Mamoru TASAKA <mtasaka@fedoraproject.org> - 2.23.0-2
- Patch grib_api_internal.h for big endian test suite issue (upstream bug SUP-2410)
* Thu Sep 02 2021 Jos de Kloe <josdekloe@gmail.com> - 2.23.0-1
- Upgrade to upstream version 2.23.0