From ecd9abc8c08288789af0b5ea245b29cf60a86519 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Sun, 14 May 2023 12:08:09 +0200 Subject: [PATCH 01/10] kernel: use upstream firmware patch for Broadcom's NVRAM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This replaces our 2 downstream patches. Signed-off-by: Rafał Miłecki --- ...xx_nvram-support-init-from-IO-memory.patch | 61 ----------- ...-provide-NVMEM-content-to-the-NVRAM-.patch | 31 ------ ...-bcm47xx-support-init-from-IO-memory.patch | 100 ++++++++++++++++++ 3 files changed, 100 insertions(+), 92 deletions(-) delete mode 100644 target/linux/bcm53xx/patches-5.15/800-0001-firmware-bcm47xx_nvram-support-init-from-IO-memory.patch delete mode 100644 target/linux/bcm53xx/patches-5.15/800-0002-nvmem-brcm_nvram-provide-NVMEM-content-to-the-NVRAM-.patch create mode 100644 target/linux/generic/backport-5.15/812-v6.2-firmware-nvram-bcm47xx-support-init-from-IO-memory.patch diff --git a/target/linux/bcm53xx/patches-5.15/800-0001-firmware-bcm47xx_nvram-support-init-from-IO-memory.patch b/target/linux/bcm53xx/patches-5.15/800-0001-firmware-bcm47xx_nvram-support-init-from-IO-memory.patch deleted file mode 100644 index 86792d6ebf..0000000000 --- a/target/linux/bcm53xx/patches-5.15/800-0001-firmware-bcm47xx_nvram-support-init-from-IO-memory.patch +++ /dev/null @@ -1,61 +0,0 @@ -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Date: Thu, 11 Mar 2021 08:24:44 +0100 -Subject: [PATCH] firmware: bcm47xx_nvram: support init from IO memory -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Signed-off-by: Rafał Miłecki ---- - drivers/firmware/broadcom/bcm47xx_nvram.c | 17 +++++++++++++++++ - include/linux/bcm47xx_nvram.h | 6 ++++++ - 2 files changed, 23 insertions(+) - ---- a/drivers/firmware/broadcom/bcm47xx_nvram.c -+++ b/drivers/firmware/broadcom/bcm47xx_nvram.c -@@ -110,6 +110,23 @@ found: - return 0; - } - -+int bcm47xx_nvram_init_from_iomem(void __iomem *nvram_start, size_t res_size) -+{ -+ if (nvram_len) { -+ pr_warn("nvram already initialized\n"); -+ return -EEXIST; -+ } -+ -+ if (!bcm47xx_nvram_is_valid(nvram_start)) { -+ pr_err("No valid NVRAM found\n"); -+ return -ENOENT; -+ } -+ -+ bcm47xx_nvram_copy(nvram_start, res_size); -+ -+ return 0; -+} -+ - /* - * On bcm47xx we need access to the NVRAM very early, so we can't use mtd - * subsystem to access flash. We can't even use platform device / driver to ---- a/include/linux/bcm47xx_nvram.h -+++ b/include/linux/bcm47xx_nvram.h -@@ -11,6 +11,7 @@ - #include - - #ifdef CONFIG_BCM47XX_NVRAM -+int bcm47xx_nvram_init_from_iomem(void __iomem *nvram_start, size_t res_size); - int bcm47xx_nvram_init_from_mem(u32 base, u32 lim); - int bcm47xx_nvram_getenv(const char *name, char *val, size_t val_len); - int bcm47xx_nvram_gpio_pin(const char *name); -@@ -20,6 +21,11 @@ static inline void bcm47xx_nvram_release - vfree(nvram); - }; - #else -+static inline int bcm47xx_nvram_init_from_iomem(void __iomem *nvram_start, -+ size_t res_size) -+{ -+ return -ENOTSUPP; -+} - static inline int bcm47xx_nvram_init_from_mem(u32 base, u32 lim) - { - return -ENOTSUPP; diff --git a/target/linux/bcm53xx/patches-5.15/800-0002-nvmem-brcm_nvram-provide-NVMEM-content-to-the-NVRAM-.patch b/target/linux/bcm53xx/patches-5.15/800-0002-nvmem-brcm_nvram-provide-NVMEM-content-to-the-NVRAM-.patch deleted file mode 100644 index 6648874bcf..0000000000 --- a/target/linux/bcm53xx/patches-5.15/800-0002-nvmem-brcm_nvram-provide-NVMEM-content-to-the-NVRAM-.patch +++ /dev/null @@ -1,31 +0,0 @@ -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Date: Thu, 11 Mar 2021 08:26:14 +0100 -Subject: [PATCH] nvmem: brcm_nvram: provide NVMEM content to the NVRAM driver -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Signed-off-by: Rafał Miłecki ---- - drivers/nvmem/brcm_nvram.c | 3 +++ - 1 file changed, 3 insertions(+) - ---- a/drivers/nvmem/brcm_nvram.c -+++ b/drivers/nvmem/brcm_nvram.c -@@ -3,6 +3,7 @@ - * Copyright (C) 2021 Rafał Miłecki - */ - -+#include - #include - #include - #include -@@ -139,6 +140,8 @@ static int brcm_nvram_probe(struct platf - if (err) - return err; - -+ bcm47xx_nvram_init_from_iomem(priv->base, resource_size(res)); -+ - config.dev = dev; - config.cells = priv->cells; - config.ncells = priv->ncells; diff --git a/target/linux/generic/backport-5.15/812-v6.2-firmware-nvram-bcm47xx-support-init-from-IO-memory.patch b/target/linux/generic/backport-5.15/812-v6.2-firmware-nvram-bcm47xx-support-init-from-IO-memory.patch new file mode 100644 index 0000000000..13ee2d4229 --- /dev/null +++ b/target/linux/generic/backport-5.15/812-v6.2-firmware-nvram-bcm47xx-support-init-from-IO-memory.patch @@ -0,0 +1,100 @@ +From a5be5ce0e25439fae3cd42e3d775979547926812 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Thu, 3 Nov 2022 09:25:29 +0100 +Subject: [PATCH] firmware/nvram: bcm47xx: support init from IO memory +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Provide NVMEM content to the NVRAM driver from a simple +memory resource. This is necessary to use NVRAM in a memory- +mapped flash device. Patch taken from OpenWrts development +tree. + +This patch makes it possible to use memory-mapped NVRAM +on the D-Link DWL-8610AP and the D-Link DIR-890L. + +Cc: Hauke Mehrtens +Cc: linux-mips@vger.kernel.org +Cc: Florian Fainelli +Cc: bcm-kernel-feedback-list@broadcom.com +Cc: Thomas Bogendoerfer +Signed-off-by: Rafał Miłecki +[Added an export for modules potentially using the init symbol] +Signed-off-by: Linus Walleij +Link: https://lore.kernel.org/r/20221103082529.359084-1-linus.walleij@linaro.org +Signed-off-by: Florian Fainelli +--- + drivers/firmware/broadcom/bcm47xx_nvram.c | 18 ++++++++++++++++++ + drivers/nvmem/brcm_nvram.c | 3 +++ + include/linux/bcm47xx_nvram.h | 6 ++++++ + 3 files changed, 27 insertions(+) + +--- a/drivers/firmware/broadcom/bcm47xx_nvram.c ++++ b/drivers/firmware/broadcom/bcm47xx_nvram.c +@@ -110,6 +110,24 @@ found: + return 0; + } + ++int bcm47xx_nvram_init_from_iomem(void __iomem *nvram_start, size_t res_size) ++{ ++ if (nvram_len) { ++ pr_warn("nvram already initialized\n"); ++ return -EEXIST; ++ } ++ ++ if (!bcm47xx_nvram_is_valid(nvram_start)) { ++ pr_err("No valid NVRAM found\n"); ++ return -ENOENT; ++ } ++ ++ bcm47xx_nvram_copy(nvram_start, res_size); ++ ++ return 0; ++} ++EXPORT_SYMBOL_GPL(bcm47xx_nvram_init_from_iomem); ++ + /* + * On bcm47xx we need access to the NVRAM very early, so we can't use mtd + * subsystem to access flash. We can't even use platform device / driver to +--- a/drivers/nvmem/brcm_nvram.c ++++ b/drivers/nvmem/brcm_nvram.c +@@ -3,6 +3,7 @@ + * Copyright (C) 2021 Rafał Miłecki + */ + ++#include + #include + #include + #include +@@ -139,6 +140,8 @@ static int brcm_nvram_probe(struct platf + if (err) + return err; + ++ bcm47xx_nvram_init_from_iomem(priv->base, resource_size(res)); ++ + config.dev = dev; + config.cells = priv->cells; + config.ncells = priv->ncells; +--- a/include/linux/bcm47xx_nvram.h ++++ b/include/linux/bcm47xx_nvram.h +@@ -11,6 +11,7 @@ + #include + + #ifdef CONFIG_BCM47XX_NVRAM ++int bcm47xx_nvram_init_from_iomem(void __iomem *nvram_start, size_t res_size); + int bcm47xx_nvram_init_from_mem(u32 base, u32 lim); + int bcm47xx_nvram_getenv(const char *name, char *val, size_t val_len); + int bcm47xx_nvram_gpio_pin(const char *name); +@@ -20,6 +21,11 @@ static inline void bcm47xx_nvram_release + vfree(nvram); + }; + #else ++static inline int bcm47xx_nvram_init_from_iomem(void __iomem *nvram_start, ++ size_t res_size) ++{ ++ return -ENOTSUPP; ++} + static inline int bcm47xx_nvram_init_from_mem(u32 base, u32 lim) + { + return -ENOTSUPP; From 4ab27bc6efeea79aacff117f3d374c03ea430c18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Sun, 14 May 2023 12:14:14 +0200 Subject: [PATCH 02/10] kernel: backport NVMEM patch for Broadcom's NVRAM MAC cells MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It has just been queued for the v6.5. It allows Ethernet drivers to read MACs from NVRAM using NVMEM interface. Signed-off-by: Rafał Miłecki --- ...vram-add-.read_post_process-for-MACs.patch | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 target/linux/generic/backport-5.15/813-v6.5-nvmem-brcm_nvram-add-.read_post_process-for-MACs.patch diff --git a/target/linux/generic/backport-5.15/813-v6.5-nvmem-brcm_nvram-add-.read_post_process-for-MACs.patch b/target/linux/generic/backport-5.15/813-v6.5-nvmem-brcm_nvram-add-.read_post_process-for-MACs.patch new file mode 100644 index 0000000000..8749cad7f7 --- /dev/null +++ b/target/linux/generic/backport-5.15/813-v6.5-nvmem-brcm_nvram-add-.read_post_process-for-MACs.patch @@ -0,0 +1,77 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Thu, 6 Apr 2023 12:46:16 +0200 +Subject: [PATCH] nvmem: brcm_nvram: add .read_post_process() for MACs +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +1. Parse ASCII MAC format into byte based +2. Calculate relative addresses based on index argument + +Signed-off-by: Rafał Miłecki +--- + drivers/nvmem/Kconfig | 1 + + drivers/nvmem/brcm_nvram.c | 28 ++++++++++++++++++++++++++++ + 2 files changed, 29 insertions(+) + +--- a/drivers/nvmem/Kconfig ++++ b/drivers/nvmem/Kconfig +@@ -55,6 +55,7 @@ config NVMEM_BRCM_NVRAM + tristate "Broadcom's NVRAM support" + depends on ARCH_BCM_5301X || COMPILE_TEST + depends on HAS_IOMEM ++ select GENERIC_NET_UTILS + help + This driver provides support for Broadcom's NVRAM that can be accessed + using I/O mapping. +--- a/drivers/nvmem/brcm_nvram.c ++++ b/drivers/nvmem/brcm_nvram.c +@@ -4,6 +4,8 @@ + */ + + #include ++#include ++#include + #include + #include + #include +@@ -42,6 +44,25 @@ static int brcm_nvram_read(void *context + return 0; + } + ++static int brcm_nvram_read_post_process_macaddr(void *context, const char *id, int index, ++ unsigned int offset, void *buf, size_t bytes) ++{ ++ u8 mac[ETH_ALEN]; ++ ++ if (bytes != 3 * ETH_ALEN - 1) ++ return -EINVAL; ++ ++ if (!mac_pton(buf, mac)) ++ return -EINVAL; ++ ++ if (index) ++ eth_addr_add(mac, index); ++ ++ ether_addr_copy(buf, mac); ++ ++ return 0; ++} ++ + static int brcm_nvram_add_cells(struct brcm_nvram *priv, uint8_t *data, + size_t len) + { +@@ -75,6 +96,13 @@ static int brcm_nvram_add_cells(struct b + priv->cells[idx].offset = value - (char *)data; + priv->cells[idx].bytes = strlen(value); + priv->cells[idx].np = of_get_child_by_name(dev->of_node, priv->cells[idx].name); ++ if (!strcmp(var, "et0macaddr") || ++ !strcmp(var, "et1macaddr") || ++ !strcmp(var, "et2macaddr")) { ++ priv->cells[idx].raw_len = strlen(value); ++ priv->cells[idx].bytes = ETH_ALEN; ++ priv->cells[idx].read_post_process = brcm_nvram_read_post_process_macaddr; ++ } + } + + return 0; From a24612cc0691c2f4780e25662a3c5f8a624420e0 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 14 May 2023 16:28:41 +0200 Subject: [PATCH 03/10] bcm47xx: Refresh patches Refresh patches to make them cleanly apply. This problem was found by the github CI. Fixes: ecd9abc8c082 ("kernel: use upstream firmware patch for Broadcom's NVRAM") Signed-off-by: Hauke Mehrtens --- target/linux/bcm47xx/patches-5.15/820-wgt634u-nvram-fix.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/bcm47xx/patches-5.15/820-wgt634u-nvram-fix.patch b/target/linux/bcm47xx/patches-5.15/820-wgt634u-nvram-fix.patch index bfcfae885f..82997ca65a 100644 --- a/target/linux/bcm47xx/patches-5.15/820-wgt634u-nvram-fix.patch +++ b/target/linux/bcm47xx/patches-5.15/820-wgt634u-nvram-fix.patch @@ -280,7 +280,7 @@ out the configuration than the in kernel cfe config reader. /* TODO: when nvram is on nand flash check for bad blocks first. */ /* Try every possible flash size and check for NVRAM at its end */ -@@ -172,6 +194,13 @@ int bcm47xx_nvram_getenv(const char *nam +@@ -190,6 +212,13 @@ int bcm47xx_nvram_getenv(const char *nam if (!name) return -EINVAL; From 7ad1fa12efd99dd2a4e4ffa01365280f63e99e55 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Sun, 14 May 2023 18:01:20 +0200 Subject: [PATCH 04/10] kernel: ltq-ptm: fix compilation warning for vr9 Fix compilation warning for unused variable for vr9. Fix compilation warning: /home/ansuel/openwrt-ansuel/openwrt/build_dir/target-mips-openwrt-linux-musl_musl/linux-lantiq_xrx200/ltq-ptm-vr9/ltq-ptm/ifxmips_ptm_vdsl.c: In function 'mailbox_irq_handler': /home/ansuel/openwrt-ansuel/openwrt/build_dir/target-mips-openwrt-linux-musl_musl/linux-lantiq_xrx200/ltq-ptm-vr9/ltq-ptm/ifxmips_ptm_vdsl.c:560:9: error: unused variable 'i' [-Werror=unused-variable] 560 | int i; | ^ cc1: all warnings being treated as errors Signed-off-by: Christian Marangi --- package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c | 1 - 1 file changed, 1 deletion(-) diff --git a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c index d751680853..1007e74cec 100644 --- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c +++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c @@ -557,7 +557,6 @@ static inline int get_tx_desc(unsigned int itf, unsigned int *f_full) static irqreturn_t mailbox_irq_handler(int irq, void *dev_id) { unsigned int isr; - int i; isr = IFX_REG_R32(MBOX_IGU1_ISR); IFX_REG_W32(isr, MBOX_IGU1_ISRC); From aae41e6e8f9e23cf10826501c1eae51c648981a6 Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Sun, 14 May 2023 14:16:02 +0200 Subject: [PATCH 05/10] strace: update to 6.3 Release Notes: https://github.com/strace/strace/releases/tag/v6.3 Signed-off-by: Nick Hainke --- package/devel/strace/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/devel/strace/Makefile b/package/devel/strace/Makefile index ce9122cc8a..9400608cdd 100644 --- a/package/devel/strace/Makefile +++ b/package/devel/strace/Makefile @@ -9,12 +9,12 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=strace -PKG_VERSION:=6.2 +PKG_VERSION:=6.3 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://strace.io/files/$(PKG_VERSION) -PKG_HASH:=0c7d38a449416268d3004029a220a15a77c2206a03cc88120f37f46e949177e8 +PKG_HASH:=e17878e301506c1cc301611118ad14efee7f8bcef63b27ace5d290acce7bb731 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=LGPL-2.1-or-later From 22ff416483c13ff312e199b0f7c31ffd3d733fc1 Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Mon, 15 May 2023 12:28:24 +0200 Subject: [PATCH 06/10] ethtool: update to 6.3 Release Notes: https://lore.kernel.org/netdev/20230508213111.z4vjg6gyrm7nwz4r@lion.mk-sys.cz/ Signed-off-by: Nick Hainke --- package/network/utils/ethtool/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/utils/ethtool/Makefile b/package/network/utils/ethtool/Makefile index b18320bf05..10fecd4a9c 100644 --- a/package/network/utils/ethtool/Makefile +++ b/package/network/utils/ethtool/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ethtool -PKG_VERSION:=6.2 +PKG_VERSION:=6.3 PKG_RELEASE:=1 PKG_MAINTAINER:=Felix Fietkau PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/software/network/ethtool -PKG_HASH:=86df0114064d4d73f6bf72bf03e85c33964a519ee0c1d1ba65005ad2d0e570e1 +PKG_HASH:=d9425f0a3df138734001fccc4175fe178c025f938460ac25c4ebc39960168822 PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=COPYING From d97143fadc65058754497d8757c0d63fc22b503a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibaut=20VAR=C3=88NE?= Date: Fri, 5 May 2023 14:54:03 +0200 Subject: [PATCH 07/10] ath79: mikrotik: bump compat version for yafut images MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Following 5264296, Mirotik NAND devices now use yafut to flash the kernel on devices. This method is incompatible with the old-style "kernel2minor" flash mechanism. Even though NAND images were disabled in default build since 21.02, a user flashing a new-style image onto an old-style image would result in in a soft-brick[1]. In order to prevent such accidental mishap, especially as these device images will be reenabled in the upcoming release, bump the compat version. After the new image is flashed, the compat version can be updated: uci set system.@system[0].compat_version='1.1' uci commit [1] https://github.com/openwrt/openwrt/pull/12225#issuecomment-1517529262 Cc: Michał Kępień Signed-off-by: Thibaut VARÈNE Reviewed-by: Robert Marko --- target/linux/ath79/image/common-mikrotik.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target/linux/ath79/image/common-mikrotik.mk b/target/linux/ath79/image/common-mikrotik.mk index ce349b60b1..b37c8b7197 100644 --- a/target/linux/ath79/image/common-mikrotik.mk +++ b/target/linux/ath79/image/common-mikrotik.mk @@ -18,4 +18,8 @@ endef define Device/mikrotik_nand $(Device/mikrotik) IMAGE/sysupgrade.bin = append-kernel | sysupgrade-tar | append-metadata + DEVICE_COMPAT_MESSAGE := \ + NAND images switched to yafut. If running older image, reinstall from initramfs. + DEVICE_COMPAT_VERSION := 1.1 + endef From d3c3b79c1e46c49cfa5de9df6a740d5fcda46471 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Fri, 12 May 2023 03:48:47 -0400 Subject: [PATCH 08/10] libunistring: add from packages feed Add libunistring in order to link to gettext and other packages directly instead of the built-in substitute for it. Signed-off-by: Michael Pratt --- package/libs/libunistring/Makefile | 64 ++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 package/libs/libunistring/Makefile diff --git a/package/libs/libunistring/Makefile b/package/libs/libunistring/Makefile new file mode 100644 index 0000000000..9b41cc3ce3 --- /dev/null +++ b/package/libs/libunistring/Makefile @@ -0,0 +1,64 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=libunistring +PKG_VERSION:=1.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=@GNU/$(PKG_NAME) +PKG_HASH:=827c1eb9cb6e7c738b171745dac0888aa58c5924df2e59239318383de0729b98 + +PKG_BUILD_PARALLEL:=1 +PKG_INSTALL:=1 + +PKG_LICENSE:=GPL-3.0 +PKG_LICENSE_FILES:=COPYING +PKG_CPE_ID:=cpe:/a:gnu:$(PKG_NAME) + +include $(INCLUDE_DIR)/host-build.mk +include $(INCLUDE_DIR)/package.mk + +define Package/libunistring + SECTION:=libs + CATEGORY:=Libraries + TITLE:=libunistring + URL:=https://www.gnu.org/software/libunistring +endef + +define Package/libunistring/description + This library provides functions for manipulating Unicode strings + and for manipulating C strings according to the Unicode standard. +endef + +HOST_CFLAGS += $(HOST_FPIC) + +TARGET_CFLAGS += $(FPIC) + +HOST_CONFIGURE_ARGS += \ + --enable-static \ + --disable-shared \ + --without-libiconv-prefix \ + --with-pic + +CONFIGURE_ARGS += \ + --enable-static \ + --enable-shared \ + --without-libiconv-prefix \ + --with-pic + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/include/unistring + $(CP) $(PKG_INSTALL_DIR)/usr/include/unistring/*.h $(1)/usr/include/unistring/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libunistring.{a,so*} $(1)/usr/lib/ +endef + +define Package/libunistring/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libunistring.so.* $(1)/usr/lib/ +endef + +$(eval $(call HostBuild)) +$(eval $(call BuildPackage,libunistring)) From 02884158771b0ec945c7cdfaf83d13841324d666 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Sat, 13 May 2023 18:55:44 -0400 Subject: [PATCH 09/10] gettext-full: add missing link to libunistring Running autoreconf or autogen.sh is causing the gettext-runtime subdirectory to have a configure script that looks for and attempts to link to an external libunistring. However, the macros and symbols for supporting that configuration are not present in this subdirectory yet. This results in some host machines to not build the included libunistring objects for libgrt, but at the same time, also not input the proper flag to the linker for linking to an external library when it is found or even when explicitly setting configuration to use a prefix for libunistring, resulting in the common linking failure "undefined reference". Some similar (and old...) upstream commits do the same thing, but only for gettext-tools and libgettextpo. Ref: ae943bcc1 ("Link with libunistring, if it exists.") # gettext.git Ref: 61e21a72f ("Avoid link error in programs that use libgettextpo.") # gettext.git Signed-off-by: Michael Pratt --- .../200-libunistring-missing-link.patch | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 package/libs/gettext-full/patches/200-libunistring-missing-link.patch diff --git a/package/libs/gettext-full/patches/200-libunistring-missing-link.patch b/package/libs/gettext-full/patches/200-libunistring-missing-link.patch new file mode 100644 index 0000000000..2e1dbf84e8 --- /dev/null +++ b/package/libs/gettext-full/patches/200-libunistring-missing-link.patch @@ -0,0 +1,21 @@ +--- a/autogen.sh ++++ b/autogen.sh +@@ -78,6 +78,7 @@ if ! $skip_gnulib; then + getopt-gnu + gettext-h + havelib ++ libunistring-optional + memmove + noreturn + progname +--- a/gettext-runtime/src/Makefile.am ++++ b/gettext-runtime/src/Makefile.am +@@ -40,7 +40,7 @@ envsubst_SOURCES = envsubst.c + + # Link dependencies. + # Need @LTLIBICONV@ because striconv.c uses iconv(). +-LDADD = ../gnulib-lib/libgrt.a @LTLIBINTL@ @LTLIBICONV@ $(WOE32_LDADD) ++LDADD = ../gnulib-lib/libgrt.a $(LTLIBUNISTRING) @LTLIBINTL@ @LTLIBICONV@ $(WOE32_LDADD) + + # Specify installation directory, for --enable-relocatable. + gettext_CFLAGS = -DINSTALLDIR=\"$(bindir)\" From 0779c47be6e6a12ba7a1dca7526f12a10b48b64f Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Sat, 13 May 2023 18:53:00 -0400 Subject: [PATCH 10/10] gettext-full: link to local libunistring Configure gettext to require and link to our local libunistring explicitly. Signed-off-by: Michael Pratt --- package/libs/gettext-full/Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/package/libs/gettext-full/Makefile b/package/libs/gettext-full/Makefile index c8700de550..1ed0e82df0 100644 --- a/package/libs/gettext-full/Makefile +++ b/package/libs/gettext-full/Makefile @@ -22,10 +22,10 @@ PKG_LICENSE:=GPL-3.0-or-later PKG_CPE_ID:=cpe:/a:gnu:gettext PKG_INSTALL:=1 -PKG_BUILD_DEPENDS:=gettext-full/host libxml2 +PKG_BUILD_DEPENDS:=gettext-full/host libunistring libxml2 PKG_BUILD_PARALLEL:=0 -HOST_BUILD_DEPENDS:=gperf/host libxml2/host +HOST_BUILD_DEPENDS:=gperf/host libunistring/host libxml2/host HOST_BUILD_PARALLEL:=0 PKG_SUBDIRS:= \ @@ -87,6 +87,7 @@ CONFIGURE_ARGS += \ --with-included-gettext \ --without-libintl-prefix \ --without-libexpat-prefix \ + --with-libunistring-prefix=$(STAGING_DIR)/usr \ --with-libxml2-prefix=$(STAGING_DIR) \ --without-emacs @@ -98,6 +99,7 @@ HOST_CONFIGURE_ARGS += \ --disable-java \ --disable-openmp \ --without-emacs \ + --with-libunistring-prefix=$(STAGING_DIR_HOSTPKG) \ --with-libxml2-prefix=$(STAGING_DIR_HOSTPKG) HOST_CONFIGURE_VARS += \