ncurses: Pin to C17 standard
PATCH 1/3 ncurses: Pin to C17 standard
From: Khem Raj <[email protected]>
Newer snapshots of ncurses have the fixes but they are many needed to get C23 going. Until next release lets stick with C17 even while GCC 15 switches to C23 defaults.
For scarthgap also add it in BUILD_CFLAGS.
Signed-off-by Khem Raj <[email protected]>
Signed-off-by Richard Purdie <[email protected]>
Signed-off-by Martin Jansa <[email protected]>
--- meta/recipes-core/ncurses/ncurses.inc | 4 ++++ 1 file changed, 4 insertions(+)
meta/recipes-core/ncurses/ncurses.inc +4 -0
@@ -30,6 +30,10 @@ ENABLE_WIDEC ?= "true" # _GNU_SOURCE is required for widec stuff and is not detected automatically CPPFLAGS += "-D_GNU_SOURCE" +# Check if we still need it when next release (6.6) happens +CFLAGS += "-std=gnu17" +BUILD_CFLAGS += "-std=gnu17" + # natives don't generally look in base_libdir base_libdir:class-native = "${libdir}"
PATCH 2/3 cmake: fix build with gcc-15 on host
From: Martin Jansa <[email protected]>
Signed-off-by Martin Jansa <[email protected]>
--- meta/recipes-devtools/cmake/cmake.inc | 1 + .../0001-cppdap-fix-build-with-gcc-15.patch | 30 +++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 meta/recipes-devtools/cmake/cmake/0001-cppdap-fix-build-with-gcc-15.patch
meta/recipes-devtools/cmake/cmake.inc +1 -0
@@ -18,6 +18,7 @@ CMAKE_MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:2])}" SRC_URI = "https://cmake.org/files/v${CMAKE_MAJOR_VERSION}/cmake-${PV}.tar.gz \ file://0001-CMakeDetermineCompilerABI-Strip-pipe-from-compile-fl.patch \ + file://0001-cppdap-fix-build-with-gcc-15.patch \ " SRC_URI[sha256sum] = "72b7570e5c8593de6ac4ab433b73eab18c5fb328880460c86ce32608141ad5c1"
meta/recipes-devtools/cmake/cmake/0001-cppdap-fix-build-with-gcc-15.patch new file +30 -0
@@ -0,0 +1,30 @@ +From f742c298a0d6b70059e5c98c89d301e62a3e2087 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Christoph=20Gr=C3=BCninger?= <[email protected]> +Date: Thu, 8 Aug 2024 20:26:35 +0200 +Subject: [PATCH] cppdap: include/dap/network.h: add <stdint.h> include for GCC + 15 + +GCC 15 requires the include for the declaration of `uint32_t`. +Backport [cppdap PR 133](https://github.com/google/cppdap/pull/133). + +Upstream-Status: Backport [https://gitlab.kitware.com/cmake/cmake/-/commit/f742c298a0d6b70059e5c98c89d301e62a3e2087] +Signed-off-by: Martin Jansa <[email protected]> +--- + Utilities/cmcppdap/include/dap/network.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/Utilities/cmcppdap/include/dap/network.h b/Utilities/cmcppdap/include/dap/network.h +index 9d14f6b70fa..dd3e0062407 100644 +--- a/Utilities/cmcppdap/include/dap/network.h ++++ b/Utilities/cmcppdap/include/dap/network.h +@@ -17,6 +17,7 @@ + + #include <functional> + #include <memory> ++#include <stdint.h> + + namespace dap { + class ReaderWriter; +-- +GitLab +
PATCH 3/3 git: fix build with gcc-15 on host
In reply to [email protected]From: Martin Jansa <[email protected]>
Signed-off-by Martin Jansa <[email protected]>
--- ...ndex-pack-rename-struct-thread_local.patch | 67 +++++++++++++++++++ .../git/0001-reflog-rename-unreachable.patch | 40 +++++++++++ meta/recipes-devtools/git/git_2.44.4.bb | 2 + 3 files changed, 109 insertions(+) create mode 100644 meta/recipes-devtools/git/git/0001-index-pack-rename-struct-thread_local.patch create mode 100644 meta/recipes-devtools/git/git/0001-reflog-rename-unreachable.patch
meta/recipes-devtools/git/git/0001-index-pack-rename-struct-thread_local.patch new file +67 -0
@@ -0,0 +1,67 @@ +From e8b3bcf49120309b207b7afc25c4aa81b866ac45 Mon Sep 17 00:00:00 2001 +From: "brian m. carlson" <[email protected]> +Date: Sun, 17 Nov 2024 01:31:48 +0000 +Subject: [PATCH] index-pack: rename struct thread_local + +"thread_local" is a keyword in C23. To make sure that our code compiles +on a wide variety of C versions, rename struct thread_local to "struct +thread_local_data" to avoid a conflict. + +Signed-off-by: brian m. carlson <[email protected]> +Signed-off-by: Junio C Hamano <[email protected]> + +Upstream-Status: Backport [v2.48.0 e8b3bcf49120309b207b7afc25c4aa81b866ac45] +Signed-off-by: Martin Jansa <[email protected]> +--- + builtin/index-pack.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/builtin/index-pack.c b/builtin/index-pack.c +index e228c56ff2..74675dbd6c 100644 +--- a/builtin/index-pack.c ++++ b/builtin/index-pack.c +@@ -94,7 +94,7 @@ static LIST_HEAD(done_head); + static size_t base_cache_used; + static size_t base_cache_limit; + +-struct thread_local { ++struct thread_local_data { + pthread_t thread; + int pack_fd; + }; +@@ -117,7 +117,7 @@ static struct object_entry *objects; + static struct object_stat *obj_stat; + static struct ofs_delta_entry *ofs_deltas; + static struct ref_delta_entry *ref_deltas; +-static struct thread_local nothread_data; ++static struct thread_local_data nothread_data; + static int nr_objects; + static int nr_ofs_deltas; + static int nr_ref_deltas; +@@ -148,7 +148,7 @@ static uint32_t input_crc32; + static int input_fd, output_fd; + static const char *curr_pack; + +-static struct thread_local *thread_data; ++static struct thread_local_data *thread_data; + static int nr_dispatched; + static int threads_active; + +@@ -390,7 +390,7 @@ static NORETURN void bad_object(off_t offset, const char *format, ...) + (uintmax_t)offset, buf); + } + +-static inline struct thread_local *get_thread_data(void) ++static inline struct thread_local_data *get_thread_data(void) + { + if (HAVE_THREADS) { + if (threads_active) +@@ -401,7 +401,7 @@ static inline struct thread_local *get_thread_data(void) + return ¬hread_data; + } + +-static void set_thread_data(struct thread_local *data) ++static void set_thread_data(struct thread_local_data *data) + { + if (threads_active) + pthread_setspecific(key, data);
meta/recipes-devtools/git/git/0001-reflog-rename-unreachable.patch new file +40 -0
@@ -0,0 +1,40 @@ +From 639cd8db63b07c958062bde4d3823dadbf469b0b Mon Sep 17 00:00:00 2001 +From: "brian m. carlson" <[email protected]> +Date: Sun, 17 Nov 2024 01:31:49 +0000 +Subject: [PATCH] reflog: rename unreachable + +In C23, "unreachable" is a macro that invokes undefined behavior if it +is invoked. To make sure that our code compiles on a variety of C +versions, rename unreachable to "is_unreachable". + +Signed-off-by: brian m. carlson <[email protected]> +Signed-off-by: Junio C Hamano <[email protected]> + +Upstream-Status: Backport [v2.48.0 639cd8db63b07c958062bde4d3823dadbf469b0b] +Signed-off-by: Martin Jansa <[email protected]> +--- + reflog.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/reflog.c b/reflog.c +index 875ac1aa66..aeab78c9b7 100644 +--- a/reflog.c ++++ b/reflog.c +@@ -210,7 +210,7 @@ static void mark_reachable(struct expire_reflog_policy_cb *cb) + cb->mark_list = leftover; + } + +-static int unreachable(struct expire_reflog_policy_cb *cb, struct commit *commit, struct object_id *oid) ++static int is_unreachable(struct expire_reflog_policy_cb *cb, struct commit *commit, struct object_id *oid) + { + /* + * We may or may not have the commit yet - if not, look it +@@ -265,7 +265,7 @@ int should_expire_reflog_ent(struct object_id *ooid, struct object_id *noid, + return 1; + case UE_NORMAL: + case UE_HEAD: +- if (unreachable(cb, old_commit, ooid) || unreachable(cb, new_commit, noid)) ++ if (is_unreachable(cb, old_commit, ooid) || is_unreachable(cb, new_commit, noid)) + return 1; + break; + }
meta/recipes-devtools/git/git_2.44.4.bb +2 -0
@@ -11,6 +11,8 @@ PROVIDES:append:class-native = " git-replacement-native" SRC_URI = "${KERNELORG_MIRROR}/software/scm/git/git-${PV}.tar.gz;name=tarball \ file://fixsort.patch \ file://0001-config.mak.uname-do-not-force-RHEL-7-specific-build-.patch \ + file://0001-reflog-rename-unreachable.patch \ + file://0001-index-pack-rename-struct-thread_local.patch \ " SRC_URI:append:class-nativesdk = " \