From b6d5db383a0f9586d9bea494352102947403be2c Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Mon, 29 Aug 2022 07:26:52 +0200 Subject: [PATCH 01/28] tools/bc: update to 1.07 Update to latest version. Replace mirror with @GNU/bc. Manually refresh: - 001-no_doc.patch Add patch found here: https://github.com/fivepiece/gnu-bc/commit/26f275502dd28114e78bc098fed81acde1d86d62 as 002-fix-libmath.patch to fix compilation. Add another patch found here: https://github.com/archlinux/svntogit-packages/commit/55b26eda94e1a9ff726ac458fccab5f3f3ad2114 as 003-bc-fix-hang.patch to prevent a hang when building the kernel. Signed-off-by: Nick Hainke --- tools/bc/Makefile | 11 ++++----- tools/bc/patches/001-no_doc.patch | 24 +++++++++---------- tools/bc/patches/002-fix-libmath.patch | 32 ++++++++++++++++++++++++++ tools/bc/patches/003-bc-fix-hang.patch | 11 +++++++++ 4 files changed, 58 insertions(+), 20 deletions(-) create mode 100644 tools/bc/patches/002-fix-libmath.patch create mode 100644 tools/bc/patches/003-bc-fix-hang.patch diff --git a/tools/bc/Makefile b/tools/bc/Makefile index 73dbdab49..74d373a81 100644 --- a/tools/bc/Makefile +++ b/tools/bc/Makefile @@ -7,14 +7,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=bc -PKG_VERSION:=1.06.95 +PKG_VERSION:=1.07 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_SOURCE_URL:=https://alpha.gnu.org/gnu/bc \ - https://gnualpha.uib.no/bc/ \ - https://mirrors.fe.up.pt/pub/gnu-alpha/bc/ \ - https://www.nic.funet.fi/pub/gnu/alpha/gnu/bc/ -PKG_HASH:=7ee4abbcfac03d8a6e1a8a3440558a3d239d6b858585063e745c760957725ecc +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@GNU/bc +PKG_HASH:=55cf1fc33a728d7c3d386cc7b0cb556eb5bacf8e0cb5a3fcca7f109fc61205ad PKG_FIXUP := autoreconf diff --git a/tools/bc/patches/001-no_doc.patch b/tools/bc/patches/001-no_doc.patch index 50deee8c8..119f111f4 100644 --- a/tools/bc/patches/001-no_doc.patch +++ b/tools/bc/patches/001-no_doc.patch @@ -1,6 +1,5 @@ -diff -urN bc-1.06.95/Makefile.am bc-1.06.95.new/Makefile.am ---- bc-1.06.95/Makefile.am 2005-05-27 01:05:41.000000000 +0100 -+++ bc-1.06.95.new/Makefile.am 2013-07-09 09:33:31.521490710 +0100 +--- a/Makefile.am ++++ b/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in @@ -8,16 +7,15 @@ diff -urN bc-1.06.95/Makefile.am bc-1.06.95.new/Makefile.am +SUBDIRS = lib bc dc MAINTAINERCLEANFILES = aclocal.m4 config.h.in configure Makefile.in \ - stamp-h $(distdir).tar.gz h/number.h depcomp missing -diff -urN bc-1.06.95/Makefile.in bc-1.06.95.new/Makefile.in ---- bc-1.06.95/Makefile.in 2006-09-05 03:39:30.000000000 +0100 -+++ bc-1.06.95.new/Makefile.in 2013-07-09 09:33:28.565490767 +0100 -@@ -149,7 +149,7 @@ - sharedstatedir = @sharedstatedir@ - sysconfdir = @sysconfdir@ - target_alias = @target_alias@ + stamp-h $(distdir).tar.gz h/number.h depcomp missing \ +--- a/Makefile.in ++++ b/Makefile.in +@@ -288,7 +288,7 @@ target_alias = @target_alias@ + top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ -SUBDIRS = lib bc dc doc +SUBDIRS = lib bc dc MAINTAINERCLEANFILES = aclocal.m4 config.h.in configure Makefile.in \ - stamp-h $(distdir).tar.gz h/number.h depcomp missing - + stamp-h $(distdir).tar.gz h/number.h depcomp missing \ + bc/libmath.h diff --git a/tools/bc/patches/002-fix-libmath.patch b/tools/bc/patches/002-fix-libmath.patch new file mode 100644 index 000000000..1a8439542 --- /dev/null +++ b/tools/bc/patches/002-fix-libmath.patch @@ -0,0 +1,32 @@ +--- a/bc/fix-libmath_h ++++ b/bc/fix-libmath_h +@@ -1,9 +1,9 @@ +-ed libmath.h < Date: Sat, 3 Sep 2022 17:38:43 +0200 Subject: [PATCH 02/28] tools/bc: add PKG_CPE_ID Add CPE ID for tracking CVEs. Signed-off-by: Nick Hainke --- tools/bc/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/bc/Makefile b/tools/bc/Makefile index 74d373a81..9e1b2ba33 100644 --- a/tools/bc/Makefile +++ b/tools/bc/Makefile @@ -14,6 +14,7 @@ PKG_SOURCE_URL:=@GNU/bc PKG_HASH:=55cf1fc33a728d7c3d386cc7b0cb556eb5bacf8e0cb5a3fcca7f109fc61205ad PKG_FIXUP := autoreconf +PKG_CPE_ID:=cpe:/a:gnu:bc include $(INCLUDE_DIR)/host-build.mk From 2f0c140d8aa9471b6f09d6427af6ce21fc360c8f Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 6 Mar 2022 20:46:22 -0800 Subject: [PATCH 03/28] tools/ccache: update to 4.6 Full changelog: https://ccache.dev/releasenotes.html#_ccache_4_6 Signed-off-by: Rosen Penev --- tools/ccache/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/ccache/Makefile b/tools/ccache/Makefile index 3efbcea32..e31aa405d 100644 --- a/tools/ccache/Makefile +++ b/tools/ccache/Makefile @@ -8,11 +8,11 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/target.mk PKG_NAME:=ccache -PKG_VERSION:=4.5.1 +PKG_VERSION:=4.6 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://github.com/ccache/ccache/releases/download/v$(PKG_VERSION) -PKG_HASH:=51186ebe0326365f4e6131e1caa8911de7da4aa6718efc00680322d63a759517 +PKG_HASH:=3d2bb860f4359169e640f60cf7cc11da5fab5fb9aed55230d78141e49c3945e9 HOST_BUILD_PARALLEL:=1 From 92a45442a5e069a4e4b28b21203b3bed4519263c Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Wed, 1 Sep 2021 19:57:58 -0700 Subject: [PATCH 04/28] tools/dosfstools: update to 4.2 Remove upstream backport. Signed-off-by: Rosen Penev --- tools/dosfstools/Makefile | 4 +-- ..._CHECK_LIB-for-iconv-library-linking.patch | 27 ------------------- 2 files changed, 2 insertions(+), 29 deletions(-) delete mode 100644 tools/dosfstools/patches/0002-Switch-to-AC_CHECK_LIB-for-iconv-library-linking.patch diff --git a/tools/dosfstools/Makefile b/tools/dosfstools/Makefile index e34ceaf32..d52c46b30 100644 --- a/tools/dosfstools/Makefile +++ b/tools/dosfstools/Makefile @@ -9,12 +9,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dosfstools PKG_CPE_ID:=cpe:/a:dosfstools_project:dosfstools -PKG_VERSION:=4.1 +PKG_VERSION:=4.2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://github.com/dosfstools/dosfstools/releases/download/v$(PKG_VERSION)/ \ http://fossies.org/linux/misc -PKG_HASH:=e6b2aca70ccc3fe3687365009dd94a2e18e82b688ed4e260e04b7412471cc173 +PKG_HASH:=ba7c716ff9b8208a3bba5094a77584a7dc814141de09ab4ce1ae9b84bbcd7844 HOST_FIXUP:=autoreconf diff --git a/tools/dosfstools/patches/0002-Switch-to-AC_CHECK_LIB-for-iconv-library-linking.patch b/tools/dosfstools/patches/0002-Switch-to-AC_CHECK_LIB-for-iconv-library-linking.patch deleted file mode 100644 index ea9332082..000000000 --- a/tools/dosfstools/patches/0002-Switch-to-AC_CHECK_LIB-for-iconv-library-linking.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 1c6c135ee15e449c1bf2e76d5307f83a3a1d7425 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= -Date: Tue, 11 Oct 2016 12:07:48 +0200 -Subject: [PATCH] Switch to AC_CHECK_LIB for iconv library linking. -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -AC_SEARCH_LIB doesn't work properly for openwrt/lede when building dosfstools -as a package. - -Signed-off-by: Álvaro Fernández Rojas ---- - configure.ac | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/configure.ac -+++ b/configure.ac -@@ -59,7 +59,7 @@ if test "x$with_udev" != "xno"; then - [true]) - fi - --AC_SEARCH_LIBS(iconv_open, iconv) -+AC_CHECK_LIB(iconv, iconv_open) - - # xxd (distributed with vim) is used in the testsuite - AC_CHECK_PROG([XXD_FOUND], [xxd], [yes]) From e1e3f68dcf112ad05292d1cf0c14ddea5903b0f0 Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Wed, 30 Mar 2022 23:36:38 +0100 Subject: [PATCH 05/28] tools: SOURCE_DATE_EPOCH handling for mkfs.fat Backport upstream patch to have reproducible FAT signatures. This should enable reproducibility for x86 EFI images. Signed-off-by: Paul Spooren --- .../patches/source-date-epoch.patch | 157 ++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 tools/dosfstools/patches/source-date-epoch.patch diff --git a/tools/dosfstools/patches/source-date-epoch.patch b/tools/dosfstools/patches/source-date-epoch.patch new file mode 100644 index 000000000..fb46753f2 --- /dev/null +++ b/tools/dosfstools/patches/source-date-epoch.patch @@ -0,0 +1,157 @@ +From 8da7bc93315cb0c32ad868f17808468b81fa76ec Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= +Date: Wed, 5 Dec 2018 19:52:51 +0100 +Subject: [PATCH] Honor the SOURCE_DATE_EPOCH variable +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Implement the SOURCE_DATE_EPOCH specification[1] for reproducible +builds. If SOURCE_DATE_EPOCH is set, use it as timestamp instead of the +current time. + +[1] https://reproducible-builds.org/specs/source-date-epoch/ + +Signed-off-by: Bjørn Forsman +--- + src/boot.c | 23 +++++++++++++++++++++-- + src/common.c | 18 ++++++++++++++++-- + src/mkfs.fat.c | 19 ++++++++++++++++--- + 3 files changed, 53 insertions(+), 7 deletions(-) + +diff --git a/src/boot.c b/src/boot.c +index 4de450d..8f78e1c 100644 +--- a/src/boot.c ++++ b/src/boot.c +@@ -33,6 +33,8 @@ + #include + #include + #include ++#include ++#include + + #include "common.h" + #include "fsck.fat.h" +@@ -672,6 +674,7 @@ void write_volume_label(DOS_FS * fs, char *label) + { + time_t now; + struct tm *mtime; ++ char *source_date_epoch = NULL; + off_t offset; + int created; + DIR_ENT de; +@@ -687,8 +690,24 @@ void write_volume_label(DOS_FS * fs, char *label) + if (de.name[0] == 0xe5) + de.name[0] = 0x05; + +- now = time(NULL); +- mtime = (now != (time_t)-1) ? localtime(&now) : NULL; ++ source_date_epoch = getenv("SOURCE_DATE_EPOCH"); ++ if (source_date_epoch) { ++ char *tmp = NULL; ++ long long conversion = 0; ++ errno = 0; ++ conversion = strtoll(source_date_epoch, &tmp, 10); ++ now = conversion; ++ if (!isdigit((unsigned char)*source_date_epoch) || *tmp != '\0' ++ || errno != 0 || (long long)now != conversion) { ++ die("SOURCE_DATE_EPOCH is too big or contains non-digits: \"%s\"", ++ source_date_epoch); ++ } ++ mtime = gmtime(&now); ++ } else { ++ now = time(NULL); ++ mtime = (now != (time_t)-1) ? localtime(&now) : NULL; ++ } ++ + if (mtime && mtime->tm_year >= 80 && mtime->tm_year <= 207) { + de.time = htole16((unsigned short)((mtime->tm_sec >> 1) + + (mtime->tm_min << 5) + +diff --git a/src/common.c b/src/common.c +index 6a2e396..4f1afcb 100644 +--- a/src/common.c ++++ b/src/common.c +@@ -30,6 +30,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -298,8 +299,21 @@ void check_atari(void) + uint32_t generate_volume_id(void) + { + struct timeval now; +- +- if (gettimeofday(&now, NULL) != 0 || now.tv_sec == (time_t)-1 || now.tv_sec < 0) { ++ char *source_date_epoch = NULL; ++ ++ source_date_epoch = getenv("SOURCE_DATE_EPOCH"); ++ if (source_date_epoch) { ++ char *tmp = NULL; ++ long long conversion = 0; ++ errno = 0; ++ conversion = strtoll(source_date_epoch, &tmp, 10); ++ if (!isdigit((unsigned char)*source_date_epoch) || *tmp != '\0' ++ || errno != 0) { ++ die("SOURCE_DATE_EPOCH is too big or contains non-digits: \"%s\"", ++ source_date_epoch); ++ } ++ return (uint32_t)conversion; ++ } else if (gettimeofday(&now, NULL) != 0 || now.tv_sec == (time_t)-1 || now.tv_sec < 0) { + srand(getpid()); + /* rand() returns int from [0,RAND_MAX], therefore only 31 bits */ + return (((uint32_t)(rand() & 0xFFFF)) << 16) | ((uint32_t)(rand() & 0xFFFF)); +diff --git a/src/mkfs.fat.c b/src/mkfs.fat.c +index 37fc8ff..1948635 100644 +--- a/src/mkfs.fat.c ++++ b/src/mkfs.fat.c +@@ -1074,7 +1074,7 @@ static void setup_tables(void) + } + + /* If is not available then generate random 32 bit disk signature */ +- if (invariant) ++ if (invariant || getenv("SOURCE_DATE_EPOCH")) + disk_sig = volume_id; + else if (!disk_sig) + disk_sig = generate_volume_id(); +@@ -1287,7 +1287,7 @@ static void setup_tables(void) + de->name[0] = 0x05; + de->attr = ATTR_VOLUME; + if (create_time != (time_t)-1) { +- if (!invariant) ++ if (!invariant && !getenv("SOURCE_DATE_EPOCH")) + ctime = localtime(&create_time); + else + ctime = gmtime(&create_time); +@@ -1477,6 +1477,7 @@ int main(int argc, char **argv) + int blocks_specified = 0; + struct timeval create_timeval; + long long conversion; ++ char *source_date_epoch = NULL; + + enum {OPT_HELP=1000, OPT_INVARIANT, OPT_MBR, OPT_VARIANT, OPT_CODEPAGE, OPT_OFFSET}; + const struct option long_options[] = { +@@ -1497,8 +1498,20 @@ int main(int argc, char **argv) + program_name = p + 1; + } + +- if (gettimeofday(&create_timeval, NULL) == 0 && create_timeval.tv_sec != (time_t)-1) ++ source_date_epoch = getenv("SOURCE_DATE_EPOCH"); ++ if (source_date_epoch) { ++ errno = 0; ++ conversion = strtoll(source_date_epoch, &tmp, 10); ++ create_time = conversion; ++ if (!isdigit((unsigned char)*source_date_epoch) || *tmp != '\0' ++ || errno != 0 || (long long)create_time != conversion) { ++ die("SOURCE_DATE_EPOCH is too big or contains non-digits: \"%s\"", ++ source_date_epoch); ++ } ++ } else if (gettimeofday(&create_timeval, NULL) == 0 && create_timeval.tv_sec != (time_t)-1) { + create_time = create_timeval.tv_sec; ++ } ++ + volume_id = generate_volume_id(); + check_atari(); + \ No newline at end of file From d54e6e9dd5a60e998ee1c08d2e7d503edda8b98c Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 7 Aug 2022 19:56:41 +0200 Subject: [PATCH 06/28] tools: e2fsprogs: Update to version 1.46.5 Update to most recent version of e2fsprogs and sync with version from package folder. Signed-off-by: Hauke Mehrtens --- tools/e2fsprogs/Makefile | 4 ++-- tools/e2fsprogs/patches/001-exit_0_on_corrected_errors.patch | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/e2fsprogs/Makefile b/tools/e2fsprogs/Makefile index f8ca48222..004a04ea2 100644 --- a/tools/e2fsprogs/Makefile +++ b/tools/e2fsprogs/Makefile @@ -9,8 +9,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=e2fsprogs PKG_CPE_ID:=cpe:/a:e2fsprogs_project:e2fsprogs -PKG_VERSION:=1.46.4 -PKG_HASH:=b11042533c1b1dcf17512f0da48e05b0c573dada1dd8b762864d10f4dc399713 +PKG_VERSION:=1.46.5 +PKG_HASH:=2f16c9176704cf645dc69d5b15ff704ae722d665df38b2ed3cfc249757d8d81e PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz diff --git a/tools/e2fsprogs/patches/001-exit_0_on_corrected_errors.patch b/tools/e2fsprogs/patches/001-exit_0_on_corrected_errors.patch index 9b9b06d54..c94c60916 100644 --- a/tools/e2fsprogs/patches/001-exit_0_on_corrected_errors.patch +++ b/tools/e2fsprogs/patches/001-exit_0_on_corrected_errors.patch @@ -1,6 +1,6 @@ --- a/e2fsck/e2fsck.h +++ b/e2fsck/e2fsck.h -@@ -74,7 +74,7 @@ +@@ -81,7 +81,7 @@ * Exit codes used by fsck-type programs */ #define FSCK_OK 0 /* No errors */ From fb01bc0ba16475867704d5ab222ed9c429120d5a Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 6 Mar 2022 20:58:29 -0800 Subject: [PATCH 07/28] tools/expat: update to 2.4.7 Mostly a bug fix to the bug fix to CVE-2022-25236 Signed-off-by: Rosen Penev --- tools/expat/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/expat/Makefile b/tools/expat/Makefile index c79667af3..52d432726 100644 --- a/tools/expat/Makefile +++ b/tools/expat/Makefile @@ -9,10 +9,10 @@ include $(TOPDIR)/rules.mk PKG_NAME:=expat PKG_CPE_ID:=cpe:/a:libexpat:expat -PKG_VERSION:=2.4.6 +PKG_VERSION:=2.4.7 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_HASH:=ce317706b07cae150f90cddd4253f5b4fba929607488af5ac47bf2bc08e31f09 +PKG_HASH:=e149bdd8b90254c62b3d195da53a09bd531a4d63a963b0d8a5268d48dd2f6a65 PKG_SOURCE_URL:=https://github.com/libexpat/libexpat/releases/download/R_$(subst .,_,$(PKG_VERSION)) HOST_BUILD_PARALLEL:=1 From b807468841a63967c43f3f4648f5fede219d9abf Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Mon, 29 Aug 2022 07:48:53 +0200 Subject: [PATCH 08/28] tools/expat: update to 2.4.8 Release Notes: https://github.com/libexpat/libexpat/blob/R_2_4_8/expat/Changes Signed-off-by: Nick Hainke --- tools/expat/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/expat/Makefile b/tools/expat/Makefile index 52d432726..4018c7ca3 100644 --- a/tools/expat/Makefile +++ b/tools/expat/Makefile @@ -9,10 +9,10 @@ include $(TOPDIR)/rules.mk PKG_NAME:=expat PKG_CPE_ID:=cpe:/a:libexpat:expat -PKG_VERSION:=2.4.7 +PKG_VERSION:=2.4.8 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_HASH:=e149bdd8b90254c62b3d195da53a09bd531a4d63a963b0d8a5268d48dd2f6a65 +PKG_HASH:=a247a7f6bbb21cf2ca81ea4cbb916bfb9717ca523631675f99b3d4a5678dcd16 PKG_SOURCE_URL:=https://github.com/libexpat/libexpat/releases/download/R_$(subst .,_,$(PKG_VERSION)) HOST_BUILD_PARALLEL:=1 From 505b520fb8e715f4b99466e98c186850d9955956 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sat, 5 Mar 2022 15:58:55 +0100 Subject: [PATCH 09/28] tools/fakeroot: restore macos bugfix that was dropped during the last update Signed-off-by: Felix Fietkau --- tools/fakeroot/patches/600-macOS.patch | 43 ++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/tools/fakeroot/patches/600-macOS.patch b/tools/fakeroot/patches/600-macOS.patch index 59e668eb9..f9d6d189b 100644 --- a/tools/fakeroot/patches/600-macOS.patch +++ b/tools/fakeroot/patches/600-macOS.patch @@ -11,3 +11,46 @@ static struct sockaddr *get_addr(void) { static struct sockaddr_in addr = { 0, 0, { 0 } }; +--- a/libfakeroot_inode64.c ++++ b/libfakeroot_inode64.c +@@ -25,7 +25,7 @@ + #include "config.h" + #include "communicate.h" + +-#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 ++#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 && !__DARWIN_ONLY_64_BIT_INO_T + + #include + #include +--- a/wrapfunc.inp ++++ b/wrapfunc.inp +@@ -48,9 +48,11 @@ getattrlist$UNIX2003;int;(const char *pa + #endif + #endif + #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 ++#if !__DARWIN_ONLY_64_BIT_INO_T + lstat$INODE64;int;(const char *file_name, struct stat *buf);(file_name, buf) + stat$INODE64;int;(const char *file_name, struct stat *buf);(file_name, buf) + fstat$INODE64;int;(int fd, struct stat *buf);(fd, buf) ++#endif + posix_spawn;int;(pid_t * __restrict pid, const char * __restrict path, const posix_spawn_file_actions_t *file_actions, const posix_spawnattr_t * __restrict attrp, char *const argv[ __restrict], char *const envp[ __restrict]);(pid, path, file_actions, attrp, argv, envp) + posix_spawnp;int;(pid_t * __restrict pid, const char * __restrict path, const posix_spawn_file_actions_t *file_actions, const posix_spawnattr_t * __restrict attrp, char *const argv[ __restrict], char *const envp[ __restrict]);(pid, path, file_actions, attrp, argv, envp) + #endif +@@ -232,7 +234,7 @@ facl;int;(int fd, int cmd, int cnt, void + #ifdef HAVE_FTS_READ + fts_read;FTSENT *;(FTS *ftsp);(ftsp) + #ifdef __APPLE__ +-#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 ++#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 && !__DARWIN_ONLY_64_BIT_INO_T + fts_read$INODE64;FTSENT *;(FTS *ftsp);(ftsp) + #endif + #endif /* ifdef __APPLE__ */ +@@ -240,7 +242,7 @@ fts_read$INODE64;FTSENT *;(FTS *ftsp);(f + #ifdef HAVE_FTS_CHILDREN + fts_children;FTSENT *;(FTS *ftsp, int options);(ftsp, options) + #ifdef __APPLE__ +-#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 ++#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 && !__DARWIN_ONLY_64_BIT_INO_T + fts_children$INODE64;FTSENT *;(FTS *ftsp, int options);(ftsp, options) + #endif + #endif /* ifdef __APPLE__ */ From 226a0f1b6d451e56311dc27bd6366274157a2d99 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 6 Mar 2022 20:53:47 -0800 Subject: [PATCH 10/28] tools/fakeroot: update to 1.28 Refreshed patches. Upstream says there's only a bugfix for GNU Hurd. Signed-off-by: Rosen Penev --- tools/fakeroot/Makefile | 4 ++-- tools/fakeroot/patches/400-alpine-libc.musl-fix.patch | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/fakeroot/Makefile b/tools/fakeroot/Makefile index adae33209..c29f51e77 100644 --- a/tools/fakeroot/Makefile +++ b/tools/fakeroot/Makefile @@ -5,12 +5,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=fakeroot -PKG_VERSION:=1.27 +PKG_VERSION:=1.28 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz PKG_SOURCE_URL:=@DEBIAN/pool/main/f/fakeroot -PKG_HASH:=3c45eb2d1802a2762069e2e9d21bdd6fb533592bc0cda74c9aff066ab01caddc +PKG_HASH:=56d405e36ff685f83879be08fdd654255ab9aa38632b4605a98e896ad63990c2 PKG_LICENSE:=GPL-3.0-or-later PKG_LICENSE_FILES:=COPYING PKG_FIXUP:=autoreconf diff --git a/tools/fakeroot/patches/400-alpine-libc.musl-fix.patch b/tools/fakeroot/patches/400-alpine-libc.musl-fix.patch index 730732db2..530c96842 100644 --- a/tools/fakeroot/patches/400-alpine-libc.musl-fix.patch +++ b/tools/fakeroot/patches/400-alpine-libc.musl-fix.patch @@ -21,7 +21,7 @@ Error relocating openwrt/staging_dir/host/lib/libfakeroot.so: SEND_GET_XATTR: sy #define SEND_GET_XATTR64(a,b,c) send_get_xattr64(a,b) #endif -@@ -136,8 +138,9 @@ +@@ -140,8 +142,9 @@ /* 10.10 uses id_t in getpriority/setpriority calls, so pretend id_t is used everywhere, just happens to be int on some OSes */ From 3b1616b2e76440ca6cd0c83e65de098ee12175b7 Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Mon, 29 Aug 2022 07:55:14 +0200 Subject: [PATCH 11/28] tools/fakeroot: update to 1.29 Release Notes: https://salsa.debian.org/clint/fakeroot/-/commit/8dd9e34a2e54862a902040d76adbd1c1a42ffc35 Refresh patches: - 400-alpine-libc.musl-fix.patch - 600-macOS.patch Signed-off-by: Nick Hainke --- tools/fakeroot/Makefile | 4 ++-- tools/fakeroot/patches/400-alpine-libc.musl-fix.patch | 2 +- tools/fakeroot/patches/600-macOS.patch | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/fakeroot/Makefile b/tools/fakeroot/Makefile index c29f51e77..5d31e1978 100644 --- a/tools/fakeroot/Makefile +++ b/tools/fakeroot/Makefile @@ -5,12 +5,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=fakeroot -PKG_VERSION:=1.28 +PKG_VERSION:=1.29 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz PKG_SOURCE_URL:=@DEBIAN/pool/main/f/fakeroot -PKG_HASH:=56d405e36ff685f83879be08fdd654255ab9aa38632b4605a98e896ad63990c2 +PKG_HASH:=8fbbafb780c9173e3ace4a04afbc1d900f337f3216883939f5c7db3431be7c20 PKG_LICENSE:=GPL-3.0-or-later PKG_LICENSE_FILES:=COPYING PKG_FIXUP:=autoreconf diff --git a/tools/fakeroot/patches/400-alpine-libc.musl-fix.patch b/tools/fakeroot/patches/400-alpine-libc.musl-fix.patch index 530c96842..f740b120a 100644 --- a/tools/fakeroot/patches/400-alpine-libc.musl-fix.patch +++ b/tools/fakeroot/patches/400-alpine-libc.musl-fix.patch @@ -21,7 +21,7 @@ Error relocating openwrt/staging_dir/host/lib/libfakeroot.so: SEND_GET_XATTR: sy #define SEND_GET_XATTR64(a,b,c) send_get_xattr64(a,b) #endif -@@ -140,8 +142,9 @@ +@@ -142,8 +144,9 @@ /* 10.10 uses id_t in getpriority/setpriority calls, so pretend id_t is used everywhere, just happens to be int on some OSes */ diff --git a/tools/fakeroot/patches/600-macOS.patch b/tools/fakeroot/patches/600-macOS.patch index f9d6d189b..730367f07 100644 --- a/tools/fakeroot/patches/600-macOS.patch +++ b/tools/fakeroot/patches/600-macOS.patch @@ -36,7 +36,7 @@ posix_spawn;int;(pid_t * __restrict pid, const char * __restrict path, const posix_spawn_file_actions_t *file_actions, const posix_spawnattr_t * __restrict attrp, char *const argv[ __restrict], char *const envp[ __restrict]);(pid, path, file_actions, attrp, argv, envp) posix_spawnp;int;(pid_t * __restrict pid, const char * __restrict path, const posix_spawn_file_actions_t *file_actions, const posix_spawnattr_t * __restrict attrp, char *const argv[ __restrict], char *const envp[ __restrict]);(pid, path, file_actions, attrp, argv, envp) #endif -@@ -232,7 +234,7 @@ facl;int;(int fd, int cmd, int cnt, void +@@ -229,7 +231,7 @@ facl;int;(int fd, int cmd, int cnt, void #ifdef HAVE_FTS_READ fts_read;FTSENT *;(FTS *ftsp);(ftsp) #ifdef __APPLE__ @@ -45,7 +45,7 @@ fts_read$INODE64;FTSENT *;(FTS *ftsp);(ftsp) #endif #endif /* ifdef __APPLE__ */ -@@ -240,7 +242,7 @@ fts_read$INODE64;FTSENT *;(FTS *ftsp);(f +@@ -237,7 +239,7 @@ fts_read$INODE64;FTSENT *;(FTS *ftsp);(f #ifdef HAVE_FTS_CHILDREN fts_children;FTSENT *;(FTS *ftsp, int options);(ftsp, options) #ifdef __APPLE__ From e7830e93856c1a8ba04d3274c5189e8df9e246a0 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Mon, 12 Sep 2022 01:43:04 +0100 Subject: [PATCH 12/28] firmware-utils: update to git HEAD 0c92b20 iptime-crc32: add support for A6004MX Signed-off-by: Daniel Golle --- tools/firmware-utils/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile index ffb3c0978..731bc8a04 100644 --- a/tools/firmware-utils/Makefile +++ b/tools/firmware-utils/Makefile @@ -11,9 +11,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware-utils.git -PKG_SOURCE_DATE:=2022-07-28 -PKG_SOURCE_VERSION:=2483fe782e0d406b65eaa73b39fc27afabd8a9ea -PKG_MIRROR_HASH:=140b84b33cdae1520304cd6798604a51d2f4281b828808a5913d0b2d4b1f551f +PKG_SOURCE_DATE:=2022-09-12 +PKG_SOURCE_VERSION:=0c92b20ad488a4fb5fb290f6d1b893df45761275 +PKG_MIRROR_HASH:=2cfd36e749b51d539cffe22c77a4c3ccd3bac2eca482affe23e1cab539e8bd16 include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/cmake.mk From 2bd980e6f1a9a2306f2014f7eaeb4768e18838cb Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Wed, 16 Mar 2022 16:18:07 -0700 Subject: [PATCH 13/28] tools/meson: update to 0.61.4 Override python to use the one in host instead of hostpkg. There's no need to use the latter. Signed-off-by: Rosen Penev --- include/meson.mk | 4 ++++ tools/meson/Makefile | 4 ++-- tools/meson/files/openwrt-cross.txt.in | 1 + tools/meson/files/openwrt-native.txt.in | 1 + 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/meson.mk b/include/meson.mk index 01d0ce028..2d0624a30 100644 --- a/include/meson.mk +++ b/include/meson.mk @@ -65,6 +65,8 @@ define Meson/CreateNativeFile -e "s|@CC@|$(foreach BIN,$(HOSTCC),'$(BIN)',)|" \ -e "s|@CXX@|$(foreach BIN,$(HOSTCXX),'$(BIN)',)|" \ -e "s|@PKGCONFIG@|$(PKG_CONFIG)|" \ + -e "s|@CMAKE@|$(STAGING_DIR_HOST)/bin/cmake|" \ + -e "s|@PYTHON@|$(STAGING_DIR_HOST)/bin/python3|" \ -e "s|@CFLAGS@|$(foreach FLAG,$(HOST_CFLAGS) $(HOST_CPPFLAGS),'$(FLAG)',)|" \ -e "s|@CXXFLAGS@|$(foreach FLAG,$(HOST_CXXFLAGS) $(HOST_CPPFLAGS),'$(FLAG)',)|" \ -e "s|@LDFLAGS@|$(foreach FLAG,$(HOST_LDFLAGS),'$(FLAG)',)|" \ @@ -81,6 +83,8 @@ define Meson/CreateCrossFile -e "s|@STRIP@|$(TARGET_CROSS)strip|" \ -e "s|@NM@|$(TARGET_NM)|" \ -e "s|@PKGCONFIG@|$(PKG_CONFIG)|" \ + -e "s|@CMAKE@|$(STAGING_DIR_HOST)/bin/cmake|" \ + -e "s|@PYTHON@|$(STAGING_DIR_HOST)/bin/python3|" \ -e "s|@CFLAGS@|$(foreach FLAG,$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS),'$(FLAG)',)|" \ -e "s|@CXXFLAGS@|$(foreach FLAG,$(TARGET_CXXFLAGS) $(EXTRA_CXXFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS),'$(FLAG)',)|" \ -e "s|@LDFLAGS@|$(foreach FLAG,$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS),'$(FLAG)',)|" \ diff --git a/tools/meson/Makefile b/tools/meson/Makefile index 5ddb21a6e..2523fce07 100644 --- a/tools/meson/Makefile +++ b/tools/meson/Makefile @@ -1,11 +1,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=meson -PKG_VERSION:=0.61.2 +PKG_VERSION:=0.61.4 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/mesonbuild/meson/releases/download/$(PKG_VERSION) -PKG_HASH:=0233a7f8d959079318f6052b0939c27f68a5de86ba601f25c9ee6869fb5f5889 +PKG_HASH:=4e3733ddc66bac38e38c63b739c9b8b8fc5a866de5333396b0c85c2b144ddee9 PKG_MAINTAINER:=Andre Heider PKG_LICENSE:=Apache-2.0 diff --git a/tools/meson/files/openwrt-cross.txt.in b/tools/meson/files/openwrt-cross.txt.in index 56aa393d6..ec4b027f1 100644 --- a/tools/meson/files/openwrt-cross.txt.in +++ b/tools/meson/files/openwrt-cross.txt.in @@ -6,6 +6,7 @@ strip = '@STRIP@' nm = '@NM@' pkgconfig = '@PKGCONFIG@' cmake = '@CMAKE@' +python = '@PYTHON@' [built-in options] c_args = [@CFLAGS@] diff --git a/tools/meson/files/openwrt-native.txt.in b/tools/meson/files/openwrt-native.txt.in index eba63c00b..48e09ece2 100644 --- a/tools/meson/files/openwrt-native.txt.in +++ b/tools/meson/files/openwrt-native.txt.in @@ -3,6 +3,7 @@ c = [@CC@] cpp = [@CXX@] pkgconfig = '@PKGCONFIG@' cmake = '@CMAKE@' +python = '@PYTHON@' [built-in options] c_args = [@CFLAGS@] From b54f862f65b54469a5ce46b849868affca74bbca Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 20 Jun 2022 21:09:08 -0700 Subject: [PATCH 14/28] tools/meson: update to 0.61.5 Mostly backports by a Red Hat employee as 0.62 and newer demands Python 3.7+. Same reason 0.61 is kept here. Signed-off-by: Rosen Penev --- tools/meson/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/meson/Makefile b/tools/meson/Makefile index 2523fce07..34634620f 100644 --- a/tools/meson/Makefile +++ b/tools/meson/Makefile @@ -1,11 +1,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=meson -PKG_VERSION:=0.61.4 +PKG_VERSION:=0.61.5 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/mesonbuild/meson/releases/download/$(PKG_VERSION) -PKG_HASH:=4e3733ddc66bac38e38c63b739c9b8b8fc5a866de5333396b0c85c2b144ddee9 +PKG_HASH:=5e9a0d65c1a51936362b9686d1c5e9e184a6fd245d57e7269750ce50c20f5d9a PKG_MAINTAINER:=Andre Heider PKG_LICENSE:=Apache-2.0 From 0d9e6dbf2f471322f64c90bf501a3695e19d6501 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 24 Feb 2022 20:27:34 -0800 Subject: [PATCH 15/28] tools/mklibs: update to 0.1.45 Refresh 2to3 patch. Upstream partially did this against some older python version. This is still needed. Refreshed other patches to be python3 safe. Remove uClibc patches as only musl is present now. Refresh others. Signed-off-by: Rosen Penev --- tools/mklibs/Makefile | 4 +- .../patches/002-disable_symbol_checks.patch | 4 +- tools/mklibs/patches/003-no_copy.patch | 6 +- tools/mklibs/patches/005-duplicate_syms.patch | 2 +- tools/mklibs/patches/006-uclibc_init.patch | 14 -- tools/mklibs/patches/007-gc_sections.patch | 2 +- .../patches/008-uclibc_libgcc_link.patch | 2 +- .../009-uclibc_libpthread_symbols.patch | 63 ----- .../mklibs/patches/011-remove_multiarch.patch | 2 +- tools/mklibs/patches/100-apply-2to3.patch | 225 ++---------------- 10 files changed, 37 insertions(+), 287 deletions(-) delete mode 100644 tools/mklibs/patches/006-uclibc_init.patch delete mode 100644 tools/mklibs/patches/009-uclibc_libpthread_symbols.patch diff --git a/tools/mklibs/Makefile b/tools/mklibs/Makefile index 7c9ffffba..efa912bf6 100644 --- a/tools/mklibs/Makefile +++ b/tools/mklibs/Makefile @@ -7,11 +7,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mklibs -PKG_VERSION:=0.1.44 +PKG_VERSION:=0.1.45 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@DEBIAN/pool/main/m/mklibs/ -PKG_HASH:=3af0b6bd35e5b6fc58d8b68827fbae2ff6b7e20dd2b238ccb9b49d84722066c2 +PKG_HASH:=dd92a904b3942566f713fe536cd77dd1a5cfc62243c0e0bc6bb5d866e37422f3 HOST_FIXUP:=autoreconf diff --git a/tools/mklibs/patches/002-disable_symbol_checks.patch b/tools/mklibs/patches/002-disable_symbol_checks.patch index e18dfa8e5..96ca7a5f8 100644 --- a/tools/mklibs/patches/002-disable_symbol_checks.patch +++ b/tools/mklibs/patches/002-disable_symbol_checks.patch @@ -5,7 +5,7 @@ for name in unresolved: if not needed_symbols[name].weak: - raise Exception("Unresolvable symbol %s" % name) -+ print "WARNING: Unresolvable symbol %s" % name ++ print("WARNING: Unresolvable symbol %s" % name) break previous_pass_unresolved = unresolved @@ -14,7 +14,7 @@ if not name in symbol_provider: if not needed_symbols[name].weak: - raise Exception("No library provides non-weak %s" % name) -+ print "WARNING: Unresolvable symbol %s" % name ++ print("WARNING: Unresolvable symbol %s" % name) else: lib = symbol_provider[name] library_symbols_used[lib].add(library_symbols[lib][name]) diff --git a/tools/mklibs/patches/003-no_copy.patch b/tools/mklibs/patches/003-no_copy.patch index 75beccf82..bc1ae8d73 100644 --- a/tools/mklibs/patches/003-no_copy.patch +++ b/tools/mklibs/patches/003-no_copy.patch @@ -32,11 +32,11 @@ - dest_path + "/" + so_file_name + "-so", - dest_path + "/" + so_file_name + "-so-stripped") ## DEBUG - debug(DEBUG_VERBOSE, so_file, "\t", `os.stat(so_file)[ST_SIZE]`) + debug(DEBUG_VERBOSE, so_file, "\t", str(os.stat(so_file)[ST_SIZE])) debug(DEBUG_VERBOSE, dest_path + "/" + so_file_name + "-so", "\t", - `os.stat(dest_path + "/" + so_file_name + "-so")[ST_SIZE]`) + str(os.stat(dest_path + "/" + so_file_name + "-so")[ST_SIZE])) - debug(DEBUG_VERBOSE, dest_path + "/" + so_file_name + "-so-stripped", -- "\t", `os.stat(dest_path + "/" + so_file_name + "-so-stripped")[ST_SIZE]`) +- "\t", str(os.stat(dest_path + "/" + so_file_name + "-so-stripped")[ST_SIZE])) # Finalising libs and cleaning up -for lib in regexpfilter(os.listdir(dest_path), "(.*)-so-stripped$"): diff --git a/tools/mklibs/patches/005-duplicate_syms.patch b/tools/mklibs/patches/005-duplicate_syms.patch index b0fdab7b1..2627203fa 100644 --- a/tools/mklibs/patches/005-duplicate_syms.patch +++ b/tools/mklibs/patches/005-duplicate_syms.patch @@ -23,7 +23,7 @@ for name in needed_symbols: - if not name in symbol_provider: - if not needed_symbols[name].weak: -- print "WARNING: Unresolvable symbol %s" % name +- print("WARNING: Unresolvable symbol %s" % name) - else: - lib = symbol_provider[name] - library_symbols_used[lib].add(library_symbols[lib][name]) diff --git a/tools/mklibs/patches/006-uclibc_init.patch b/tools/mklibs/patches/006-uclibc_init.patch deleted file mode 100644 index da83340fe..000000000 --- a/tools/mklibs/patches/006-uclibc_init.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/src/mklibs -+++ b/src/mklibs -@@ -604,6 +604,11 @@ while 1: - extra_post_obj.append(sysroot + libc_extras_dir + "/sofini.o") - symbols.add(ProvidedSymbol('__dso_handle', None, None, True)) - -+ if soname in ("libc.so.0"): -+ symbols.add(ProvidedSymbol('__uClibc_init', None, None, True)) -+ symbols.add(ProvidedSymbol('__uClibc_fini', None, None, True)) -+ extra_flags.append("-Wl,-init,__uClibc_init") -+ - map_file = find_pic_map(library) - if map_file: - extra_flags.append("-Wl,--version-script=" + map_file) diff --git a/tools/mklibs/patches/007-gc_sections.patch b/tools/mklibs/patches/007-gc_sections.patch index 2fdf4034d..3d098ae42 100644 --- a/tools/mklibs/patches/007-gc_sections.patch +++ b/tools/mklibs/patches/007-gc_sections.patch @@ -1,6 +1,6 @@ --- a/src/mklibs +++ b/src/mklibs -@@ -616,7 +616,7 @@ while 1: +@@ -611,7 +611,7 @@ while 1: # compile in only used symbols cmd = [] cmd.extend(gcc_options) diff --git a/tools/mklibs/patches/008-uclibc_libgcc_link.patch b/tools/mklibs/patches/008-uclibc_libgcc_link.patch index 34cd9d3ab..a221278d2 100644 --- a/tools/mklibs/patches/008-uclibc_libgcc_link.patch +++ b/tools/mklibs/patches/008-uclibc_libgcc_link.patch @@ -22,7 +22,7 @@ symbols.update(library_symbols_used[library]) -@@ -623,9 +621,10 @@ while 1: +@@ -618,9 +616,10 @@ while 1: cmd.append(pic_file) cmd.extend(extra_post_obj) cmd.extend(extra_flags) diff --git a/tools/mklibs/patches/009-uclibc_libpthread_symbols.patch b/tools/mklibs/patches/009-uclibc_libpthread_symbols.patch deleted file mode 100644 index 0d4d3e95a..000000000 --- a/tools/mklibs/patches/009-uclibc_libpthread_symbols.patch +++ /dev/null @@ -1,63 +0,0 @@ ---- a/src/mklibs -+++ b/src/mklibs -@@ -173,9 +173,10 @@ def undefined_symbols(obj): - return result - - class ProvidedSymbol(Symbol): -- def __init__(self, name, version, library, default_version): -+ def __init__(self, name, version, library, default_version, weak): - super(ProvidedSymbol, self).__init__(name, version, library) - self.default_version = default_version -+ self.weak = weak - - def base_names(self): - ret = [] -@@ -216,11 +217,15 @@ def provided_symbols(obj): - if version_string.lower() not in ('base', 'none'): - version = version_string - -+ weak = False -+ if weak_string.lower() == 'true': -+ weak = True -+ - default_version = False - if default_version_string.lower() == 'true': - default_version = True - -- result.append(ProvidedSymbol(name, version, library, default_version)) -+ result.append(ProvidedSymbol(name, version, library, default_version, weak)) - - return result - -@@ -509,6 +514,9 @@ while 1: - debug(DEBUG_SPAM, "present_symbols adding %s" % symbol) - names = symbol.base_names() - for name in names: -+ if name in present_symbols: -+ if symbol.library != present_symbols[name].library: -+ needed_symbols[name] = UndefinedSymbol(name, True, symbol.version, symbol.library) - present_symbols[name] = symbol - - # are we finished? -@@ -600,12 +608,16 @@ while 1: - # may segfault in ptmalloc_init due to undefined weak reference - extra_pre_obj.append(sysroot + libc_extras_dir + "/soinit.o") - extra_post_obj.append(sysroot + libc_extras_dir + "/sofini.o") -- symbols.add(ProvidedSymbol('__dso_handle', None, None, True)) -+ symbols.add(ProvidedSymbol('__dso_handle', None, None, True, True)) - -- if soname in ("libc.so.0"): -- symbols.add(ProvidedSymbol('__uClibc_init', None, None, True)) -- symbols.add(ProvidedSymbol('__uClibc_fini', None, None, True)) -- extra_flags.append("-Wl,-init,__uClibc_init") -+ if soname == "libc.so.0": -+ symbols.add(ProvidedSymbol('__uClibc_init', None, None, True, True)) -+ symbols.add(ProvidedSymbol('__uClibc_fini', None, None, True, True)) -+ extra_pre_obj.append("-Wl,-init,__uClibc_init") -+ -+ if soname == "libpthread.so.0": -+ symbols.add(ProvidedSymbol('__pthread_initialize_minimal_internal', None, None, True, True)) -+ extra_flags.append("-Wl,-z,nodelete,-z,initfirst,-init=__pthread_initialize_minimal_internal") - - map_file = find_pic_map(library) - if map_file: diff --git a/tools/mklibs/patches/011-remove_multiarch.patch b/tools/mklibs/patches/011-remove_multiarch.patch index 23e45cc12..8c0bfdf1a 100644 --- a/tools/mklibs/patches/011-remove_multiarch.patch +++ b/tools/mklibs/patches/011-remove_multiarch.patch @@ -1,6 +1,6 @@ --- a/src/mklibs +++ b/src/mklibs -@@ -274,6 +274,7 @@ def extract_soname(so_file): +@@ -269,6 +269,7 @@ def extract_soname(so_file): return "" def multiarch(paths): diff --git a/tools/mklibs/patches/100-apply-2to3.patch b/tools/mklibs/patches/100-apply-2to3.patch index 9f2ae6c43..dcacbab20 100644 --- a/tools/mklibs/patches/100-apply-2to3.patch +++ b/tools/mklibs/patches/100-apply-2to3.patch @@ -1,10 +1,10 @@ --- a/src/mklibs +++ b/src/mklibs -@@ -57,18 +57,18 @@ debuglevel = DEBUG_NORMAL +@@ -57,17 +57,17 @@ debuglevel = DEBUG_NORMAL def debug(level, *msg): if debuglevel >= level: -- print string.join(msg) +- print(string.join(msg)) + print(' '.join(msg)) # return a list of lines of output of the command @@ -15,82 +15,22 @@ output = pipe.read().strip() status = pipe.close() if status is not None and os.WEXITSTATUS(status) != 0: -- print "Command failed with status", os.WEXITSTATUS(status), ":", \ -- command, string.join(args) -- print "With output:", output -+ print("Command failed with status", os.WEXITSTATUS(status), ":", \ + print("Command failed with status", os.WEXITSTATUS(status), ":", \ +- command, string.join(args)) + command, ' '.join(args)) -+ print("With output:", output) + print("With output:", output) sys.exit(1) return [i for i in output.split('\n') if i] - -@@ -204,7 +204,7 @@ class ProvidedSymbol(Symbol): - # Return a set of symbols provided by a library - def provided_symbols(obj): - if not os.access(obj, os.F_OK): -- raise Exception("Cannot find lib" + obj) -+ raise Exception("Cannot find lib " + obj) - library = extract_soname(obj) - - output = command("mklibs-readelf", "--print-symbols-provided", obj) -@@ -297,27 +297,27 @@ def usage(was_err): - outfd = sys.stderr - else: - outfd = sys.stdout -- print >> outfd, "Usage: mklibs [OPTION]... -d DEST FILE ..." -- print >> outfd, "Make a set of minimal libraries for FILE(s) in DEST." -- print >> outfd, "" -- print >> outfd, " -d, --dest-dir DIRECTORY create libraries in DIRECTORY" -- print >> outfd, " -D, --no-default-lib omit default libpath (", ':'.join(default_lib_path), ")" -- print >> outfd, " -L DIRECTORY[:DIRECTORY]... add DIRECTORY(s) to the library search path" -- print >> outfd, " -l LIBRARY add LIBRARY always" -- print >> outfd, " --ldlib LDLIB use LDLIB for the dynamic linker" -- print >> outfd, " --libc-extras-dir DIRECTORY look for libc extra files in DIRECTORY" -- print >> outfd, " --target TARGET prepend TARGET- to the gcc and binutils calls" -- print >> outfd, " --root ROOT search in ROOT for library rpaths" -- print >> outfd, " --sysroot ROOT prepend ROOT to all paths for libraries" -- print >> outfd, " --gcc-options OPTIONS pass OPTIONS to gcc" -- print >> outfd, " --libdir DIR use DIR (e.g. lib64) in place of lib in default paths" -- print >> outfd, " -v, --verbose explain what is being done" -- print >> outfd, " -h, --help display this help and exit" -+ print("Usage: mklibs [OPTION]... -d DEST FILE ...", file=outfd) -+ print("Make a set of minimal libraries for FILE(s) in DEST.", file=outfd) -+ print("", file=outfd) -+ print(" -d, --dest-dir DIRECTORY create libraries in DIRECTORY", file=outfd) +@@ -296,7 +296,7 @@ def usage(was_err): + print("Make a set of minimal libraries for FILE(s, file=outfd) in DEST.", file=outfd) + print("" , file=outfd) + print(" -d, --dest-dir DIRECTORY create libraries in DIRECTORY", file=outfd) +- print(" -D, --no-default-lib omit default libpath (", ':'.join(default_lib_path, file=outfd), ", file=outfd)", file=outfd) + print(" -D, --no-default-lib omit default libpath (", ':'.join(default_lib_path), ")", file=outfd) -+ print(" -L DIRECTORY[:DIRECTORY]... add DIRECTORY(s) to the library search path", file=outfd) -+ print(" -l LIBRARY add LIBRARY always", file=outfd) -+ print(" --ldlib LDLIB use LDLIB for the dynamic linker", file=outfd) -+ print(" --libc-extras-dir DIRECTORY look for libc extra files in DIRECTORY", file=outfd) -+ print(" --target TARGET prepend TARGET- to the gcc and binutils calls", file=outfd) -+ print(" --root ROOT search in ROOT for library rpaths", file=outfd) -+ print(" --sysroot ROOT prepend ROOT to all paths for libraries", file=outfd) -+ print(" --gcc-options OPTIONS pass OPTIONS to gcc", file=outfd) -+ print(" --libdir DIR use DIR (e.g. lib64) in place of lib in default paths", file=outfd) -+ print(" -v, --verbose explain what is being done", file=outfd) -+ print(" -h, --help display this help and exit", file=outfd) - sys.exit(was_err) - - def version(vers): -- print "mklibs: version ",vers -- print "" -+ print("mklibs: version ",vers) -+ print("") - - #################### main #################### - ## Usage: ./mklibs.py [OPTION]... -d DEST FILE ... -@@ -368,8 +368,8 @@ script_pattern = re.compile("^#!\s*/") - - try: - optlist, proglist = getopt.getopt(sys.argv[1:], opts, longopts) --except getopt.GetoptError, msg: -- print >> sys.stderr, msg -+except getopt.GetoptError as msg: -+ print(msg, file=sys.stderr) - usage(1) - - for opt, arg in optlist: -@@ -377,7 +377,7 @@ for opt, arg in optlist: + print(" -L DIRECTORY[:DIRECTORY]... add DIRECTORY(s, file=outfd) to the library search path", file=outfd) + print(" -l LIBRARY add LIBRARY always", file=outfd) + print(" --ldlib LDLIB use LDLIB for the dynamic linker", file=outfd) +@@ -372,7 +372,7 @@ for opt, arg in optlist: if debuglevel < DEBUG_SPAM: debuglevel = debuglevel + 1 elif opt == "-L": @@ -99,7 +39,7 @@ elif opt in ("-d", "--dest-dir"): dest_path = arg elif opt in ("-D", "--no-default-lib"): -@@ -396,17 +396,17 @@ for opt, arg in optlist: +@@ -391,7 +391,7 @@ for opt, arg in optlist: elif opt in ("-l",): force_libs.append(arg) elif opt == "--gcc-options": @@ -108,19 +48,7 @@ elif opt == "--libdir": libdir = arg elif opt in ("--help", "-h"): -- usage(0) -+ usage(0) - sys.exit(0) - elif opt in ("--version", "-V"): - version(vers) - sys.exit(0) - else: -- print "WARNING: unknown option: " + opt + "\targ: " + arg -+ print("WARNING: unknown option: " + opt + "\targ: " + arg) - - if include_default_lib_path == "yes": - lib_path.extend([a.replace("/lib/", "/" + libdir + "/") for a in default_lib_path]) -@@ -424,22 +424,22 @@ if ldlib == "LDLIB": +@@ -419,17 +419,17 @@ if ldlib == "LDLIB": objects = {} # map from inode to filename for prog in proglist: inode = os.stat(prog)[ST_INO] @@ -141,45 +69,20 @@ output = command("mklibs-readelf", "--print-interp", obj) if output: ldlib = output.pop() -- if ldlib: -- break -+ if ldlib: -+ break - - if not ldlib: - sys.exit("E: Dynamic linker not found, aborting.") -@@ -454,10 +454,10 @@ for obj in sorted(objects.values()): - for rpath_elem in rpath_val: - if not rpath_elem in lib_rpath: - if debuglevel >= DEBUG_VERBOSE: -- print "Adding rpath " + rpath_elem + " for " + obj -+ print("Adding rpath " + rpath_elem + " for " + obj) - lib_rpath.append(rpath_elem) - else: -- print "warning: " + obj + " may need rpath, but --root not specified" -+ print("warning: " + obj + " may need rpath, but --root not specified") - - lib_path.extend(lib_rpath) - -@@ -465,12 +465,12 @@ passnr = 1 - available_libs = [] - previous_pass_unresolved = set() +@@ -462,9 +462,9 @@ previous_pass_unresolved = set() while 1: -- debug(DEBUG_NORMAL, "I: library reduction pass", `passnr`) -+ debug(DEBUG_NORMAL, "I: library reduction pass", repr(passnr)) + debug(DEBUG_NORMAL, "I: library reduction pass", str(passnr)) if debuglevel >= DEBUG_VERBOSE: -- print "Objects:", +- print("Objects:",) - for obj in sorted([x[string.rfind(x, '/') + 1:] for x in objects.values()]): -- print obj, -- print +- print(obj,) + print("Objects:", end=' ') + for obj in sorted([x[x.rfind('/') + 1:] for x in list(objects.values())]): + print(obj, end=' ') -+ print() + print() passnr = passnr + 1 - # Gather all already reduced libraries and treat them as objects as well -@@ -479,7 +479,7 @@ while 1: +@@ -474,7 +474,7 @@ while 1: obj = dest_path + "/" + lib small_libs.append(obj) inode = os.stat(obj)[ST_INO] @@ -188,7 +91,7 @@ debug(DEBUG_SPAM, obj, "is hardlink to", objects[inode]) else: objects[inode] = obj -@@ -509,7 +509,7 @@ while 1: +@@ -504,7 +504,7 @@ while 1: present_symbols = {} checked_libs = small_libs checked_libs.extend(available_libs) @@ -197,70 +100,8 @@ for lib in checked_libs: for symbol in provided_symbols(lib): debug(DEBUG_SPAM, "present_symbols adding %s" % symbol) -@@ -529,8 +529,8 @@ while 1: - unresolved.add(name) - num_unresolved = num_unresolved + 1 - -- debug (DEBUG_NORMAL, `len(needed_symbols)`, "symbols,", -- `num_unresolved`, "unresolved") -+ debug (DEBUG_NORMAL, repr(len(needed_symbols)), "symbols,", -+ repr(num_unresolved), "unresolved") - - if num_unresolved == 0: - break -@@ -539,7 +539,7 @@ while 1: - # No progress in last pass. Verify all remaining symbols are weak. - for name in unresolved: - if not needed_symbols[name].weak: -- print "WARNING: Unresolvable symbol %s" % name -+ print("WARNING: Unresolvable symbol %s" % name) - break - - previous_pass_unresolved = unresolved -@@ -641,9 +641,9 @@ while 1: - command(target + "gcc", *cmd) - - ## DEBUG -- debug(DEBUG_VERBOSE, so_file, "\t", `os.stat(so_file)[ST_SIZE]`) -+ debug(DEBUG_VERBOSE, so_file, "\t", repr(os.stat(so_file)[ST_SIZE])) - debug(DEBUG_VERBOSE, dest_path + "/" + so_file_name + "-so", "\t", -- `os.stat(dest_path + "/" + so_file_name + "-so")[ST_SIZE]`) -+ repr(os.stat(dest_path + "/" + so_file_name + "-so")[ST_SIZE])) - - # Finalising libs and cleaning up - for lib in regexpfilter(os.listdir(dest_path), "(.*)-so$"): -@@ -680,4 +680,4 @@ if not os.access(dest_path + "/" + ld_fu - command(target + "objcopy", "--strip-unneeded -R .note -R .comment", - ld_file, dest_path + "/" + ld_full_path) - --os.chmod(dest_path + "/" + ld_full_path, 0755) -+os.chmod(dest_path + "/" + ld_full_path, 0o755) --- a/src/mklibs-copy +++ b/src/mklibs-copy -@@ -51,9 +51,9 @@ def command(command, *args): - output = pipe.read().strip() - status = pipe.close() - if status is not None and os.WEXITSTATUS(status) != 0: -- print "Command failed with status", os.WEXITSTATUS(status), ":", \ -- command, ' '.join(args) -- print "With output:", output -+ print("Command failed with status", os.WEXITSTATUS(status), ":", \ -+ command, ' '.join(args)) -+ print("With output:", output) - sys.exit(1) - return output.split('\n') - -@@ -134,8 +134,8 @@ def multiarch(paths): - return paths - - def version(vers): -- print "mklibs: version ",vers -- print "" -+ print("mklibs: version ",vers) -+ print("") - - # Clean the environment - vers="0.12" @@ -159,7 +159,7 @@ if include_default_lib_path: objects = {} # map from inode to filename for prog in proglist: @@ -270,23 +111,15 @@ logger.debug("%s is a hardlink to %s", prog, objects[inode]) elif so_pattern.match(prog): logger.debug("%s is a library", prog) -@@ -169,12 +169,12 @@ for prog in proglist: +@@ -169,7 +169,7 @@ for prog in proglist: logger.debug("%s is no ELF", prog) if not ldlib: - for obj in objects.values(): + for obj in list(objects.values()): output = command("mklibs-readelf", "-i", obj) -- for x in output: -+ for x in output: - ldlib = x -- if ldlib: -- break -+ if ldlib: -+ break - - if not ldlib: - sys.exit("E: Dynamic linker not found, aborting.") + for x in output: + ldlib = x @@ -182,7 +182,7 @@ if not ldlib: logger.info('Using %s as dynamic linker', ldlib) @@ -319,9 +152,3 @@ libraries.update(library_depends(obj)) if libraries == previous_pass_libraries: -@@ -272,4 +272,4 @@ if not os.access(dest_path + "/" + ld_fu - command(target + "objcopy", "--strip-unneeded -R .note -R .comment", - ld_file, dest_path + "/" + ld_full_path) - --os.chmod(dest_path + "/" + ld_full_path, 0755) -+os.chmod(dest_path + "/" + ld_full_path, 0o755) From 7253aa91673adb1b75c943e329bdce73bc74e631 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 7 Aug 2022 19:59:42 +0200 Subject: [PATCH 16/28] tools: mtd-utils: Update to version 2.1.4 Update to most recent version of mtd-utils and sync with version from package folder. Use a https download server instead of ftp. Signed-off-by: Hauke Mehrtens --- tools/mtd-utils/Makefile | 6 +++--- tools/mtd-utils/patches/110-portability.patch | 12 ++++++------ tools/mtd-utils/patches/130-lzma_jffs2.patch | 11 ++++++++--- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/tools/mtd-utils/Makefile b/tools/mtd-utils/Makefile index 7eebcfb82..e4b951acf 100644 --- a/tools/mtd-utils/Makefile +++ b/tools/mtd-utils/Makefile @@ -7,12 +7,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mtd-utils -PKG_VERSION:=2.1.2 +PKG_VERSION:=2.1.4 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_SOURCE_URL:=ftp://ftp.infradead.org/pub/mtd-utils/ -PKG_HASH:=8ad4c5f34716d40646aa28724a2f5616d325a6f119254f914e26976f1f76e9d6 +PKG_SOURCE_URL:=https://infraroot.at/pub/mtd/ +PKG_HASH:=2c6711d15d282c47cb3867b6857340597e26d332c238465134c602e5eef71b99 PKG_FIXUP:=autoreconf diff --git a/tools/mtd-utils/patches/110-portability.patch b/tools/mtd-utils/patches/110-portability.patch index 181e40653..73b97796a 100644 --- a/tools/mtd-utils/patches/110-portability.patch +++ b/tools/mtd-utils/patches/110-portability.patch @@ -70,7 +70,7 @@ #include --- a/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c +++ b/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c -@@ -1549,6 +1549,7 @@ static int add_inode(struct stat *st, in +@@ -1541,6 +1541,7 @@ static int add_inode(struct stat *st, in if (c->default_compr != UBIFS_COMPR_NONE) use_flags |= UBIFS_COMPR_FL; @@ -78,7 +78,7 @@ if (flags & FS_COMPR_FL) use_flags |= UBIFS_COMPR_FL; if (flags & FS_SYNC_FL) -@@ -1561,6 +1562,7 @@ static int add_inode(struct stat *st, in +@@ -1553,6 +1554,7 @@ static int add_inode(struct stat *st, in use_flags |= UBIFS_DIRSYNC_FL; if (fctx) use_flags |= UBIFS_CRYPT_FL; @@ -86,7 +86,7 @@ memset(ino, 0, UBIFS_INO_NODE_SZ); ino_key_init(&key, inum); -@@ -1646,7 +1648,9 @@ static int add_dir_inode(const char *pat +@@ -1638,7 +1640,9 @@ static int add_dir_inode(const char *pat fd = dirfd(dir); if (fd == -1) return sys_err_msg("dirfd failed"); @@ -96,7 +96,7 @@ flags = 0; } -@@ -1857,6 +1861,7 @@ static int add_file(const char *path_nam +@@ -1849,6 +1853,7 @@ static int add_file(const char *path_nam dn->ch.node_type = UBIFS_DATA_NODE; key_write(&key, &dn->key); out_len = NODE_BUFFER_SIZE - UBIFS_DATA_NODE_SZ; @@ -104,7 +104,7 @@ if (c->default_compr == UBIFS_COMPR_NONE && !c->encrypted && (flags & FS_COMPR_FL)) #ifdef WITHOUT_LZO -@@ -1865,6 +1870,7 @@ static int add_file(const char *path_nam +@@ -1857,6 +1862,7 @@ static int add_file(const char *path_nam use_compr = UBIFS_COMPR_LZO; #endif else @@ -112,7 +112,7 @@ use_compr = c->default_compr; compr_type = compress_data(buf, bytes_read, &dn->data, &out_len, use_compr); -@@ -1924,7 +1930,9 @@ static int add_non_dir(const char *path_ +@@ -1916,7 +1922,9 @@ static int add_non_dir(const char *path_ if (fd == -1) return sys_err_msg("failed to open file '%s'", path_name); diff --git a/tools/mtd-utils/patches/130-lzma_jffs2.patch b/tools/mtd-utils/patches/130-lzma_jffs2.patch index 9778aa6d0..55930ddc8 100644 --- a/tools/mtd-utils/patches/130-lzma_jffs2.patch +++ b/tools/mtd-utils/patches/130-lzma_jffs2.patch @@ -1,6 +1,6 @@ --- a/jffsX-utils/Makemodule.am +++ b/jffsX-utils/Makemodule.am -@@ -4,11 +4,19 @@ mkfs_jffs2_SOURCES = \ +@@ -4,7 +4,10 @@ mkfs_jffs2_SOURCES = \ jffsX-utils/compr_zlib.c \ jffsX-utils/compr.h \ jffsX-utils/rbtree.c \ @@ -10,7 +10,12 @@ + jffsX-utils/lzma/LzmaEnc.c \ + jffsX-utils/lzma/LzmaDec.c \ jffsX-utils/compr.c \ - jffsX-utils/compr_rtime.c + jffsX-utils/compr_rtime.c \ + jffsX-utils/compr.h \ +@@ -12,8 +15,13 @@ mkfs_jffs2_SOURCES = \ + jffsX-utils/summary.h \ + include/linux/jffs2.h \ + include/mtd/jffs2-user.h + +if !WITHOUT_LZO +mkfs_jffs2_SOURCES += jffsX-utils/compr_lzo.c @@ -20,7 +25,7 @@ -mkfs_jffs2_CPPFLAGS = $(AM_CPPFLAGS) $(ZLIB_CFLAGS) $(LZO_CFLAGS) +mkfs_jffs2_CPPFLAGS = $(AM_CPPFLAGS) $(ZLIB_CFLAGS) $(LZO_CFLAGS) -I./include/linux/lzma - jffs2reader_SOURCES = jffsX-utils/jffs2reader.c + jffs2reader_SOURCES = jffsX-utils/jffs2reader.c include/mtd/jffs2-user.h jffs2reader_LDADD = libmtd.a $(ZLIB_LIBS) $(LZO_LIBS) --- a/jffsX-utils/compr.c +++ b/jffsX-utils/compr.c From 99889b80ffd6c3ec346bde44fd330d75a4f3ecdd Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 18 Jun 2021 19:53:17 -0700 Subject: [PATCH 17/28] tools/pkgconf: update to 1.8.0 Switch to compiling with meson for faster and more reliable compilation. Signed-off-by: Rosen Penev --- tools/Makefile | 3 ++- tools/pkgconf/Makefile | 17 ++++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/tools/Makefile b/tools/Makefile index 3a4fb8ddc..242326e05 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -71,6 +71,7 @@ $(curdir)/mpfr/compile := $(curdir)/gmp/compile $(curdir)/mtd-utils/compile := $(curdir)/libtool/compile $(curdir)/e2fsprogs/compile $(curdir)/zlib/compile $(curdir)/padjffs2/compile := $(curdir)/findutils/compile $(curdir)/patchelf/compile := $(curdir)/libtool/compile +$(curdir)/pkgconf/compile := $(curdir)/meson/compile $(curdir)/quilt/compile := $(curdir)/autoconf/compile $(curdir)/findutils/compile $(curdir)/sdcc/compile := $(curdir)/bison/compile $(curdir)/squashfs/compile := $(curdir)/lzma-old/compile @@ -92,7 +93,7 @@ else endif ifneq ($(CONFIG_CCACHE)$(CONFIG_SDK),) -$(foreach tool, $(filter-out xz zstd patch pkgconf libressl ninja cmake,$(tools-y)), $(eval $(curdir)/$(tool)/compile += $(curdir)/ccache/compile)) +$(foreach tool, $(filter-out xz zstd pkgconf patch ninja meson libressl cmake,$(tools-y)), $(eval $(curdir)/$(tool)/compile += $(curdir)/ccache/compile)) tools-y += ccache $(curdir)/ccache/compile := $(curdir)/zstd/compile endif diff --git a/tools/pkgconf/Makefile b/tools/pkgconf/Makefile index 0f56de0e2..d2f3252b1 100644 --- a/tools/pkgconf/Makefile +++ b/tools/pkgconf/Makefile @@ -7,29 +7,32 @@ include $(TOPDIR)/rules.mk PKG_NAME:=pkgconf -PKG_VERSION:=1.7.3 +PKG_VERSION:=1.8.0 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://distfiles.dereferenced.org/pkgconf -PKG_HASH:=b846aea51cf696c3392a0ae58bef93e2e72f8e7073ca6ad1ed8b01c85871f9c0 - -HOST_BUILD_PARALLEL:=1 +PKG_HASH:=ef9c7e61822b7cb8356e6e9e1dca58d9556f3200d78acab35e4347e9d4c2bbaf include $(INCLUDE_DIR)/host-build.mk +include $(INCLUDE_DIR)/meson.mk unexport PKG_CONFIG HOSTCC := $(HOSTCC_NOCACHE) +MESON_HOST_ARGS += \ + -Ddefault_library=static \ + -Dtests=false + define Host/Install - $(MAKE) -C $(HOST_BUILD_DIR) install + $(call Host/Install/Meson) mv $(STAGING_DIR_HOST)/bin/pkgconf $(STAGING_DIR_HOST)/bin/pkg-config.real $(INSTALL_BIN) ./files/pkg-config $(STAGING_DIR_HOST)/bin/pkg-config endef define Host/Clean - -$(MAKE) -C $(HOST_BUILD_DIR) uninstall - $(call Host/Clean/Default) + rm -f $(STAGING_DIR_HOST)/bin/pkg-config.real $(STAGING_DIR_HOST)/bin/pkg-config + $(call Host/Clean/Meson) endef $(eval $(call HostBuild)) From 79e195e2384a640f1f001ab2b23137df3ea22d8e Mon Sep 17 00:00:00 2001 From: Andre Heider Date: Tue, 19 Oct 2021 11:08:46 +0200 Subject: [PATCH 18/28] tools/pkgconf: add PKG_CONFIG_EXTRAARGS for additional arguments This can be used my the OpenWrt build system to pass additional arguments when required. Signed-off-by: Andre Heider --- tools/pkgconf/files/pkg-config | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/pkgconf/files/pkg-config b/tools/pkgconf/files/pkg-config index 2c6fd08b4..91d144d9b 100755 --- a/tools/pkgconf/files/pkg-config +++ b/tools/pkgconf/files/pkg-config @@ -5,4 +5,5 @@ pkg-config.real \ --keep-system-libs \ --define-variable=prefix="${STAGING_PREFIX}" \ --define-variable=exec_prefix="${STAGING_PREFIX}" \ ---define-variable=bindir="${STAGING_PREFIX}/bin" "$@" +--define-variable=bindir="${STAGING_PREFIX}/bin" \ +$PKG_CONFIG_EXTRAARGS "$@" From f7ede33571e2e345a30dfd01844cc5e3030e587a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20M=C3=B6rlein?= Date: Tue, 9 Aug 2022 21:54:04 +0200 Subject: [PATCH 19/28] pkg-config: always use correct path for pkg-config.real MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this commit, it was assumed that pkg-config.real is in the PATH. While this was fine for the normal build workflow, this led to some issues if make TOPDIR="$(pwd)" -C "$pkgdir" compile was called manually. The command failed with Makefile:15: *** No libnl-tiny development libraries found!. Stop. make[1]: Leaving directory since pkg-config of the host system was used. After the commit, the package is built sucessfully. Signed-off-by: Leonardo Mörlein --- tools/pkgconf/files/pkg-config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/pkgconf/files/pkg-config b/tools/pkgconf/files/pkg-config index 91d144d9b..65e0fb09f 100755 --- a/tools/pkgconf/files/pkg-config +++ b/tools/pkgconf/files/pkg-config @@ -1,6 +1,6 @@ #!/bin/sh -pkg-config.real \ +${STAGING_DIR_HOST}/bin/pkg-config.real \ --keep-system-cflags \ --keep-system-libs \ --define-variable=prefix="${STAGING_PREFIX}" \ From 66d826b67308e1421d3fb9cb99eaffc155e83bdd Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Mon, 29 Aug 2022 07:18:32 +0200 Subject: [PATCH 20/28] tools/pkgconf: update to 1.9.3 Release Notes: https://github.com/pkgconf/pkgconf/blob/pkgconf-1.9.3/NEWS Signed-off-by: Nick Hainke --- tools/pkgconf/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/pkgconf/Makefile b/tools/pkgconf/Makefile index d2f3252b1..b5f241b7d 100644 --- a/tools/pkgconf/Makefile +++ b/tools/pkgconf/Makefile @@ -7,11 +7,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=pkgconf -PKG_VERSION:=1.8.0 +PKG_VERSION:=1.9.3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://distfiles.dereferenced.org/pkgconf -PKG_HASH:=ef9c7e61822b7cb8356e6e9e1dca58d9556f3200d78acab35e4347e9d4c2bbaf +PKG_HASH:=5fb355b487d54fb6d341e4f18d4e2f7e813a6622cf03a9e87affa6a40565699d include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/meson.mk From 93e000793ca588ff481bdbf4777d621e3ac41660 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 18 Sep 2021 00:57:24 -0700 Subject: [PATCH 21/28] tools/sstrip: update to 3.2 Signed-off-by: Rosen Penev --- tools/sstrip/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/sstrip/Makefile b/tools/sstrip/Makefile index b41c46d95..55a7fa744 100644 --- a/tools/sstrip/Makefile +++ b/tools/sstrip/Makefile @@ -7,12 +7,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=sstrip -PKG_VERSION:=3.1a +PKG_VERSION:=3.2 HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/ELFkickers-$(PKG_VERSION) PKG_SOURCE_URL:=https://www.muppetlabs.com/~breadbox/pub/software PKG_SOURCE:=ELFkickers-$(PKG_VERSION).tar.gz -PKG_HASH:=06430880aaf4919c5f99fc629da7000347421668c2cf32bced2d401aac276508 +PKG_HASH:=9b81e6c53e0c94fc198d9882eb737156f36d565152dc32118897c77b06a2687c PKG_RELEASE:=1 From 92c3861504d70721133a7d012167d121bcb01830 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Mon, 28 Mar 2022 08:43:41 +0200 Subject: [PATCH 22/28] tools/zlib: bump to latest stable release 1.2.12 (CVE-2018-25032) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List of changes since previous release from 2018 is quite long: * Fix crc32.c to compile local functions only if used. * Check for cc masquerading as gcc or clang in configure. * Remove destructive aspects of make distclean. * Separate out address sanitizing from warnings in configure. * Eliminate use of ULL constants. * Add fallthrough comments for gcc. * Clean up minizip to reduce warnings for testing. * Fix unztell64() in minizip to work past 4GB. (Daniël Hörchner) * minizip warning fix if MAXU32 already defined. (gvollant) * Replace black/white with allow/block. (theresa-m) * Fix indentation in minizip's zip.c. * Improve portability of contrib/minizip. * Correct typo in blast.c. * Change macro name in inflate.c to avoid collision in VxWorks. * Clarify gz* function interfaces, referring to parameter names. * Fix error in comment on the polynomial representation of a byte. * Fix memory leak on error in gzlog.c. * Avoid adding empty gzip member after gzflush with Z_FINISH. * Explicitly note that the 32-bit check values are 32 bits. * Use ARM crc32 instructions if the ARM architecture has them. * Add use of the ARMv8 crc32 instructions when requested. * Correct comment in crc32.c. * Don't bother computing check value after successful inflateSync(). * Use atomic test and set, if available, for dynamic CRC tables. * Speed up software CRC-32 computation by a factor of 1.5 to 3. * Add crc32_combine_gen() and crc32_combine_op() for fast combines. * Add tables for crc32_combine(), to speed it up by a factor of 200. * Fix the zran.c example to work on a multiple-member gzip file. * Add gznorm.c example, which normalizes gzip files. * Show all the codes for the maximum tables size in enough.c. * Clarify that prefix codes are counted in enough.c. * Use inline function instead of macro for index in enough.c. * Clean up code style in enough.c, update version. * Use a macro for the printf format of big_t in enough.c. * Use a structure to make globals in enough.c evident. * Assure that the number of bits for deflatePrime() is valid. * Fix a bug that can crash deflate on some input when using Z_FIXED. * Correct the initialization requirements for deflateInit2(). * Emphasize the need to continue decompressing gzip members. * Add legal disclaimer to README. * Fix deflateEnd() to not report an error at start of raw deflate. * Remove old assembler code in which bugs have manifested. * Make the names in functions declarations identical to definitions. * Avoid an undefined behavior of memcpy() in _tr_stored_block(). * Avoid undefined behaviors of memcpy() in gz*printf(). * Avoid an undefined behavior of memcpy() in gzappend(). * Avoid the use of ptrdiff_t. * Handle case where inflateSync used when header never processed. * Don't compute check value for raw inflate if asked to validate. * Add address checking in clang to -w option of configure. * Return an error if the gzputs string length can't fit in an int. * Small speedup to inflate [psumbera]. * Update use of errno for newer Windows CE versions. * Avoid some conversion warnings in gzread.c and gzwrite.c. * Have Makefile return non-zero error code on test failure. * Avoid a conversion error in gzseek when off_t type too small. * Fix CLEAR_HASH macro to be usable as a single statement. * Fix bug when window full in deflate_stored(). * Limit hash table inserts after switch from stored deflate. * Permit a deflateParams() parameter change as soon as possible. * Cygwin does not have _wopen(), so do not create gzopen_w() there. Removed 006-fix-compressor-crash-on-certain-inputs.patch which was hotfix for CVE-2018-25032 and is now included in this release. This release is not available on @SF (yet?) so the sources are now pulled from GitHub. Fixes: CVE-2018-25032 Signed-off-by: Petr Štetiar --- tools/zlib/Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/zlib/Makefile b/tools/zlib/Makefile index 279851f75..58315b808 100644 --- a/tools/zlib/Makefile +++ b/tools/zlib/Makefile @@ -8,12 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=zlib -PKG_VERSION:=1.2.11 +PKG_VERSION:=1.2.12 PKG_RELEASE:=1 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz -PKG_SOURCE_URL:=@SF/libpng http://www.zlib.net -PKG_HASH:=4ff941449631ace0d4d203e3483be9dbc9da454084111f97ea0a2114e19bf066 +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/madler/zlib +PKG_MIRROR_HASH:=a162fc219763635f0c1591ec515d4b08684e4b0bfb4b1c8e65e4eab18d597c27 +PKG_SOURCE_VERSION:=21767c654d31d2dccdde4330529775c6c5fd5389 PKG_LICENSE:=Zlib PKG_LICENSE_FILES:=README From 2e662a430de90cff0807133192e6dc8d4a861d06 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 30 Jan 2022 19:03:41 -0800 Subject: [PATCH 23/28] tools/zstd: update to 1.5.2 Signed-off-by: Rosen Penev --- tools/zstd/Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/zstd/Makefile b/tools/zstd/Makefile index a0106f15f..5bcb9bb29 100644 --- a/tools/zstd/Makefile +++ b/tools/zstd/Makefile @@ -1,18 +1,17 @@ include $(TOPDIR)/rules.mk PKG_NAME:=zstd -PKG_VERSION:=1.4.8 +PKG_VERSION:=1.5.2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/facebook/zstd/releases/download/v$(PKG_VERSION) -PKG_HASH:=32478297ca1500211008d596276f5367c54198495cf677e9439f4791a4c69f24 +PKG_HASH:=7c42d56fac126929a6a85dbc73ff1db2411d04f104fae9bdea51305663a83fd0 PKG_LICENSE:=BSD-3-Clause PKG_LICENSE_FILES:=LICENSE PKG_CPE_ID:=cpe:/a:facebook:zstandard CMAKE_SOURCE_SUBDIR:=build/cmake -HOST_BUILD_PARALLEL:=1 include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/cmake.mk From 05b84eea327f0d012342ab54a68ec1c68cd37c47 Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Mon, 29 Aug 2022 14:21:18 +0200 Subject: [PATCH 24/28] toolchain: gdb: update to 12.1 Release Notes: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob_plain;f=gdb/NEWS;hb=gdb-12.1-release Refreshed patch: - 120-fix-compile-flag-mismatch.patch Signed-off-by: Nick Hainke --- toolchain/gdb/Makefile | 4 ++-- toolchain/gdb/patches/120-fix-compile-flag-mismatch.patch | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/toolchain/gdb/Makefile b/toolchain/gdb/Makefile index 6ed3b190c..d69217f6c 100644 --- a/toolchain/gdb/Makefile +++ b/toolchain/gdb/Makefile @@ -7,12 +7,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gdb -PKG_VERSION:=11.2 +PKG_VERSION:=12.1 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/gdb -PKG_HASH:=1497c36a71881b8671a9a84a0ee40faab788ca30d7ba19d8463c3cc787152e32 +PKG_HASH:=0e1793bf8f2b54d53f46dea84ccfd446f48f81b297b28c4f7fc017b818d69fed GDB_DIR:=$(PKG_NAME)-$(PKG_VERSION) HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(GDB_DIR) diff --git a/toolchain/gdb/patches/120-fix-compile-flag-mismatch.patch b/toolchain/gdb/patches/120-fix-compile-flag-mismatch.patch index 99c91a030..118bebe3c 100644 --- a/toolchain/gdb/patches/120-fix-compile-flag-mismatch.patch +++ b/toolchain/gdb/patches/120-fix-compile-flag-mismatch.patch @@ -1,6 +1,6 @@ --- a/gdbserver/configure +++ b/gdbserver/configure -@@ -2661,7 +2661,7 @@ $as_echo "$as_me: error: \`$ac_var' was +@@ -2664,7 +2664,7 @@ $as_echo "$as_me: error: \`$ac_var' was ac_cache_corrupted=: ;; ,);; *) From 5cffb6d72e832b41a2ac32a22c9ada4bee6328f6 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 24 Sep 2022 22:00:40 -0700 Subject: [PATCH 25/28] toolchain/gdb: fix expat location GDB is not finding tools/expat. This fixes it. Move it up with the other tools. Signed-off-by: Rosen Penev --- toolchain/gdb/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchain/gdb/Makefile b/toolchain/gdb/Makefile index d69217f6c..4587c591f 100644 --- a/toolchain/gdb/Makefile +++ b/toolchain/gdb/Makefile @@ -33,12 +33,12 @@ HOST_CONFIGURE_ARGS = \ --with-gmp=$(TOPDIR)/staging_dir/host \ --with-mpfr=$(TOPDIR)/staging_dir/host \ --with-mpc=$(TOPDIR)/staging_dir/host \ + --with-expat=$(TOPDIR)/staging_dir/host \ --disable-werror \ --without-uiout \ --enable-tui --disable-gdbtk --without-x \ --without-included-gettext \ --enable-threads \ - --with-expat \ --disable-unit-tests \ --disable-ubsan \ --disable-binutils \ From 679d7fc869dd6bb96f17da3a7046fa343503e32b Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Sun, 28 Aug 2022 15:00:54 +0200 Subject: [PATCH 26/28] ccache: update to 4.6.3 Release Notes: https://ccache.dev/releasenotes.html#_ccache_4_6_3 Refresh patch: - 100-honour-copts.patch Signed-off-by: Nick Hainke --- tools/ccache/Makefile | 6 ++---- tools/ccache/patches/100-honour-copts.patch | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/tools/ccache/Makefile b/tools/ccache/Makefile index e31aa405d..0cf528bb5 100644 --- a/tools/ccache/Makefile +++ b/tools/ccache/Makefile @@ -8,13 +8,11 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/target.mk PKG_NAME:=ccache -PKG_VERSION:=4.6 +PKG_VERSION:=4.6.3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://github.com/ccache/ccache/releases/download/v$(PKG_VERSION) -PKG_HASH:=3d2bb860f4359169e640f60cf7cc11da5fab5fb9aed55230d78141e49c3945e9 - -HOST_BUILD_PARALLEL:=1 +PKG_HASH:=1e3a251bb112632553b8255a78661fe526c3a16598496d51128c32b218fd8b22 include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/cmake.mk diff --git a/tools/ccache/patches/100-honour-copts.patch b/tools/ccache/patches/100-honour-copts.patch index 55422985b..c8f2fc0fe 100644 --- a/tools/ccache/patches/100-honour-copts.patch +++ b/tools/ccache/patches/100-honour-copts.patch @@ -1,6 +1,6 @@ --- a/src/ccache.cpp +++ b/src/ccache.cpp -@@ -1633,6 +1633,7 @@ calculate_result_and_manifest_key(Contex +@@ -1756,6 +1756,7 @@ calculate_result_and_manifest_key(Contex "CPLUS_INCLUDE_PATH", "OBJC_INCLUDE_PATH", "OBJCPLUS_INCLUDE_PATH", // clang From 691daa9b19b76fbc517d61055b2655f6e668eeb2 Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Fri, 30 Sep 2022 08:27:44 +0200 Subject: [PATCH 27/28] tools/expat: update to 2.4.9 Fixes CVE-2022-40674. Release Notes: https://github.com/libexpat/libexpat/blob/R_2_4_9/expat/Changes Signed-off-by: Nick Hainke --- tools/expat/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/expat/Makefile b/tools/expat/Makefile index 4018c7ca3..7e544c6e2 100644 --- a/tools/expat/Makefile +++ b/tools/expat/Makefile @@ -9,10 +9,10 @@ include $(TOPDIR)/rules.mk PKG_NAME:=expat PKG_CPE_ID:=cpe:/a:libexpat:expat -PKG_VERSION:=2.4.8 +PKG_VERSION:=2.4.9 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_HASH:=a247a7f6bbb21cf2ca81ea4cbb916bfb9717ca523631675f99b3d4a5678dcd16 +PKG_HASH:=7f44d1469b110773a94b0d5abeeeffaef79f8bd6406b07e52394bcf48126437a PKG_SOURCE_URL:=https://github.com/libexpat/libexpat/releases/download/R_$(subst .,_,$(PKG_VERSION)) HOST_BUILD_PARALLEL:=1 From 5fcaadd8ce51e46a32577f7bda023930a5a217c8 Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Mon, 29 Aug 2022 08:03:08 +0200 Subject: [PATCH 28/28] tools/meson: update to 0.63.1 Release Notes: - 0.62.0 https://mesonbuild.com/Release-notes-for-0-62-0.html - 0.63.0 https://mesonbuild.com/Release-notes-for-0-63-0.html - (other notes are not available) Signed-off-by: Nick Hainke --- tools/meson/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/meson/Makefile b/tools/meson/Makefile index 34634620f..cf3f639a8 100644 --- a/tools/meson/Makefile +++ b/tools/meson/Makefile @@ -1,11 +1,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=meson -PKG_VERSION:=0.61.5 +PKG_VERSION:=0.63.1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/mesonbuild/meson/releases/download/$(PKG_VERSION) -PKG_HASH:=5e9a0d65c1a51936362b9686d1c5e9e184a6fd245d57e7269750ce50c20f5d9a +PKG_HASH:=06fe13297213d6ff0121c5d5aab25a56ef938ffec57414ed6086fda272cb65e9 PKG_MAINTAINER:=Andre Heider PKG_LICENSE:=Apache-2.0