public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Marcin Juszkiewicz <mjuszkiewicz@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/gdl] f45: Unbreak ppc64le build
Date: Thu, 19 Nov 2026 19:19:02 GMT	[thread overview]
Message-ID: <179511594223.1.3410973131673242143.rpms-gdl-4e296fc43765@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/gdl
            Branch : f45
            Commit : 4e296fc4376516b4f9d2c7b25f5532367e10459a
            Author : Marcin Juszkiewicz <mjuszkiewicz@redhat.com>
            Date   : 2026-09-29T12:49:40+02:00
            Stats  : +262/-120 in 9 file(s)
            URL    : https://src.fedoraproject.org/rpms/gdl/c/4e296fc4376516b4f9d2c7b25f5532367e10459a?branch=f45

            Log:
            Unbreak ppc64le build

Use aarch64/riscv64 changes on all architectures.

---
diff --git a/0001-Enable-float-to-unsigned-conversion-workaround-on-RI.patch b/0001-Enable-float-to-unsigned-conversion-workaround-on-RI.patch
deleted file mode 100644
index 628e38e..0000000
--- a/0001-Enable-float-to-unsigned-conversion-workaround-on-RI.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 1f67aeaa5427843b343803d331c05238f27d7c39 Mon Sep 17 00:00:00 2001
-From: Marcin Juszkiewicz <mjuszkiewicz@redhat.com>
-Date: Wed, 2 Sep 2026 18:09:05 +0200
-Subject: [PATCH 1/3] Enable float-to-unsigned conversion workaround on RISC-V
-
-The RISC-V ISA, like ARM64, saturates negative floating-point values
-to zero when converting to unsigned integer types (via fcvt.wu/fcvt.lu
-instructions). This differs from x86 which wraps through the signed
-type due to undefined behavior in C/C++.
-
-GDL already had a workaround for ARM64 that converts float to the
-corresponding signed type first, then to unsigned (well-defined
-wrapping). Extend this workaround to RISC-V by adding __riscv to the
-preprocessor conditions.
-
-Assisted-by: Claude (Anthropic)
-Signed-off-by: Marcin Juszkiewicz <mjuszkiewicz@redhat.com>
-
-Sent upstream: https://github.com/gnudatalanguage/gdl/pull/2229
----
- src/convert2.cpp | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/src/convert2.cpp b/src/convert2.cpp
-index 39c6888..0ad8013 100644
---- a/src/convert2.cpp
-+++ b/src/convert2.cpp
-@@ -41,7 +41,7 @@ using namespace std;
-         if( nEl == 1) { (*dest)[0]=static_cast<unsigned>(static_cast<signed>((*this)[0])); if( (mode & BaseGDL::CONVERT) != 0) delete this; return dest;}\
-         if((GDL_NTHREADS=parallelize(nEl,  TP_ARRAY_INITIALISATION))==1) {for( SizeT i=0; i < nEl; ++i) (*dest)[i]=static_cast<unsigned>(static_cast<signed>((*this)[i])); if( (mode & BaseGDL::CONVERT) != 0) delete this; return dest; }
- 
--#ifdef __aarch64__
-+#if defined(__aarch64__) || defined(__riscv)
- #define DO_CONVERT_START_FLOAT_TO_UNSIGNED(tnew, unsigned, signed) DO_CONVERT_START_FLOAT_TO_UNSIGNED_ARM64(tnew, unsigned, signed)
- #else
- #define DO_CONVERT_START_FLOAT_TO_UNSIGNED(tnew, unsigned, signed) DO_CONVERT_START_FLOAT_TO_UNSIGNED_IA64(tnew, unsigned, signed)
-@@ -63,7 +63,7 @@ using namespace std;
-         Data_<tnew>* dest=new Data_<tnew>( dim, BaseGDL::NOZERO);\
-         if( nEl == 1) { (*dest)[0]=static_cast<unsigned>(static_cast<signed>((*this)[0].real())); if( (mode & BaseGDL::CONVERT) != 0) delete this; return dest;}\
-         if((GDL_NTHREADS=parallelize(nEl,  TP_ARRAY_INITIALISATION))==1) {for( SizeT i=0; i < nEl; ++i) (*dest)[i]=static_cast<unsigned>(static_cast<signed>((*this)[i].real())); if( (mode & BaseGDL::CONVERT) != 0) delete this; return dest; }
--#ifdef __aarch64__
-+#if defined(__aarch64__) || defined(__riscv)
- #define DO_CONVERT_START_FLOAT_TO_UNSIGNED_CPX(tnew, unsigned, signed) DO_CONVERT_START_FLOAT_TO_UNSIGNED_CPX_ARM64(tnew, unsigned, signed)
- #else
- #define DO_CONVERT_START_FLOAT_TO_UNSIGNED_CPX(tnew, unsigned, signed) DO_CONVERT_START_FLOAT_TO_UNSIGNED_CPX_IA64(tnew, unsigned, signed)
--- 
-2.55.0
-

diff --git a/0001-Enable-float-to-unsigned-conversion-workaround-on-RISC-V.patch b/0001-Enable-float-to-unsigned-conversion-workaround-on-RISC-V.patch
new file mode 100644
index 0000000..adcf694
--- /dev/null
+++ b/0001-Enable-float-to-unsigned-conversion-workaround-on-RISC-V.patch
@@ -0,0 +1,48 @@
+From b6d5eb25f799b4e1f3fae414af15c66ce23bf281 Mon Sep 17 00:00:00 2001
+From: Marcin Juszkiewicz <mjuszkiewicz@redhat.com>
+Date: Wed, 2 Sep 2026 18:09:05 +0200
+Subject: [PATCH 1/3] Enable float-to-unsigned conversion workaround on RISC-V
+
+The RISC-V ISA, like ARM64, saturates negative floating-point values to
+zero when converting to unsigned integer types (via fcvt.wu/fcvt.lu
+instructions). This differs from x86 which wraps through the signed type
+due to undefined behavior in C/C++.
+
+GDL already had a workaround for ARM64 that converts float to the
+corresponding signed type first, then to unsigned (well-defined
+wrapping). Extend this workaround to RISC-V by adding __riscv to the
+preprocessor conditions.
+
+Assisted-by: Claude (Anthropic)
+Signed-off-by: Marcin Juszkiewicz <mjuszkiewicz@redhat.com>
+
+Merged upstream: https://github.com/gnudatalanguage/gdl/pull/2229
+---
+ src/convert2.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/convert2.cpp b/src/convert2.cpp
+index 39c6888f..0ad80137 100644
+--- a/src/convert2.cpp
++++ b/src/convert2.cpp
+@@ -41,7 +41,7 @@ using namespace std;
+         if( nEl == 1) { (*dest)[0]=static_cast<unsigned>(static_cast<signed>((*this)[0])); if( (mode & BaseGDL::CONVERT) != 0) delete this; return dest;}\
+         if((GDL_NTHREADS=parallelize(nEl,  TP_ARRAY_INITIALISATION))==1) {for( SizeT i=0; i < nEl; ++i) (*dest)[i]=static_cast<unsigned>(static_cast<signed>((*this)[i])); if( (mode & BaseGDL::CONVERT) != 0) delete this; return dest; }
+ 
+-#ifdef __aarch64__
++#if defined(__aarch64__) || defined(__riscv)
+ #define DO_CONVERT_START_FLOAT_TO_UNSIGNED(tnew, unsigned, signed) DO_CONVERT_START_FLOAT_TO_UNSIGNED_ARM64(tnew, unsigned, signed)
+ #else
+ #define DO_CONVERT_START_FLOAT_TO_UNSIGNED(tnew, unsigned, signed) DO_CONVERT_START_FLOAT_TO_UNSIGNED_IA64(tnew, unsigned, signed)
+@@ -63,7 +63,7 @@ using namespace std;
+         Data_<tnew>* dest=new Data_<tnew>( dim, BaseGDL::NOZERO);\
+         if( nEl == 1) { (*dest)[0]=static_cast<unsigned>(static_cast<signed>((*this)[0].real())); if( (mode & BaseGDL::CONVERT) != 0) delete this; return dest;}\
+         if((GDL_NTHREADS=parallelize(nEl,  TP_ARRAY_INITIALISATION))==1) {for( SizeT i=0; i < nEl; ++i) (*dest)[i]=static_cast<unsigned>(static_cast<signed>((*this)[i].real())); if( (mode & BaseGDL::CONVERT) != 0) delete this; return dest; }
+-#ifdef __aarch64__
++#if defined(__aarch64__) || defined(__riscv)
+ #define DO_CONVERT_START_FLOAT_TO_UNSIGNED_CPX(tnew, unsigned, signed) DO_CONVERT_START_FLOAT_TO_UNSIGNED_CPX_ARM64(tnew, unsigned, signed)
+ #else
+ #define DO_CONVERT_START_FLOAT_TO_UNSIGNED_CPX(tnew, unsigned, signed) DO_CONVERT_START_FLOAT_TO_UNSIGNED_CPX_IA64(tnew, unsigned, signed)
+-- 
+2.55.0
+

diff --git a/0002-Use-signed-cast-for-float-to-BYTE-conversion-on-non-.patch b/0002-Use-signed-cast-for-float-to-BYTE-conversion-on-non-.patch
deleted file mode 100644
index 18d5283..0000000
--- a/0002-Use-signed-cast-for-float-to-BYTE-conversion-on-non-.patch
+++ /dev/null
@@ -1,68 +0,0 @@
-From f118d58249ba6fd1be47c5303f85b2c1705600c8 Mon Sep 17 00:00:00 2001
-From: Marcin Juszkiewicz <mjuszkiewicz@redhat.com>
-Date: Wed, 2 Sep 2026 18:09:24 +0200
-Subject: [PATCH 2/3] Use signed cast for float-to-BYTE conversion on non-x86
- architectures
-
-The float/double/complex-to-BYTE (unsigned char) conversion paths were
-using direct assignment, bypassing the signed-cast workaround already
-used for UINT, ULONG and ULONG64. On RISC-V (and potentially ARM64),
-this causes negative float values to saturate to zero instead of
-wrapping like on x86, breaking test_rounding for BYTE on the negative
-side.
-
-Switch these paths to use DO_CONVERT_START_FLOAT_TO_UNSIGNED (and the
-CPX variant) so BYTE gets the same float->signed->unsigned treatment as
-the other unsigned types.
-
-Assisted-by: Claude (Anthropic)
-Signed-off-by: Marcin Juszkiewicz <mjuszkiewicz@redhat.com>
-
-Sent upstream: https://github.com/gnudatalanguage/gdl/pull/2229
----
- src/convert2.cpp | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/src/convert2.cpp b/src/convert2.cpp
-index 0ad8013..c6c9cee 100644
---- a/src/convert2.cpp
-+++ b/src/convert2.cpp
-@@ -693,7 +693,7 @@ template<> BaseGDL* Data_<SpDFloat>::Convert2(DType destTy, BaseGDL::Convert2Mod
- 
-   switch (destTy) {
-   case GDL_BYTE:
--    DO_CONVERT_START(SpDByte)
-+    DO_CONVERT_START_FLOAT_TO_UNSIGNED(SpDByte, DByte, DInt)
-     TRACEOMP(__FILE__, __LINE__)
- #pragma omp parallel for num_threads(GDL_NTHREADS)
-       DO_CONVERT_END
-@@ -779,7 +779,7 @@ template<> BaseGDL* Data_<SpDDouble>::Convert2(DType destTy, BaseGDL::Convert2Mo
- 
-   switch (destTy) {
-   case GDL_BYTE:
--    DO_CONVERT_START(SpDByte)
-+    DO_CONVERT_START_FLOAT_TO_UNSIGNED(SpDByte, DByte, DInt)
-     TRACEOMP(__FILE__, __LINE__)
- #pragma omp parallel for num_threads(GDL_NTHREADS)
-       DO_CONVERT_END
-@@ -1166,7 +1166,7 @@ template<> BaseGDL* Data_<SpDComplex>::Convert2(DType destTy, BaseGDL::Convert2M
- 
-   switch (destTy) {
-   case GDL_BYTE:
--    DO_CONVERT_START_CPX(SpDByte)
-+    DO_CONVERT_START_FLOAT_TO_UNSIGNED_CPX(SpDByte, DByte, DInt)
-     TRACEOMP(__FILE__, __LINE__)
- #pragma omp parallel for num_threads(GDL_NTHREADS)
-       DO_CONVERT_END_CPX
-@@ -1278,7 +1278,7 @@ template<> BaseGDL* Data_<SpDComplexDbl>::Convert2(DType destTy, BaseGDL::Conver
- 
-   switch (destTy) {
-   case GDL_BYTE:
--    DO_CONVERT_START_CPX(SpDByte)
-+    DO_CONVERT_START_FLOAT_TO_UNSIGNED_CPX(SpDByte, DByte, DInt)
-     TRACEOMP(__FILE__, __LINE__)
- #pragma omp parallel for num_threads(GDL_NTHREADS)
-       DO_CONVERT_END_CPX
--- 
-2.55.0
-

diff --git a/0002-Use-signed-cast-for-float-to-BYTE-conversion-on-non-x86.patch b/0002-Use-signed-cast-for-float-to-BYTE-conversion-on-non-x86.patch
new file mode 100644
index 0000000..5ef7c9d
--- /dev/null
+++ b/0002-Use-signed-cast-for-float-to-BYTE-conversion-on-non-x86.patch
@@ -0,0 +1,68 @@
+From 57c5381f818db0c582eb2be6444931fc4116be17 Mon Sep 17 00:00:00 2001
+From: Marcin Juszkiewicz <mjuszkiewicz@redhat.com>
+Date: Wed, 2 Sep 2026 18:09:24 +0200
+Subject: [PATCH] Use signed cast for float-to-BYTE conversion on non-x86
+ architectures
+
+The float/double/complex-to-BYTE (unsigned char) conversion paths were
+using direct assignment, bypassing the signed-cast workaround already
+used for UINT, ULONG and ULONG64. On RISC-V (and potentially ARM64),
+this causes negative float values to saturate to zero instead of
+wrapping like on x86, breaking test_rounding for BYTE on the negative
+side.
+
+Switch these paths to use DO_CONVERT_START_FLOAT_TO_UNSIGNED (and the
+CPX variant) so BYTE gets the same float->signed->unsigned treatment as
+the other unsigned types.
+
+Assisted-by: Claude (Anthropic)
+Signed-off-by: Marcin Juszkiewicz <mjuszkiewicz@redhat.com>
+
+Merged upstream: https://github.com/gnudatalanguage/gdl/pull/2229
+---
+ src/convert2.cpp | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/convert2.cpp b/src/convert2.cpp
+index 0ad80137..c6c9ceed 100644
+--- a/src/convert2.cpp
++++ b/src/convert2.cpp
+@@ -693,7 +693,7 @@ template<> BaseGDL* Data_<SpDFloat>::Convert2(DType destTy, BaseGDL::Convert2Mod
+ 
+   switch (destTy) {
+   case GDL_BYTE:
+-    DO_CONVERT_START(SpDByte)
++    DO_CONVERT_START_FLOAT_TO_UNSIGNED(SpDByte, DByte, DInt)
+     TRACEOMP(__FILE__, __LINE__)
+ #pragma omp parallel for num_threads(GDL_NTHREADS)
+       DO_CONVERT_END
+@@ -779,7 +779,7 @@ template<> BaseGDL* Data_<SpDDouble>::Convert2(DType destTy, BaseGDL::Convert2Mo
+ 
+   switch (destTy) {
+   case GDL_BYTE:
+-    DO_CONVERT_START(SpDByte)
++    DO_CONVERT_START_FLOAT_TO_UNSIGNED(SpDByte, DByte, DInt)
+     TRACEOMP(__FILE__, __LINE__)
+ #pragma omp parallel for num_threads(GDL_NTHREADS)
+       DO_CONVERT_END
+@@ -1166,7 +1166,7 @@ template<> BaseGDL* Data_<SpDComplex>::Convert2(DType destTy, BaseGDL::Convert2M
+ 
+   switch (destTy) {
+   case GDL_BYTE:
+-    DO_CONVERT_START_CPX(SpDByte)
++    DO_CONVERT_START_FLOAT_TO_UNSIGNED_CPX(SpDByte, DByte, DInt)
+     TRACEOMP(__FILE__, __LINE__)
+ #pragma omp parallel for num_threads(GDL_NTHREADS)
+       DO_CONVERT_END_CPX
+@@ -1278,7 +1278,7 @@ template<> BaseGDL* Data_<SpDComplexDbl>::Convert2(DType destTy, BaseGDL::Conver
+ 
+   switch (destTy) {
+   case GDL_BYTE:
+-    DO_CONVERT_START_CPX(SpDByte)
++    DO_CONVERT_START_FLOAT_TO_UNSIGNED_CPX(SpDByte, DByte, DInt)
+     TRACEOMP(__FILE__, __LINE__)
+ #pragma omp parallel for num_threads(GDL_NTHREADS)
+       DO_CONVERT_END_CPX
+-- 
+2.55.0
+

diff --git a/0003-Remove-test_rounding-from-ARM_XFAIL_TESTS.patch b/0003-Remove-test_rounding-from-ARM_XFAIL_TESTS.patch
index a6f6dad..575cb50 100644
--- a/0003-Remove-test_rounding-from-ARM_XFAIL_TESTS.patch
+++ b/0003-Remove-test_rounding-from-ARM_XFAIL_TESTS.patch
@@ -12,7 +12,7 @@ longer be marked as expected failure.
 Assisted-by: Claude (Anthropic)
 Signed-off-by: Marcin Juszkiewicz <mjuszkiewicz@redhat.com>
 
-Sent upstream: https://github.com/gnudatalanguage/gdl/pull/2229
+Merged upstream: https://github.com/gnudatalanguage/gdl/pull/2229
 ---
  testsuite/CMakeLists.txt | 1 -
  1 file changed, 1 deletion(-)

diff --git a/0004-Use-signed-cast-for-float-to-unsigned-on-all-archite.patch b/0004-Use-signed-cast-for-float-to-unsigned-on-all-archite.patch
new file mode 100644
index 0000000..0e128e2
--- /dev/null
+++ b/0004-Use-signed-cast-for-float-to-unsigned-on-all-archite.patch
@@ -0,0 +1,48 @@
+From: Marcin Juszkiewicz <mjuszkiewicz@redhat.com>
+Date: Mon, 29 Sep 2026 10:00:00 +0200
+Subject: [PATCH] Use signed cast for float-to-unsigned on all architectures
+
+Direct cast from negative floating-point values to unsigned integer types is
+undefined behavior in C/C++.
+
+The signed-cast workaround was only enabled for aarch64 and RISC-V but the same
+UB affects ppc64le and s390x. Make it unconditional since the signed-cast
+approach (float->signed->unsigned) is correct on all architectures.
+
+Sent upstream: https://github.com/gnudatalanguage/gdl/pull/2250
+
+Signed-off-by: Marcin Juszkiewicz <mjuszkiewicz@redhat.com>
+---
+ src/convert2.cpp | 8 --------
+ 1 file changed, 8 deletions(-)
+
+diff --git a/src/convert2.cpp b/src/convert2.cpp
+--- a/src/convert2.cpp
++++ b/src/convert2.cpp
+@@ -41,11 +41,7 @@
+         if( nEl == 1) { (*dest)[0]=static_cast<unsigned>(static_cast<signed>((*this)[0])); if( (mode & BaseGDL::CONVERT) != 0) delete this; return dest;}\
+         if((GDL_NTHREADS=parallelize(nEl,  TP_ARRAY_INITIALISATION))==1) {for( SizeT i=0; i < nEl; ++i) (*dest)[i]=static_cast<unsigned>(static_cast<signed>((*this)[i])); if( (mode & BaseGDL::CONVERT) != 0) delete this; return dest; }
+
+-#if defined(__aarch64__) || defined(__riscv)
+ #define DO_CONVERT_START_FLOAT_TO_UNSIGNED(tnew, unsigned, signed) DO_CONVERT_START_FLOAT_TO_UNSIGNED_ARM64(tnew, unsigned, signed)
+-#else
+-#define DO_CONVERT_START_FLOAT_TO_UNSIGNED(tnew, unsigned, signed) DO_CONVERT_START_FLOAT_TO_UNSIGNED_IA64(tnew, unsigned, signed)
+-#endif
+
+ #define DO_CONVERT_START_BIG_TO_SMALL(tnew, mask)  {\
+         Data_<tnew>* dest=new Data_<tnew>( dim, BaseGDL::NOZERO);\
+@@ -63,11 +59,7 @@
+         Data_<tnew>* dest=new Data_<tnew>( dim, BaseGDL::NOZERO);\
+         if( nEl == 1) { (*dest)[0]=static_cast<unsigned>(static_cast<signed>((*this)[0].real())); if( (mode & BaseGDL::CONVERT) != 0) delete this; return dest;}\
+         if((GDL_NTHREADS=parallelize(nEl,  TP_ARRAY_INITIALISATION))==1) {for( SizeT i=0; i < nEl; ++i) (*dest)[i]=static_cast<unsigned>(static_cast<signed>((*this)[i].real())); if( (mode & BaseGDL::CONVERT) != 0) delete this; return dest; }
+-#if defined(__aarch64__) || defined(__riscv)
+ #define DO_CONVERT_START_FLOAT_TO_UNSIGNED_CPX(tnew, unsigned, signed) DO_CONVERT_START_FLOAT_TO_UNSIGNED_CPX_ARM64(tnew, unsigned, signed)
+-#else
+-#define DO_CONVERT_START_FLOAT_TO_UNSIGNED_CPX(tnew, unsigned, signed) DO_CONVERT_START_FLOAT_TO_UNSIGNED_CPX_IA64(tnew, unsigned, signed)
+-#endif
+
+ #define DO_CONVERT_END  for( SizeT i=0; i < nEl; ++i) (*dest)[i]=(*this)[i]; if( (mode & BaseGDL::CONVERT) != 0) delete this; return dest; }
+ #define DO_CONVERT_END_BIG_TO_SMALL(mask)  for( SizeT i=0; i < nEl; ++i) (*dest)[i]=((*this)[i]&mask); if( (mode & BaseGDL::CONVERT) != 0) delete this; return dest; }
+-- 
+2.55.0
+

diff --git a/0005-Remove-test_byte_conversion-from-ARM_XFAIL_TESTS.patch b/0005-Remove-test_byte_conversion-from-ARM_XFAIL_TESTS.patch
new file mode 100644
index 0000000..0380dc1
--- /dev/null
+++ b/0005-Remove-test_byte_conversion-from-ARM_XFAIL_TESTS.patch
@@ -0,0 +1,30 @@
+From: Marcin Juszkiewicz <mjuszkiewicz@redhat.com>
+Date: Mon, 29 Sep 2026 10:00:00 +0200
+Subject: [PATCH] Remove test_byte_conversion from ARM_XFAIL_TESTS
+
+The test_byte_conversion test was marked as expected-to-fail (WILL_FAIL) on
+aarch64 because float-to-unsigned-BYTE conversion produced incorrect results.
+The preceding patches fix the underlying conversion issue by using an
+intermediate signed cast on all architectures, so the test now passes and
+should no longer be marked as expected failure.
+
+Sent upstream: https://github.com/gnudatalanguage/gdl/pull/2250
+
+Signed-off-by: Marcin Juszkiewicz <mjuszkiewicz@redhat.com>
+---
+ testsuite/CMakeLists.txt | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/testsuite/CMakeLists.txt b/testsuite/CMakeLists.txt
+index 6bf6b4d..a1b2c3d 100644
+--- a/testsuite/CMakeLists.txt
++++ b/testsuite/CMakeLists.txt
+@@ -41,5 +41,4 @@ set_tests_properties(${TESTS} PROPERTIES ENVIRONMENT "LC_COLLATE=C;GDL_PATH=${BA
+ set(ARM_XFAIL_TESTS
+-    test_byte_conversion.pro
+     test_formats.pro
+ )
+ foreach(test ${ARM_XFAIL_TESTS})
+-- 
+2.55.0
+

diff --git a/0006-Simplify-defines.patch b/0006-Simplify-defines.patch
new file mode 100644
index 0000000..f7b4e30
--- /dev/null
+++ b/0006-Simplify-defines.patch
@@ -0,0 +1,56 @@
+From 6bf6c861c3320d728e2aadd7c7100e410f9a56d3 Mon Sep 17 00:00:00 2001
+From: Marcin Juszkiewicz <mjuszkiewicz@redhat.com>
+Date: Tue, 29 Sep 2026 11:56:40 +0200
+Subject: [PATCH] Simplify defines
+
+As ARM64 ones are used for all architectures then there is no need to keep
+IA64 ones.
+
+And then there is no need to call them ARM64.
+
+Sent upstream: https://github.com/gnudatalanguage/gdl/pull/2250
+
+Signed-off-by: Marcin Juszkiewicz <mjuszkiewicz@redhat.com>
+---
+ src/convert2.cpp | 11 ++---------
+ 1 file changed, 2 insertions(+), 9 deletions(-)
+
+diff --git a/src/convert2.cpp b/src/convert2.cpp
+index 477726a7..5e88fbe9 100644
+--- a/src/convert2.cpp
++++ b/src/convert2.cpp
+@@ -34,15 +34,11 @@ using namespace std;
+         if( nEl == 1) { (*dest)[0]=(*this)[0]; if( (mode & BaseGDL::CONVERT) != 0) delete this; return dest;}\
+         if((GDL_NTHREADS=parallelize(nEl,  TP_ARRAY_INITIALISATION))==1) {for( SizeT i=0; i < nEl; ++i) (*dest)[i]=(*this)[i]; if( (mode & BaseGDL::CONVERT) != 0) delete this; return dest; }
+ 
+-#define DO_CONVERT_START_FLOAT_TO_UNSIGNED_IA64(tnew, unsigned, signed) DO_CONVERT_START(tnew)
+-
+-#define DO_CONVERT_START_FLOAT_TO_UNSIGNED_ARM64(tnew, unsigned, signed)  {\
++#define DO_CONVERT_START_FLOAT_TO_UNSIGNED(tnew, unsigned, signed)  {\
+         Data_<tnew>* dest=new Data_<tnew>( dim, BaseGDL::NOZERO);\
+         if( nEl == 1) { (*dest)[0]=static_cast<unsigned>(static_cast<signed>((*this)[0])); if( (mode & BaseGDL::CONVERT) != 0) delete this; return dest;}\
+         if((GDL_NTHREADS=parallelize(nEl,  TP_ARRAY_INITIALISATION))==1) {for( SizeT i=0; i < nEl; ++i) (*dest)[i]=static_cast<unsigned>(static_cast<signed>((*this)[i])); if( (mode & BaseGDL::CONVERT) != 0) delete this; return dest; }
+ 
+-#define DO_CONVERT_START_FLOAT_TO_UNSIGNED(tnew, unsigned, signed) DO_CONVERT_START_FLOAT_TO_UNSIGNED_ARM64(tnew, unsigned, signed)
+-
+ #define DO_CONVERT_START_BIG_TO_SMALL(tnew, mask)  {\
+         Data_<tnew>* dest=new Data_<tnew>( dim, BaseGDL::NOZERO);\
+         if( nEl == 1) { (*dest)[0]=((*this)[0]&mask); if( (mode & BaseGDL::CONVERT) != 0) delete this; return dest;}\
+@@ -53,13 +49,10 @@ using namespace std;
+         if( nEl == 1) { (*dest)[0]=(*this)[0].real(); if( (mode & BaseGDL::CONVERT) != 0) delete this; return dest;}\
+         if((GDL_NTHREADS=parallelize(nEl,  TP_ARRAY_INITIALISATION))==1) {for( SizeT i=0; i < nEl; ++i) (*dest)[i]=(*this)[i].real(); if( (mode & BaseGDL::CONVERT) != 0) delete this; return dest; }
+ 
+-#define DO_CONVERT_START_FLOAT_TO_UNSIGNED_CPX_IA64(tnew, unsigned, signed) DO_CONVERT_START_CPX(tnew)
+-
+-#define DO_CONVERT_START_FLOAT_TO_UNSIGNED_CPX_ARM64(tnew, unsigned, signed)  {\
++#define DO_CONVERT_START_FLOAT_TO_UNSIGNED_CPX(tnew, unsigned, signed)  {\
+         Data_<tnew>* dest=new Data_<tnew>( dim, BaseGDL::NOZERO);\
+         if( nEl == 1) { (*dest)[0]=static_cast<unsigned>(static_cast<signed>((*this)[0].real())); if( (mode & BaseGDL::CONVERT) != 0) delete this; return dest;}\
+         if((GDL_NTHREADS=parallelize(nEl,  TP_ARRAY_INITIALISATION))==1) {for( SizeT i=0; i < nEl; ++i) (*dest)[i]=static_cast<unsigned>(static_cast<signed>((*this)[i].real())); if( (mode & BaseGDL::CONVERT) != 0) delete this; return dest; }
+-#define DO_CONVERT_START_FLOAT_TO_UNSIGNED_CPX(tnew, unsigned, signed) DO_CONVERT_START_FLOAT_TO_UNSIGNED_CPX_ARM64(tnew, unsigned, signed)
+ 
+ #define DO_CONVERT_END  for( SizeT i=0; i < nEl; ++i) (*dest)[i]=(*this)[i]; if( (mode & BaseGDL::CONVERT) != 0) delete this; return dest; }
+ #define DO_CONVERT_END_BIG_TO_SMALL(mask)  for( SizeT i=0; i < nEl; ++i) (*dest)[i]=((*this)[i]&mask); if( (mode & BaseGDL::CONVERT) != 0) delete this; return dest; }
+-- 
+2.55.0
+

diff --git a/gdl.spec b/gdl.spec
index bb5be6e..0ed381b 100644
--- a/gdl.spec
+++ b/gdl.spec
@@ -41,9 +41,14 @@ Source1:        xorg.conf
 # Build with system antlr library.  Request for upstream change here:
 # https://sourceforge.net/tracker/index.php?func=detail&aid=2685215&group_id=97659&atid=618686
 Patch1:         gdl-antlr.patch
-Patch2:         0001-Enable-float-to-unsigned-conversion-workaround-on-RI.patch
-Patch3:         0002-Use-signed-cast-for-float-to-BYTE-conversion-on-non-.patch
+# Backport: https://github.com/gnudatalanguage/gdl/pull/2229
+Patch2:         0001-Enable-float-to-unsigned-conversion-workaround-on-RISC-V.patch
+Patch3:         0002-Use-signed-cast-for-float-to-BYTE-conversion-on-non-x86.patch
 Patch4:         0003-Remove-test_rounding-from-ARM_XFAIL_TESTS.patch
+# Fix float-to-unsigned conversion on all architectures (not just aarch64/riscv)
+Patch5:         0004-Use-signed-cast-for-float-to-unsigned-on-all-archite.patch
+Patch6:         0005-Remove-test_byte_conversion-from-ARM_XFAIL_TESTS.patch
+Patch7:         0006-Simplify-defines.patch
 
 BuildRequires:  gcc-c++
 BuildRequires:  antlr-C++
@@ -140,11 +145,14 @@ rm -rf src/antlr src/libdivide.h
 # Not yet possible to build with external dSFMT
 #rm -r src/dSFMT
 # Normalize CRLF line endings to LF so patches apply cleanly
-find . -name '*.cpp' -o -name '*.hpp' -o -name '*.h' | xargs sed -i 's/\r$//'
+find . -name '*.cpp' -o -name '*.hpp' -o -name '*.h' -o -name '*.txt' | xargs sed -i 's/\r$//'
 %patch -P1 -p1 -b .antlr
 %patch -P2 -p1 -b .riscv-unsigned
 %patch -P3 -p1 -b .riscv-byte
 %patch -P4 -p1 -b .xfail-rounding
+%patch -P5 -p1 -b .all-arches
+%patch -P6 -p1 -b .xfail-byte-conversion
+%patch -P7 -p1 -b .simplify-defines
 
 pushd src
 for f in *.g

                 reply	other threads:[~2026-11-19 19:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179511594223.1.3410973131673242143.rpms-gdl-4e296fc43765@fedoraproject.org \
    --to=mjuszkiewicz@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox