From a5af3cafa26645349c04b33a3db9f74d5b8d3dbd Mon Sep 17 00:00:00 2001 From: Hao Guan <10684225+hguandl@users.noreply.github.com> Date: Wed, 5 Jun 2024 00:18:09 +0800 Subject: [PATCH] tools: fix build on macOS Sonoma (#12212) * tools/coreutils: update to 9.3 * tools/cpio: update to 2.15 * libjson-c: update to 0.17 * gettext-full: fix clang build errors * toolchain: gcc: update to 13.3 * tools: b43-tools: fix compilation with GCC14 --- package/libs/gettext-full/Makefile | 1 + .../gettext-full/patches/020-fix_clang.patch | 11 +++++++++++ package/libs/libjson-c/Makefile | 6 +++--- .../patches/001-dont-build-docs.patch | 2 +- toolchain/gcc/Config.version | 2 +- toolchain/gcc/common.mk | 4 ++-- .../300-mips_Os_cpu_rtx_cost_model.patch | 2 +- .../970-macos_arm64-building-fix.patch | 2 +- tools/b43-tools/Makefile | 2 +- tools/coreutils/Makefile | 4 ++-- tools/cpio/Makefile | 4 ++-- .../patches/001-duplicate-program-name.patch | 18 ------------------ tools/cpio/patches/010-clang.patch | 11 ----------- 13 files changed, 26 insertions(+), 43 deletions(-) create mode 100644 package/libs/gettext-full/patches/020-fix_clang.patch delete mode 100644 tools/cpio/patches/001-duplicate-program-name.patch delete mode 100644 tools/cpio/patches/010-clang.patch diff --git a/package/libs/gettext-full/Makefile b/package/libs/gettext-full/Makefile index 2319401ba..55164644e 100644 --- a/package/libs/gettext-full/Makefile +++ b/package/libs/gettext-full/Makefile @@ -64,6 +64,7 @@ HOST_CONFIGURE_ARGS += \ --disable-rpath \ --disable-java \ --disable-openmp \ + --disable-curses \ --without-emacs \ --without-libxml2-prefix diff --git a/package/libs/gettext-full/patches/020-fix_clang.patch b/package/libs/gettext-full/patches/020-fix_clang.patch new file mode 100644 index 000000000..284b5ab9f --- /dev/null +++ b/package/libs/gettext-full/patches/020-fix_clang.patch @@ -0,0 +1,11 @@ +--- a/libtextstyle/lib/iconv-ostream.c ++++ b/libtextstyle/lib/iconv-ostream.c +@@ -231,7 +231,7 @@ iconv_ostream__write_mem (iconv_ostream_t stream, const void *data, size_t len) + } + + static void +-iconv_ostream__flush (iconv_ostream_t stream) ++iconv_ostream__flush (iconv_ostream_t stream, ostream_flush_scope_t scope) + { + abort (); + } diff --git a/package/libs/libjson-c/Makefile b/package/libs/libjson-c/Makefile index 2c312f200..063cf2644 100644 --- a/package/libs/libjson-c/Makefile +++ b/package/libs/libjson-c/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=json-c -PKG_VERSION:=0.16 -PKG_RELEASE:=2 +PKG_VERSION:=0.17 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-nodoc.tar.gz PKG_SOURCE_URL:=https://s3.amazonaws.com/json-c_releases/releases/ -PKG_HASH:=ac8a3dd6820daaca579b23fbc74664310fbc3d67f52f6707cda67d21dde5570f +PKG_HASH:=8df3b66597333dd365762cab2de2ff68e41e3808a04b692e696e0550648eefaa PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=MIT diff --git a/package/libs/libjson-c/patches/001-dont-build-docs.patch b/package/libs/libjson-c/patches/001-dont-build-docs.patch index f35da8072..1de420f8b 100644 --- a/package/libs/libjson-c/patches/001-dont-build-docs.patch +++ b/package/libs/libjson-c/patches/001-dont-build-docs.patch @@ -1,6 +1,6 @@ --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -433,8 +433,6 @@ configure_file(json.h.cmakein ${PROJECT_ +@@ -451,8 +451,6 @@ configure_file(json.h.cmakein ${PROJECT_ include_directories(${PROJECT_SOURCE_DIR}) include_directories(${PROJECT_BINARY_DIR}) diff --git a/toolchain/gcc/Config.version b/toolchain/gcc/Config.version index 8670f49b4..9ffe34066 100644 --- a/toolchain/gcc/Config.version +++ b/toolchain/gcc/Config.version @@ -16,5 +16,5 @@ config GCC_VERSION string default "8.4.0" if GCC_VERSION_8 default "12.2.0" if GCC_VERSION_12 - default "13.2.0" if GCC_VERSION_13 + default "13.3.0" if GCC_VERSION_13 default "11.3.0" diff --git a/toolchain/gcc/common.mk b/toolchain/gcc/common.mk index a87cf8cca..55be62280 100644 --- a/toolchain/gcc/common.mk +++ b/toolchain/gcc/common.mk @@ -41,8 +41,8 @@ ifeq ($(PKG_VERSION),12.2.0) PKG_HASH:=e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff endif -ifeq ($(PKG_VERSION),13.2.0) - PKG_HASH:=e275e76442a6067341a27f04c5c6b83d8613144004c0413528863dc6b5c743da +ifeq ($(PKG_VERSION),13.3.0) + PKG_HASH:=0845e9621c9543a13f484e94584a49ffc0129970e9914624235fc1d061a0c083 endif PATCH_DIR=../patches-$(GCC_MAJOR_VERSION).x diff --git a/toolchain/gcc/patches-13.x/300-mips_Os_cpu_rtx_cost_model.patch b/toolchain/gcc/patches-13.x/300-mips_Os_cpu_rtx_cost_model.patch index ce21e0433..2ca42ad77 100644 --- a/toolchain/gcc/patches-13.x/300-mips_Os_cpu_rtx_cost_model.patch +++ b/toolchain/gcc/patches-13.x/300-mips_Os_cpu_rtx_cost_model.patch @@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau --- a/gcc/config/mips/mips.cc +++ b/gcc/config/mips/mips.cc -@@ -20213,7 +20213,7 @@ mips_option_override (void) +@@ -20219,7 +20219,7 @@ mips_option_override (void) flag_pcc_struct_return = 0; /* Decide which rtx_costs structure to use. */ diff --git a/toolchain/gcc/patches-13.x/970-macos_arm64-building-fix.patch b/toolchain/gcc/patches-13.x/970-macos_arm64-building-fix.patch index 7844268e7..a0470b139 100644 --- a/toolchain/gcc/patches-13.x/970-macos_arm64-building-fix.patch +++ b/toolchain/gcc/patches-13.x/970-macos_arm64-building-fix.patch @@ -17,7 +17,7 @@ Date: Mon Aug 16 13:16:21 2021 +0100 --- a/gcc/config/aarch64/aarch64.h +++ b/gcc/config/aarch64/aarch64.h -@@ -1185,7 +1185,7 @@ extern enum aarch64_code_model aarch64_c +@@ -1195,7 +1195,7 @@ extern enum aarch64_code_model aarch64_c /* Extra specs when building a native AArch64-hosted compiler. Option rewriting rules based on host system. */ diff --git a/tools/b43-tools/Makefile b/tools/b43-tools/Makefile index bae498c78..19918efde 100644 --- a/tools/b43-tools/Makefile +++ b/tools/b43-tools/Makefile @@ -23,7 +23,7 @@ define Host/Compile $(HOST_MAKE_FLAGS) \ $(1) QUIET_SPARSE=: +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR)/assembler \ - CFLAGS="$(HOST_CFLAGS) -include endian.h" \ + CFLAGS="$(HOST_CFLAGS) -include endian.h -Wno-error=int-conversion" \ $(HOST_MAKE_FLAGS) \ LDFLAGS= \ $(1) QUIET_SPARSE=: diff --git a/tools/coreutils/Makefile b/tools/coreutils/Makefile index c64210c5a..f799e83c5 100644 --- a/tools/coreutils/Makefile +++ b/tools/coreutils/Makefile @@ -8,11 +8,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=coreutils PKG_CPE_ID:=cpe:/a:gnu:coreutils -PKG_VERSION:=8.32 +PKG_VERSION:=9.3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/coreutils -PKG_HASH:=4458d8de7849df44ccab15e16b1548b285224dbba5f08fac070c1c0e0bcc4cfa +PKG_HASH:=adbcfcfe899235b71e8768dcf07cd532520b7f54f9a8064843f8d199a904bbaa HOST_BUILD_PARALLEL := 1 diff --git a/tools/cpio/Makefile b/tools/cpio/Makefile index 82b5aa836..bd6e25898 100644 --- a/tools/cpio/Makefile +++ b/tools/cpio/Makefile @@ -3,11 +3,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=cpio PKG_CPE_ID:=cpe:/a:gnu:cpio -PKG_VERSION:=2.13 +PKG_VERSION:=2.15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=@GNU/cpio -PKG_HASH:=eab5bdc5ae1df285c59f2a4f140a98fc33678a0bf61bdba67d9436ae26b46f6d +PKG_HASH:=937610b97c329a1ec9268553fb780037bcfff0dcffe9725ebc4fd9c1aa9075db include $(INCLUDE_DIR)/host-build.mk diff --git a/tools/cpio/patches/001-duplicate-program-name.patch b/tools/cpio/patches/001-duplicate-program-name.patch deleted file mode 100644 index a7c3fbc8a..000000000 --- a/tools/cpio/patches/001-duplicate-program-name.patch +++ /dev/null @@ -1,18 +0,0 @@ -author Sergey Poznyakoff - -https://git.savannah.gnu.org/cgit/cpio.git/commit/?id=641d3f489cf6238bb916368d4ba0d9325a235afb - -* src/global.c: Remove superfluous declaration of program_name - ---- a/src/global.c -+++ b/src/global.c -@@ -184,9 +184,6 @@ unsigned int warn_option = 0; - /* Extract to standard output? */ - bool to_stdout_option = false; - --/* The name this program was run with. */ --char *program_name; -- - /* A pointer to either lstat or stat, depending on whether - dereferencing of symlinks is done for input files. */ - int (*xstat) (); diff --git a/tools/cpio/patches/010-clang.patch b/tools/cpio/patches/010-clang.patch deleted file mode 100644 index 89c7a8149..000000000 --- a/tools/cpio/patches/010-clang.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/gnu/xalloc-oversized.h -+++ b/gnu/xalloc-oversized.h -@@ -52,7 +52,7 @@ typedef size_t __xalloc_count_type; - #elif ((5 <= __GNUC__ \ - || (__has_builtin (__builtin_mul_overflow) \ - && __has_builtin (__builtin_constant_p))) \ -- && !__STRICT_ANSI__) -+ && !__STRICT_ANSI__) && !defined(__clang__) - # define xalloc_oversized(n, s) \ - (__builtin_constant_p (n) && __builtin_constant_p (s) \ - ? __xalloc_oversized (n, s) \