[openwrt/openwrt] tools/coreutils: fix compilation on macOS 14

LEDE Commits lede-commits at lists.infradead.org
Sat Apr 27 06:14:53 PDT 2024


robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-22.03:
https://git.openwrt.org/eede9b1bc4404ae19dc86aeee13ffe5f485115c1

commit eede9b1bc4404ae19dc86aeee13ffe5f485115c1
Author: Robert Marko <robimarko at gmail.com>
AuthorDate: Sat Apr 27 13:55:46 2024 +0200

    tools/coreutils: fix compilation on macOS 14
    
    Current coreutils 8.32 in 22.03 will fail to compile when using macOS 14 with:
    depbase=`echo lib/obstack.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
    gcc  -I. -I./lib  -Ilib -I./lib -Isrc -I./src -I/Volumes/OpenWrt/openwrt/staging_dir/host/include    -O2 -I/Volumes/OpenWrt/openwrt/staging_dir/host/include  -MT lib/obstack.o -MD -MP -MF $depbase.Tpo -c -o lib/obstack.o lib/obstack.c &&\
    mv -f $depbase.Tpo $depbase.Po
    lib/obstack.c:351:31: error: incompatible function pointer types initializing 'void (*)(void) __attribute__((noreturn))' with an expression of type 'void (void)' [-Wincompatible-function-pointer-types]
    __attribute_noreturn__ void (*obstack_alloc_failed_handler) (void)
                                  ^
    1 error generated.
    
    Backporting gnulib commit ("obstack: Fix a clang warning") fixes this.
    
    Fixes: #15270
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../patches/0001-obstack-Fix-a-clang-warning.patch  | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/tools/coreutils/patches/0001-obstack-Fix-a-clang-warning.patch b/tools/coreutils/patches/0001-obstack-Fix-a-clang-warning.patch
new file mode 100644
index 0000000000..01013adcba
--- /dev/null
+++ b/tools/coreutils/patches/0001-obstack-Fix-a-clang-warning.patch
@@ -0,0 +1,21 @@
+From 0cc39712803ade7b2d4b89c36b143dad72404063 Mon Sep 17 00:00:00 2001
+From: Bruno Haible <bruno at clisp.org>
+Date: Sun, 18 Oct 2020 14:37:13 +0200
+Subject: [PATCH] obstack: Fix a clang warning.
+
+* lib/obstack.c (print_and_abort): Mark as __attribute_noreturn__.
+---
+ lib/obstack.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/lib/obstack.c
++++ b/lib/obstack.c
+@@ -326,7 +326,7 @@ int obstack_exit_failure = EXIT_FAILURE;
+ #   include <libio/iolibio.h>
+ #  endif
+ 
+-static _Noreturn void
++static __attribute_noreturn__ void
+ print_and_abort (void)
+ {
+   /* Don't change any of these strings.  Yes, it would be possible to add




More information about the lede-commits mailing list