Skip to contentSkip to conversation

package/berkeleydb: fix build on ARM FDPIC

PATCH New Yegor Yefremov via buildroot 1 participant 1 message Nov 9

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/berkeleydb: fix build on ARM FDPIC

Building berkeleydb for an ARM FDPIC target with GCC >= 14 fails with:

../src/os/os_yield.c: In function '__os_yield':
../src/os/os_yield.c:53:17: error: implicit declaration of function 'pthread_yield'; did you mean 'pthread_self'? [-Wimplicit-function-declaration]
53 | pthread_yield();

dist/configure only adds -D_GNU_SOURCE -D_REENTRANT to CPPFLAGS when host_os matches "linux*", but the FDPIC tuple arm-buildroot-uclinuxfdpiceabi has host_os "uclinuxfdpiceabi". Without _GNU_SOURCE, uClibc-ng's pthread.h does not declare pthread_yield(), while configure still detects it at link time (HAVE_PTHREAD_YIELD), so os_yield.c calls it without a prototype, which is an error since GCC 14.

Add a patch so that dist/configure.ac and the pre-generated dist/configure handle uclinux* like linux*.

This issue has been present since commit 45c0a5114d44 ("Revert: "arch:
drop now useless support for FDPIC""), which re-introduced FDPIC support and thus the uclinuxfdpiceabi tuple. It therefore affects 2024.11 and later, including 2025.02.x and 2026.02.x.

Fixes:
https://autobuild.buildroot.org/results/29766038fbefeb00ccc2a457ed0ff52c8f93d158

Fixes 45c0a5114d44fa1c20b06ef9d2a4ae7ecf26658a ("Revert: "arch: drop now useless support for FDPIC"")
Assisted-by Claude:claude-opus-5-5
---
 ...ac-define-_GNU_SOURCE-on-uClinux-too.patch | 54 +++++++++++++++++++
 1 file changed, 54 insertions(+)
 create mode 100644 package/berkeleydb/0003-dist-configure.ac-define-_GNU_SOURCE-on-uClinux-too.patch
package/berkeleydb/0003-dist-configure.ac-define-_GNU_SOURCE-on-uClinux-too.patch new file +54 -0
new file mode 100644
index 0000000000..3db1de9be3
@@ -0,0 +1,54 @@
+From 3004864ef0e8803b0bf974425451f2b6862c16e4 Mon Sep 17 00:00:00 2001
+From: Yegor Yefremov <[email protected]>
+Date: Mon, 9 Nov 2026 09:15:09 +0100
+Subject: [PATCH] dist/configure.ac: define _GNU_SOURCE on uClinux too
+
+uClinux (noMMU) toolchains use host triplets such as
+arm-buildroot-uclinuxfdpiceabi or arm-buildroot-uclinux-uclibcgnueabi,
+whose host_os ("uclinuxfdpiceabi", "uclinux-uclibcgnueabi") does not
+match the "linux*" pattern. As a result, _GNU_SOURCE and _REENTRANT are
+not defined, so GNU extensions such as pthread_yield() are not
+declared, while configure still detects them as available:
+
+../src/os/os_yield.c:53:17: error: implicit declaration of function 'pthread_yield'; did you mean 'pthread_self'? [-Wimplicit-function-declaration]
+
+Treat uclinux* like linux*. The generated dist/configure is updated
+accordingly.
+
+Upstream: N/A, Berkeley DB 5.x is no longer maintained
+Assisted-by: Claude:claude-opus-5-5
+Signed-off-by: Yegor Yefremov <[email protected]>
+---
+ dist/configure    | 2 +-
+ dist/configure.ac | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/dist/configure b/dist/configure
+index 32b2c66..3fa913b 100755
+--- a/dist/configure
++++ b/dist/configure
+@@ -5115,7 +5115,7 @@ cygwin*)
+ freebsd*)
+ 	CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
+ 	LDFLAGS="$LDFLAGS -pthread";;
+-gnu*|k*bsd*-gnu|linux*)
++gnu*|k*bsd*-gnu|linux*|uclinux*)
+ 	CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE -D_REENTRANT";;
+ hpux*)	CPPFLAGS="$CPPFLAGS -D_REENTRANT";;
+ irix*)	optimize_flag="-O2"
+diff --git a/dist/configure.ac b/dist/configure.ac
+index 689f3b8..a9808bd 100644
+--- a/dist/configure.ac
++++ b/dist/configure.ac
+@@ -199,7 +199,7 @@ cygwin*)
+ freebsd*)
+ 	CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
+ 	LDFLAGS="$LDFLAGS -pthread";;
+-gnu*|k*bsd*-gnu|linux*)
++gnu*|k*bsd*-gnu|linux*|uclinux*)
+ 	CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE -D_REENTRANT";;
+ hpux*)	CPPFLAGS="$CPPFLAGS -D_REENTRANT";;
+ irix*)	optimize_flag="-O2"
+-- 
+2.34.1
+
Signature · 6 lines
2.34.1

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