1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-08 17:19:20 +00:00

db: Pin to use C99 std

GCC-15 has switched to using C23 by default, we have been selectively
disabling warnings as errors to get by, however with autoconf 2.72 adding
-std=gnu23 it now gets enabled for every compiler and clang-22 is more
obidient and has dropped support for K&R C completely. db5 code has a lot
of K&R C prototypes and it starts to fail vigorously. We can not keep
working around with out uplifting sources to be compliant with newer C
standard like C23.

Therefore pin the cflags to use C99 standard as this package expects.

Drop the code to disable warnings as errors selectively instead add a
fix for addressing implicit int warnings

(From OE-Core rev: ff6d0aa3ce4d39bc6b140c13846b5872ce4a181c)

Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
(cherry picked from commit 8615b3388b97a56096b959dea4d7499e03187100)
[YC: switched from CFLAGS += to CFLAGS:append]
Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Paul Barker <paul@pbarker.dev>
This commit is contained in:
Khem Raj
2026-04-08 09:27:59 -07:00
committed by Paul Barker
parent 3d2536f642
commit 7ced38f7e5
2 changed files with 111 additions and 4 deletions
@@ -0,0 +1,106 @@
From c744b20658641b46cf66429f573240b1b5737872 Mon Sep 17 00:00:00 2001
From: Khem Raj <khem.raj@oss.qualcomm.com>
Date: Wed, 8 Apr 2026 08:52:55 -0700
Subject: [PATCH] Fix implicit int warnings
Newer compilers flag this warning which results in configure tests
failing especially seen on native builds where AC_TRY_RUN is
being used to detect mutex support.
Also see
https://sources.debian.org/src/db5.3/5.3.28%2Bdfsg2-11/debian/patches/014-implicit-int.patch
Upstream-Status: Inappropriate [Inactive Upstream]
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
---
dist/aclocal/mutex.m4 | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/dist/aclocal/mutex.m4 b/dist/aclocal/mutex.m4
index 81f1ea8..8476f39 100644
--- a/dist/aclocal/mutex.m4
+++ b/dist/aclocal/mutex.m4
@@ -5,7 +5,7 @@ AC_DEFUN(AM_PTHREADS_SHARED, [
AC_TRY_RUN([
#include <stdlib.h>
#include <pthread.h>
-main() {
+int main() {
pthread_cond_t cond;
pthread_mutex_t mutex;
pthread_condattr_t condattr;
@@ -49,7 +49,7 @@ AC_DEFUN(AM_PTHREADS_PRIVATE, [
AC_TRY_RUN([
#include <stdlib.h>
#include <pthread.h>
-main() {
+int main() {
pthread_cond_t cond;
pthread_mutex_t mutex;
pthread_condattr_t condattr;
@@ -89,13 +89,13 @@ AC_DEFUN(AM_PTHREADS_CONDVAR_DUPINITCHK, [
AC_TRY_RUN([
#include <stdlib.h>
#include <pthread.h>
-main() {
+int main() {
pthread_cond_t cond;
pthread_condattr_t condattr;
exit(pthread_condattr_init(&condattr) ||
pthread_cond_init(&cond, &condattr) ||
pthread_cond_init(&cond, &condattr));
-}], [db_cv_pthread_condinit_dupgood="yes"],
+}], [db_cv_pthread_condinit_dupgood="yes"],
[db_cv_pthread_condinit_dupgood="no"],
AC_TRY_LINK([
#include <stdlib.h>
@@ -104,19 +104,19 @@ AC_TRY_LINK([
pthread_condattr_t condattr;
exit(pthread_condattr_init(&condattr) ||
pthread_cond_init(&cond, &condattr));
-], [db_cv_pthread_condinit_dupgood="yes"],
+], [db_cv_pthread_condinit_dupgood="yes"],
[db_cv_pthread_condinit_dupgood="no"]))])
AC_DEFUN(AM_PTHREADS_RWLOCKVAR_DUPINITCHK, [
AC_TRY_RUN([
#include <stdlib.h>
#include <pthread.h>
-main() {
+int main() {
pthread_rwlock_t rwlock;
pthread_rwlockattr_t rwlockattr;
exit(pthread_rwlockattr_init(&rwlockattr) ||
pthread_rwlock_init(&rwlock, &rwlockattr) ||
pthread_rwlock_init(&rwlock, &rwlockattr));
-}], [db_cv_pthread_rwlockinit_dupgood="yes"],
+}], [db_cv_pthread_rwlockinit_dupgood="yes"],
[db_cv_pthread_rwlockinit_dupgood="no"],
AC_TRY_LINK([
#include <stdlib.h>
@@ -125,7 +125,7 @@ AC_TRY_LINK([
pthread_rwlockattr_t rwlockattr;
exit(pthread_rwlockattr_init(&rwlockattr) ||
pthread_rwlock_init(&rwlock, &rwlockattr));
-], [db_cv_pthread_rwlockinit_dupgood="yes"],
+], [db_cv_pthread_rwlockinit_dupgood="yes"],
[db_cv_pthread_rwlockinit_dupgood="no"]))])
# Figure out mutexes for this compiler/architecture.
@@ -207,7 +207,7 @@ if test "$db_cv_mutex" = no; then
;;
esac
# We probe for private pthreads only when the user has asked for posix
- # mutexes and we don't have a multiprocess pthreads library available.
+ # mutexes and we don't have a multiprocess pthreads library available.
if test "$db_cv_mutex" = posix_only; then
AM_PTHREADS_PRIVATE(POSIX/pthreads/private)
AM_PTHREADS_CONDVAR_DUPINITCHK
@@ -571,7 +571,7 @@
# UNIX fcntl system call mutexes.
# Note that fcntl mutexes are no longer supported as of 4.8. This code has been
-# left in place in case there is some system that we are not aware of that
+# left in place in case there is some system that we are not aware of that
# only uses fcntl mutexes. In that case, contact Oracle for support.
if test "$db_cv_mutex" = no; then
db_cv_mutex=UNIX/fcntl
+5 -4
View File
@@ -27,6 +27,7 @@ SRC_URI += "file://fix-parallel-build.patch \
file://sequence-type.patch \
file://0001-Fix-libc-compatibility-by-renaming-atomic_init-API.patch \
file://0001-clock-Do-not-define-own-timespec.patch \
file://0001-Fix-implicit-int-warnings.patch \
"
# We are not interested in official latest 6.x versions;
# let's track what debian is using.
@@ -72,7 +73,11 @@ AUTOTOOLS_SCRIPT_PATH = "${S}/dist"
# configure.
CONFIG_SITE = ""
CFLAGS:append = " -std=gnu99"
oe_runconf:prepend() {
export CFLAGS="${CFLAGS}"
. ${S}/dist/RELEASE
# Edit version information we couldn't pre-compute.
sed -i -e "s/__EDIT_DB_VERSION_FAMILY__/$DB_VERSION_FAMILY/g" \
@@ -116,7 +121,3 @@ INSANE_SKIP:${PN} = "dev-so"
INSANE_SKIP:${PN}-cxx = "dev-so"
BBCLASSEXTEND = "native nativesdk"
# many configure tests are failing with gcc-14
CFLAGS += "-Wno-error=implicit-int -Wno-error=implicit-function-declaration"
BUILD_CFLAGS += "-Wno-error=implicit-int -Wno-error=implicit-function-declaration"