Skip to contentSkip to conversation

package/exiv2: fix uClibc-ng build without fenv

PATCH New Bernd Kuhls 1 participant 2 messages Oct 23

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 package/exiv2: fix uClibc-ng build without fenv

Buildroot commit 94013c3a95a849b6a8d8db5321f9bfea4c389b10 bumped the package which included upstream commit
https://github.com/Exiv2/exiv2/commit/ebe85e7e872e6f743d6267e406660f50287bf4bc
that causes build errors on some archs with uClibc-ng.

The build error was detected by the Gitlab autobuilders and can be reproduced with this defconfig:

BR2_xtensa=y
BR2_XTENSA_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL=y BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_XTENSA_LX60_UCLIBC_STABLE=y BR2_PACKAGE_EXIV2=y

---
 ...seInt64-with-toolchains-lacking-fenv.patch | 67 +++++++++++++++++++
 1 file changed, 67 insertions(+)
 create mode 100644 package/exiv2/0001-Fix-build-of-parseInt64-with-toolchains-lacking-fenv.patch
package/exiv2/0001-Fix-build-of-parseInt64-with-toolchains-lacking-fenv.patch new file +67 -0
new file mode 100644
index 0000000000..2a9e747d7e
@@ -0,0 +1,67 @@
+From 1df7011e88d23b8f1dde7661719af2c14f3a4c62 Mon Sep 17 00:00:00 2001
+From: Bernd Kuhls <[email protected]>
+Date: Fri, 23 Oct 2026 19:28:51 +0200
+Subject: [PATCH] Fix build of parseInt64() with toolchains lacking fenv
+ functions
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+uClibc-ng supports C99 Floating-point on a restricted set of platforms:
+https://github.com/wbx-github/uclibc-ng/blob/v1.0.59/extra/Configs/Config.in.arch#L163
+
+causing build errors on the other supported platforms:
+
+/builds/bkuhls/buildroot/br-test-pkg/bootlin-openrisc-uclibc/build/exiv2-0.28.9/src/types.cpp:
+ In function ‘int64_t Exiv2::parseInt64(const std::string&, bool&)’:
+/builds/bkuhls/buildroot/br-test-pkg/bootlin-openrisc-uclibc/build/exiv2-0.28.9/src/types.cpp:550:10:
+ error: ‘feclearexcept’ is not a member of ‘std’
+
+/builds/bkuhls/buildroot/br-test-pkg/bootlin-powerpc-e500mc-uclibc/build/exiv2-0.28.9/src/types.cpp:
+ In function ‘int64_t Exiv2::parseInt64(const std::string&, bool&)’:
+/builds/bkuhls/buildroot/br-test-pkg/bootlin-powerpc-e500mc-uclibc/build/exiv2-0.28.9/src/types.cpp:550:10:
+ error: ‘feclearexcept’ is not a member of ‘std’
+
+/builds/bkuhls/buildroot/br-test-pkg/bootlin-xtensa-uclibc/build/exiv2-0.28.9/src/types.cpp:
+ In function ‘int64_t Exiv2::parseInt64(const std::string&, bool&)’:
+/builds/bkuhls/buildroot/br-test-pkg/bootlin-xtensa-uclibc/build/exiv2-0.28.9/src/types.cpp:550:10:
+ error: ‘feclearexcept’ is not a member of ‘std’
+
+To fix the problem the old code path which was removed with commit
+https://github.com/Exiv2/exiv2/commit/ebe85e7e872e6f743d6267e406660f50287bf4bc
+is restored and guarded with ifdef.
+
+Upstream: https://github.com/Exiv2/exiv2/pull/9549
+
+Signed-off-by: Bernd Kuhls <[email protected]>
+---
+ src/types.cpp | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/src/types.cpp b/src/types.cpp
+index 428db87d2..535499326 100644
+--- a/src/types.cpp
++++ b/src/types.cpp
+@@ -586,6 +586,7 @@ int64_t parseInt64(const std::string& s, bool& ok) {
+   if (ok)
+     return ret;
+ 
++#ifdef FE_ALL_EXCEPT
+   auto d = stringTo<double>(s, ok);
+   if (ok) {
+     std::feclearexcept(FE_ALL_EXCEPT);
+@@ -595,6 +596,11 @@ int64_t parseInt64(const std::string& s, bool& ok) {
+       return static_cast<int64_t>(ll);
+     }
+   }
++#else
++  auto f = stringTo<float>(s, ok);
++  if (ok)
++    return static_cast<int64_t>(f);
++#endif
+ 
+   auto [r, st] = stringTo<Rational>(s, ok);
+   if (ok) {
+-- 
+2.47.3
+
Signature · 6 lines
2.47.3

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

PATCH 2/2 package/exiv2: needs gcc >= 8

Upstream started using std::string_view with commit
https://github.com/Exiv2/exiv2/commit/476a5e23f9d9126942d2cfd8436ce08787d1c275
first released in version 0.28.0 which was added to buildroot with commit 5e99e8a38282dbd810450c4be0156ea77e4c6e04.

Building the package with the gcc6-based defconfig bootlin-aarch64-glibc-old is broken as detected by the Gitlab pipelines:

In file included from /builds/bkuhls/buildroot/br-test-pkg/bootlin-aarch64-glibc-old/build/exiv2-0.28.9/src/canonmn_int.cpp:17:0:
/builds/bkuhls/buildroot/br-test-pkg/bootlin-aarch64-glibc-old/build/exiv2-0.28.9/src/utils.hpp:5:23:
fatal error: string_view: No such file or directory

The build error can be reproduced with this defconfig:

BR2_aarch64=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y BR2_TOOLCHAIN_EXTERNAL_URL="https://toolchains.bootlin.com/downloads/releases/toolchains/aarch64--glibc--bleeding-edge-2017.05-toolchains-1-2.tar.bz2" BR2_TOOLCHAIN_EXTERNAL_GCC_6=y
BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_9=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC=y
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_PACKAGE_EXIV2=y

---
Series passed Gitlab pipelines:
https://gitlab.com/bkuhls/buildroot/-/commits/3db8846c533b63051cec3bc85d0d3916d6fc7609

 package/exiv2/Config.in | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
package/exiv2/Config.in +3 -1
index c65e484b2e..f3e32794ec 100644
@@ -1,12 +1,14 @@
-comment "exiv2 needs a uClibc or glibc toolchain w/ C++, wchar, dynamic library, threads"
+comment "exiv2 needs a uClibc or glibc toolchain w/ C++, gcc >= 8, wchar, dynamic library, threads"
 	depends on BR2_STATIC_LIBS || !BR2_INSTALL_LIBSTDCPP \
 		|| !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS \
+		|| !BR2_TOOLCHAIN_GCC_AT_LEAST_8 \
 		|| BR2_TOOLCHAIN_USES_MUSL
 
 config BR2_PACKAGE_EXIV2
 	bool "exiv2"
 	depends on !BR2_STATIC_LIBS
 	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_8 # string_view
 	depends on BR2_TOOLCHAIN_HAS_THREADS
 	depends on !BR2_TOOLCHAIN_USES_MUSL # PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
 	depends on BR2_USE_WCHAR
Signature · 6 lines
2.47.3

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot