Skip to contentSkip to conversation

fvwm: Fix build with gcc-14

PATCH New Khem Raj 1 participant 4 messages May 10, 2024

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/4 fvwm: Fix build with gcc-14

Fixes for C99 compatibility

---
 ...ot-require-support-for-implicit-ints.patch | 45 +++++++++++++++++++
 ...-missing-unistd.h-to-AM_SAFETY_CHECK.patch | 32 +++++++++++++
 ...gure-Further-defang-the-Werror-check.patch | 35 +++++++++++++++
 meta-oe/recipes-graphics/fvwm/fvwm_2.7.0.bb   |  3 ++
 4 files changed, 115 insertions(+)
 create mode 100644 meta-oe/recipes-graphics/fvwm/fvwm/0001-configure-Do-not-require-support-for-implicit-ints.patch
 create mode 100644 meta-oe/recipes-graphics/fvwm/fvwm/0002-acinclude.m4-Add-missing-unistd.h-to-AM_SAFETY_CHECK.patch
 create mode 100644 meta-oe/recipes-graphics/fvwm/fvwm/0003-configure-Further-defang-the-Werror-check.patch
meta-oe/recipes-graphics/fvwm/fvwm/0001-configure-Do-not-require-support-for-implicit-ints.patch new file +45 -0
new file mode 100644
index 0000000000..356bd73f88
@@ -0,0 +1,45 @@
+From cbba378a23410241176d62f3bb43965c044615e3 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <[email protected]>
+Date: Thu, 24 Nov 2022 13:06:50 +0100
+Subject: [PATCH 1/3] configure: Do not require support for implicit ints
+
+Implicit ints  have not been part of C since 1999, and future
+compilers will disable support for them by default.  Fortunatenly,
+only one configure check needs adjusting.
+
+Upstream-Status: Submitted [https://github.com/fvwmorg/fvwm/pull/100]
+Signed-off-by: Khem Raj <[email protected]>
+---
+ acinclude.m4 | 2 +-
+ configure.ac | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/acinclude.m4 b/acinclude.m4
+index 8b74ff1e..b66042f9 100644
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -30,7 +30,7 @@ if test "$ac_cv_func_select" = yes; then
+ #ifdef HAVE_SYS_SOCKET_H
+ #include <sys/socket.h>
+ #endif],
+-[extern select ($ac_cv_type_fd_set_size_t,
++[extern int select ($ac_cv_type_fd_set_size_t,
+  $ac_cv_type_fd_set *,	$ac_cv_type_fd_set *, $ac_cv_type_fd_set *,
+  $ac_type_timeval *);],
+ [ac_found=yes ; break 3],ac_found=no)
+diff --git a/configure.ac b/configure.ac
+index 97ab9e7a..c9fcede6 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -220,7 +220,7 @@ AC_MINIX
+ 
+ # catch -Werror and similar options when running configure
+ AC_TRY_COMPILE([#include <stdio.h>],
+-[int i; static j; int *p; char *c;
++[int i; int *p; char *c;
+   switch (*p = p = *c) { case 0: printf("%Q", c, p); }
+   *c = &i; c = p;
+   while (1 || (unsigned int)3 >= 0 || ((int)-1) == ((unsigned int)1));
+-- 
+2.45.0
+
meta-oe/recipes-graphics/fvwm/fvwm/0002-acinclude.m4-Add-missing-unistd.h-to-AM_SAFETY_CHECK.patch new file +32 -0
new file mode 100644
index 0000000000..50ecb20c72
@@ -0,0 +1,32 @@
+From 51287fb60263530f61b14df5519e10dabe67d2ad Mon Sep 17 00:00:00 2001
+From: Florian Weimer <[email protected]>
+Date: Thu, 24 Nov 2022 13:07:56 +0100
+Subject: [PATCH 2/3] acinclude.m4: Add missing <unistd.h> to
+ AM_SAFETY_CHECK_MKSTEMP
+
+Otherwise, the check fails on a compiler which does not support
+implicit function declarations (a language feature removed in 1999).
+
+Upstream-Status: Submitted [https://github.com/fvwmorg/fvwm/pull/100]
+Signed-off-by: Khem Raj <[email protected]>
+---
+ acinclude.m4 | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/acinclude.m4 b/acinclude.m4
+index b66042f9..4dee2abe 100644
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -1154,6 +1154,9 @@ AC_DEFUN([AM_SAFETY_CHECK_MKSTEMP],[
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#ifdef HAVE_UNISTD_H
++#include <unistd.h>
++#endif
+ int main(void)
+ {
+   char template[128];
+-- 
+2.45.0
+
meta-oe/recipes-graphics/fvwm/fvwm/0003-configure-Further-defang-the-Werror-check.patch new file +35 -0
new file mode 100644
index 0000000000..e9d780ddc6
@@ -0,0 +1,35 @@
+From 542c6f25327587d5a6bffb8a45b457ec85dcf8e1 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <[email protected]>
+Date: Tue, 19 Dec 2023 13:24:50 +0100
+Subject: [PATCH 3/3] configure: Further defang the -Werror check
+
+Incompatible pointer types are actually errors (in the sense
+that they are invalid C).  Compilers have merely tolerated them as
+warnings for backwards compatibility.  This is changing with Clang 16
+and GCC 14, so relax the check a little.
+
+Upstream-Status: Submitted [https://github.com/fvwmorg/fvwm/pull/100]
+Signed-off-by: Khem Raj <[email protected]>
+---
+ configure.ac | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index c9fcede6..2e9615b2 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -220,9 +220,8 @@ AC_MINIX
+ 
+ # catch -Werror and similar options when running configure
+ AC_TRY_COMPILE([#include <stdio.h>],
+-[int i; int *p; char *c;
+-  switch (*p = p = *c) { case 0: printf("%Q", c, p); }
+-  *c = &i; c = p;
++[int unused; int *p; char *c;
++  printf("%Q", c, p);
+   while (1 || (unsigned int)3 >= 0 || ((int)-1) == ((unsigned int)1));
+ ], , AC_MSG_ERROR("
+ configure is not able to compile programs with warnings.  Please
+-- 
+2.45.0
+
meta-oe/recipes-graphics/fvwm/fvwm_2.7.0.bb +3 -0
index 8daf38a0ba..df349494aa 100644
@@ -34,6 +34,9 @@ DEPENDS = " \
 SRC_URI = " \
     git://github.com/fvwmorg/fvwm.git;protocol=https;branch=master \
     file://0001-Fix-compilation-for-disabled-gnome.patch \
+    file://0001-configure-Do-not-require-support-for-implicit-ints.patch \
+    file://0002-acinclude.m4-Add-missing-unistd.h-to-AM_SAFETY_CHECK.patch \
+    file://0003-configure-Further-defang-the-Werror-check.patch \
 "
 
 SRCREV = "7baf540e56fb1a3e91752acba872a88543529d46"
Signature · 1 line
2.45.0
author
#1 lore raw

PATCH 2/4 python3-wxgtk4: Fix build with gcc-14

---
 .../0001-sip-Fix-build-with-gcc-14.patch      | 31 +++++++++++++++++++
 .../python3-wxgtk4/python3-wxgtk4_4.2.1.bb    |  1 +
 2 files changed, 32 insertions(+)
 create mode 100644 meta-python/recipes-devtools/python3-wxgtk4/python3-wxgtk4/0001-sip-Fix-build-with-gcc-14.patch
meta-python/recipes-devtools/python3-wxgtk4/python3-wxgtk4/0001-sip-Fix-build-with-gcc-14.patch new file +31 -0
new file mode 100644
index 0000000000..4782e74ef3
@@ -0,0 +1,31 @@
+From 5234a454a1b9f11f83e59909fb2972176497e02c Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Thu, 9 May 2024 17:35:11 -0700
+Subject: [PATCH] sip: Fix build with gcc-14
+
+Fixes -Wincompatible-pointer-types
+sip/siplib/siplib.c:3900:20: error: assignment to 'sipSimpleWrapper *' {aka 'struct _sipSimpleWrapper *'} from incompatible pointer type 'PyObject *' {aka 'struct _object *'} [-Wincompatible-pointer-types]
+|  3900 |             *selfp = va_arg(va, PyObject *);
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ sip/siplib/siplib.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sip/siplib/siplib.c b/sip/siplib/siplib.c
+index 95563e5c..ae3fac60 100644
+--- a/sip/siplib/siplib.c
++++ b/sip/siplib/siplib.c
+@@ -3897,7 +3897,7 @@ static int parsePass1(PyObject **parseErrp, sipSimpleWrapper **selfp,
+     {
+     case '#':
+             /* A ctor has an argument with the /Transfer/ annotation. */
+-            *selfp = va_arg(va, PyObject *);
++            *selfp = (sipSimpleWrapper *)va_arg(va, PyObject *);
+             break;
+ 
+     case 'B':
+-- 
+2.45.0
+
meta-python/recipes-devtools/python3-wxgtk4/python3-wxgtk4_4.2.1.bb +1 -0
index fb011cb71b..cc6b6cef67 100644
@@ -14,6 +14,7 @@ SRC_URI += "file://add-back-option-build-base.patch \
            file://wxgtk-fixup-build-scripts.patch \
            file://not-overwrite-cflags-cxxflags.patch \
            file://0001-sip-Conditionally-use-GetAssertStackTrace-under-USE_.patch \
+           file://0001-sip-Fix-build-with-gcc-14.patch \
            "
 SRC_URI[sha256sum] = "e48de211a6606bf072ec3fa778771d6b746c00b7f4b970eb58728ddf56d13d5c"
 
Signature · 1 line
2.45.0
author
#2 lore raw

PATCH 3/4 gtk+: Disable incompatible-pointer-types warning as error

In reply to Khem Raj

Fixes build with GCC-14 which treats this warning as error by default

---
 meta-oe/recipes-gnome/gtk+/gtk+_2.24.33.bb | 2 ++
 1 file changed, 2 insertions(+)
meta-oe/recipes-gnome/gtk+/gtk+_2.24.33.bb +2 -0
index 5eac641cf3..74b0531414 100644
@@ -32,3 +32,5 @@ python populate_packages:prepend () {
     if (d.getVar('DEBIAN_NAMES')):
         d.setVar(d.expand('PKG:${PN}'), '${MLPREFIX}libgtk-2.0')
 }
+
+CFLAGS += "-Wno-error=incompatible-pointer-types"
Signature · 1 line
2.45.0
author
#3 lore raw

PATCH 4/4 fluentbit: Upgrade to 1.9.9

In reply to Khem Raj

Disable incompatible-pointer-types warning as error to fix build with gcc-14

---
 ...xt-Do-not-use-private-makefile-target.patch | 18 ++++++------------
 .../{fluentbit_1.9.7.bb => fluentbit_1.9.9.bb} |  5 ++++-
 2 files changed, 10 insertions(+), 13 deletions(-)
 rename meta-oe/recipes-extended/fluentbit/{fluentbit_1.9.7.bb => fluentbit_1.9.9.bb} (95%)
meta-oe/recipes-extended/fluentbit/fluentbit/0001-CMakeLists.txt-Do-not-use-private-makefile-target.patch +6 -12
index f5a1716c07..0cabed9633 100644
@@ -15,8 +15,6 @@ Upstream-Status: Pending [https://github.com/fluent/fluent-bit/issues/5492]
  lib/cmetrics/CMakeLists.txt | 7 +------
  3 files changed, 3 insertions(+), 17 deletions(-)
 
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 3dba5a8..d94b988 100644
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
 @@ -46,11 +46,7 @@ else()
@@ -32,8 +30,6 @@ index 3dba5a8..d94b988 100644
  
  if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "armv7l")
    set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -latomic")
-diff --git a/lib/chunkio/CMakeLists.txt b/lib/chunkio/CMakeLists.txt
-index bbe1f39..809ea93 100644
 --- a/lib/chunkio/CMakeLists.txt
 +++ b/lib/chunkio/CMakeLists.txt
 @@ -14,12 +14,7 @@ else()
@@ -50,21 +46,19 @@ index bbe1f39..809ea93 100644
  
  include(cmake/macros.cmake)
  
-diff --git a/lib/cmetrics/CMakeLists.txt b/lib/cmetrics/CMakeLists.txt
-index 60e8774..e3d6149 100644
 --- a/lib/cmetrics/CMakeLists.txt
 +++ b/lib/cmetrics/CMakeLists.txt
 @@ -34,12 +34,7 @@ set(CMT_VERSION_MINOR  3)
- set(CMT_VERSION_PATCH  5)
+ set(CMT_VERSION_PATCH  7)
  set(CMT_VERSION_STR "${CMT_VERSION_MAJOR}.${CMT_VERSION_MINOR}.${CMT_VERSION_PATCH}")
  
--# Define __FILENAME__ consistently across Operating Systems
+-# Define __CMT_FILENAME__ consistently across Operating Systems
 -if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows")
--  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__='\"$(subst ${CMAKE_SOURCE_DIR}/,,$(abspath $<))\"'")
+-  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__CMT_FILENAME__='\"$(subst ${CMAKE_SOURCE_DIR}/,,$(abspath $<))\"'")
 -else()
--  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__=__FILE__")
+-  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__CMT_FILENAME__=__FILE__")
 -endif()
-+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__=__FILE__")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__CMT_FILENAME__=__FILE__")
  
  # Configuration options
- option(CMT_DEV             "Enable development mode"                   No)
+ option(CMT_DEV                       "Enable development mode"                   No)
meta-oe/recipes-extended/fluentbit/fluentbit_1.9.9.bb renamed from meta-oe/recipes-extended/fluentbit/fluentbit_1.9.7.bb +4 -1
similarity index 95%
rename from meta-oe/recipes-extended/fluentbit/fluentbit_1.9.7.bb
rename to meta-oe/recipes-extended/fluentbit/fluentbit_1.9.9.bb
index fc06095475..ef04111131 100644
@@ -29,7 +29,7 @@ SRC_URI:append:libc-musl = "\
            file://0001-Use-posix-strerror_r-with-musl.patch \
            file://0002-chunkio-Link-with-fts-library-with-musl.patch \
            "
-SRC_URI[sha256sum] = "8ca2ac081d7eee717483c06608adcb5e3d5373e182ad87dba21a23f8278c6540"
+SRC_URI[sha256sum] = "3f6cd4bd1894cda16b465aef6ffec7e920d54c4209b3e2320fcffe7ae345700e"
 S = "${WORKDIR}/fluent-bit-${PV}"
 
 DEPENDS = "zlib bison-native flex-native openssl"
@@ -84,6 +84,9 @@ EXTRA_OECMAKE:append:x86 = " -DCMAKE_C_STANDARD_LIBRARIES=-latomic"
 
 CFLAGS:append:x86 = " -DMBEDTLS_HAVE_SSE2"
 
+# Fixes build with GCC-14
+CFLAGS += "-Wno-error=incompatible-pointer-types"
+
 inherit cmake systemd pkgconfig
 
 SYSTEMD_SERVICE:${PN} = "td-agent-bit.service"
Signature · 1 line
2.45.0