From 4a207705d7757fc4ce8fc2a70cde8a2a4c619cc9 Mon Sep 17 00:00:00 2001 From: throwaway96 <68320646+throwaway96@users.noreply.github.com> Date: Wed, 31 Jan 2024 18:42:30 -0500 Subject: [PATCH 1/5] Revert "nettle: bump to version 3.1.1" This reverts commit 8eaafb78ad7925e37c51b2aeb968973abd35b18d. Preparing to switch to older versions of gmp and gnutls. --- .../nettle/0001-fix-shared-only-build.patch | 75 +++++++++++++++++++ ... => 0002-disable-testsuite-examples.patch} | 0 package/nettle/nettle.hash | 6 +- package/nettle/nettle.mk | 18 +++-- 4 files changed, 88 insertions(+), 11 deletions(-) create mode 100644 package/nettle/0001-fix-shared-only-build.patch rename package/nettle/{0001-disable-testsuite-examples.patch => 0002-disable-testsuite-examples.patch} (100%) diff --git a/package/nettle/0001-fix-shared-only-build.patch b/package/nettle/0001-fix-shared-only-build.patch new file mode 100644 index 0000000000..3c9b186fb9 --- /dev/null +++ b/package/nettle/0001-fix-shared-only-build.patch @@ -0,0 +1,75 @@ +static/shared: use available libraries when linking our tools/examples/testsuite + +For a shared-only build, static libraries do not exist, so the build fails as +soon as we try to link either of our tools, examples or testsuite utils. + +Use whatever libraries are available, with a preference toward using shared +libraries. + +Signed-off-by: "Yann E. MORIN" + +diff -durN nettle-2.7.1.orig/config.make.in nettle-2.7.1/config.make.in +--- nettle-2.7.1.orig/config.make.in 2013-05-28 16:21:53.000000000 +0200 ++++ nettle-2.7.1/config.make.in 2014-12-12 19:56:07.031292752 +0100 +@@ -30,6 +30,8 @@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + + SHLIBCFLAGS = @SHLIBCFLAGS@ ++@IF_STATIC@LIBS_EXT = .a ++@IF_SHARED@LIBS_EXT = .so + + LIBNETTLE_MAJOR = @LIBNETTLE_MAJOR@ + LIBNETTLE_MINOR = @LIBNETTLE_MINOR@ +diff -durN nettle-2.7.1.orig/tools/Makefile.in nettle-2.7.1/tools/Makefile.in +--- nettle-2.7.1.orig/tools/Makefile.in 2013-05-28 16:21:54.000000000 +0200 ++++ nettle-2.7.1/tools/Makefile.in 2014-12-12 19:57:12.499805574 +0100 +@@ -34,19 +34,19 @@ + DISTFILES = $(SOURCES) Makefile.in input.h misc.h output.h parse.h + + sexp_conv_OBJS = $(sexp_conv_SOURCES:.c=.$(OBJEXT)) $(getopt_OBJS) +-sexp-conv$(EXEEXT): $(sexp_conv_OBJS) ../libnettle.a ++sexp-conv$(EXEEXT): $(sexp_conv_OBJS) ../libnettle$(LIBS_EXT) + $(LINK) $(sexp_conv_OBJS) -lnettle $(LIBS) -o $@ + +-nettle-lfib-stream$(EXEEXT): nettle-lfib-stream.$(OBJEXT) ../libnettle.a ++nettle-lfib-stream$(EXEEXT): nettle-lfib-stream.$(OBJEXT) ../libnettle$(LIBS_EXT) + $(LINK) nettle-lfib-stream.$(OBJEXT) -lnettle $(LIBS) -o $@ + + pkcs1_conv_OBJS = $(pkcs1_conv_SOURCES:.c=.$(OBJEXT)) $(getopt_OBJS) +-pkcs1-conv$(EXEEXT): $(pkcs1_conv_OBJS) ../libnettle.a ../libhogweed.a ++pkcs1-conv$(EXEEXT): $(pkcs1_conv_OBJS) ../libnettle$(LIBS_EXT) ../libhogweed$(LIBS_EXT) + $(LINK) $(pkcs1_conv_OBJS) -lhogweed -lnettle $(LIBS) -o $@ + + # FIXME: Avoid linking with gmp + nettle_hash_OBJS = $(nettle_hash_SOURCES:.c=.$(OBJEXT)) $(getopt_OBJS) +-nettle-hash$(EXEEXT): $(nettle_hash_OBJS) ../libnettle.a ++nettle-hash$(EXEEXT): $(nettle_hash_OBJS) ../libnettle$(LIBS_EXT) + $(LINK) $(nettle_hash_OBJS) -lnettle $(LIBS) -o $@ + + +diff -durN nettle-2.7.1.orig/examples/Makefile.in nettle-2.7.1/examples/Makefile.in +--- nettle-2.7.1.orig/examples/Makefile.in 2013-05-28 16:21:54.000000000 +0200 ++++ nettle-2.7.1/examples/Makefile.in 2014-12-12 21:54:48.286251022 +0100 +@@ -117,8 +117,8 @@ + -lhogweed -lnettle $(BENCH_LIBS) $(LIBS) $(OPENSSL_LIBFLAGS) \ + -o hogweed-benchmark$(EXEEXT) + +-$(TARGETS) : io.$(OBJEXT) ../libnettle.a +-$(HOGWEED_TARGETS): ../libhogweed.a ++$(TARGETS) : io.$(OBJEXT) ../libnettle$(LIBS_EXT) ++$(HOGWEED_TARGETS): ../libhogweed$(LIBS_EXT) + + check: $(TS_ALL) + LD_LIBRARY_PATH=../.lib PATH="../.lib:$$PATH" srcdir="$(srcdir)" \ +diff -durN nettle-2.7.1.orig/testsuite/Makefile.in nettle-2.7.1/testsuite/Makefile.in +--- nettle-2.7.1.orig/testsuite/Makefile.in 2013-05-28 16:21:54.000000000 +0200 ++++ nettle-2.7.1/testsuite/Makefile.in 2014-12-12 21:55:30.414814549 +0100 +@@ -96,7 +96,7 @@ + include $(srcdir)/.test-rules.make + + $(TARGETS) $(EXTRA_TARGETS): testutils.$(OBJEXT) ../nettle-internal.$(OBJEXT) \ +- ../libnettle.a @IF_HOGWEED@ ../libhogweed.a ++ ../libnettle$(LIBS_EXT) @IF_HOGWEED@ ../libhogweed$(LIBS_EXT) + + # For use as, e.g., + # diff --git a/package/nettle/0001-disable-testsuite-examples.patch b/package/nettle/0002-disable-testsuite-examples.patch similarity index 100% rename from package/nettle/0001-disable-testsuite-examples.patch rename to package/nettle/0002-disable-testsuite-examples.patch diff --git a/package/nettle/nettle.hash b/package/nettle/nettle.hash index d726cb94c6..34c38627b6 100644 --- a/package/nettle/nettle.hash +++ b/package/nettle/nettle.hash @@ -1,6 +1,2 @@ # Locally calculated after checking pgp signature -# https://ftp.gnu.org/gnu/nettle/nettle-3.8.1.tar.gz.sig -sha256 364f3e2b77cd7dcde83fd7c45219c834e54b0c75e428b6f894a23d12dd41cbfe nettle-3.8.1.tar.gz -# Locally calculated -sha256 a853c2ffec17057872340eee242ae4d96cbf2b520ae27d903e1b2fef1a5f9d1c COPYING.LESSERv3 -sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 COPYINGv2 +sha256 bc71ebd43435537d767799e414fce88e521b7278d48c860651216e1fc6555b40 nettle-2.7.1.tar.gz diff --git a/package/nettle/nettle.mk b/package/nettle/nettle.mk index dd4dfbbe38..cf9bfe29ab 100644 --- a/package/nettle/nettle.mk +++ b/package/nettle/nettle.mk @@ -4,13 +4,12 @@ # ################################################################################ -NETTLE_VERSION = 3.8.1 -NETTLE_SITE = https://ftp.gnu.org/gnu/nettle +NETTLE_VERSION = 2.7.1 +NETTLE_SITE = http://www.lysator.liu.se/~nisse/archive NETTLE_DEPENDENCIES = gmp NETTLE_INSTALL_STAGING = YES -NETTLE_LICENSE = Dual GPL-2.0+/LGPL-3.0+ -NETTLE_LICENSE_FILES = COPYING.LESSERv3 COPYINGv2 -NETTLE_CPE_ID_VENDOR = nettle_project +NETTLE_LICENSE = LGPLv2.1+ +NETTLE_LICENSE_FILES = COPYING.LIB # don't include openssl support for (unused) examples as it has problems # with static linking NETTLE_CONF_OPTS = --disable-openssl @@ -20,11 +19,18 @@ ifeq ($(BR2_ARM_CPU_ARMV4)$(BR2_ARM_CPU_ARMV5)$(BR2_ARM_CPU_ARMV7M),y) NETTLE_CONF_OPTS += --disable-assembler endif -ifeq ($(BR2_ARM_CPU_HAS_NEON),y) +# ARM NEON, requires binutils 2.21+ +ifeq ($(BR2_ARM_CPU_HAS_NEON)$(BR2_TOOLCHAIN_BUILDROOT)$(BR2_BINUTILS_VERSION_2_20_1),yy) NETTLE_CONF_OPTS += --enable-arm-neon else NETTLE_CONF_OPTS += --disable-arm-neon endif +define NETTLE_DITCH_DEBUGGING_CFLAGS + $(SED) '/CFLAGS/ s/ -ggdb3//' $(@D)/configure +endef + +NETTLE_POST_EXTRACT_HOOKS += NETTLE_DITCH_DEBUGGING_CFLAGS + $(eval $(autotools-package)) $(eval $(host-autotools-package)) From d3ec8b09570346e0699320ddc6f1cbd6fe3a9212 Mon Sep 17 00:00:00 2001 From: throwaway96 <68320646+throwaway96@users.noreply.github.com> Date: Sat, 4 May 2024 14:40:33 -0400 Subject: [PATCH 2/5] update nettle source URL --- package/nettle/nettle.hash | 5 ++++- package/nettle/nettle.mk | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/package/nettle/nettle.hash b/package/nettle/nettle.hash index 34c38627b6..badba42731 100644 --- a/package/nettle/nettle.hash +++ b/package/nettle/nettle.hash @@ -1,2 +1,5 @@ # Locally calculated after checking pgp signature -sha256 bc71ebd43435537d767799e414fce88e521b7278d48c860651216e1fc6555b40 nettle-2.7.1.tar.gz +# https://ftp.gnu.org/gnu/nettle/nettle-2.7.1.tar.gz +sha256 bc71ebd43435537d767799e414fce88e521b7278d48c860651216e1fc6555b40 nettle-2.7.1.tar.gz +# Locally calculated +sha256 a9bdde5616ecdd1e980b44f360600ee8783b1f99b8cc83a2beb163a0a390e861 COPYING.LIB diff --git a/package/nettle/nettle.mk b/package/nettle/nettle.mk index cf9bfe29ab..da349e28de 100644 --- a/package/nettle/nettle.mk +++ b/package/nettle/nettle.mk @@ -5,7 +5,7 @@ ################################################################################ NETTLE_VERSION = 2.7.1 -NETTLE_SITE = http://www.lysator.liu.se/~nisse/archive +NETTLE_SITE = https://ftp.gnu.org/gnu/nettle NETTLE_DEPENDENCIES = gmp NETTLE_INSTALL_STAGING = YES NETTLE_LICENSE = LGPLv2.1+ From b65498c8e5b4a3965c353f482b20c37b7ebc43c4 Mon Sep 17 00:00:00 2001 From: throwaway96 <68320646+throwaway96@users.noreply.github.com> Date: Sun, 4 Feb 2024 20:54:40 -0500 Subject: [PATCH 3/5] add BR2_WEBOS_COMPAT option --- package/webos/Config.in | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/package/webos/Config.in b/package/webos/Config.in index e7399dc62c..02690edc02 100644 --- a/package/webos/Config.in +++ b/package/webos/Config.in @@ -5,3 +5,10 @@ config BR2_PACKAGE_WEBOS depends on BR2_PACKAGE_LGTV help WebOS meta-package + +config BR2_WEBOS_COMPAT + bool "webOS compat" + depends on BR2_PACKAGE_WEBOS + help + Use old versions of certain packages on the target in an + attempt to be more compatible with webOS. From 867209a1b6a1b17f096b7abc87de48c153076061 Mon Sep 17 00:00:00 2001 From: throwaway96 <68320646+throwaway96@users.noreply.github.com> Date: Wed, 31 Jan 2024 14:43:06 -0500 Subject: [PATCH 4/5] add webos-gmp: gmp 4.2.1 for target only --- package/Config.in | 1 + package/coreutils/coreutils.mk | 4 +- package/dnsmasq/dnsmasq.mk | 2 +- package/gdb/gdb.mk | 2 +- package/gmp/gmp.mk | 4 ++ package/gnuradio/gnuradio.mk | 2 +- package/guile/guile.mk | 2 +- package/libbytesize/libbytesize.mk | 2 +- package/libpbnjson/libpbnjson.mk | 2 +- package/minetest/minetest.mk | 2 +- package/mpc/mpc.mk | 2 +- package/mpfr/mpfr.mk | 2 +- package/mpir/mpir.mk | 2 +- package/nettle/nettle.mk | 2 +- package/nftables/nftables.mk | 2 +- package/openldap/openldap.mk | 2 +- package/openswan/openswan.mk | 2 +- package/php/php.mk | 2 +- package/ruby/ruby.mk | 2 +- package/webos-gmp/0001-disable-stdc.patch | 33 +++++++++++++ .../0002-gmp_fix_for_automake-1.12.patch | 48 +++++++++++++++++++ .../0003-gmp-fix-ansi-c99-webos.patch | 27 +++++++++++ package/webos-gmp/Config.in | 10 ++++ package/webos-gmp/webos-gmp.hash | 6 +++ package/webos-gmp/webos-gmp.mk | 25 ++++++++++ 25 files changed, 172 insertions(+), 18 deletions(-) create mode 100644 package/webos-gmp/0001-disable-stdc.patch create mode 100644 package/webos-gmp/0002-gmp_fix_for_automake-1.12.patch create mode 100644 package/webos-gmp/0003-gmp-fix-ansi-c99-webos.patch create mode 100644 package/webos-gmp/Config.in create mode 100644 package/webos-gmp/webos-gmp.hash create mode 100644 package/webos-gmp/webos-gmp.mk diff --git a/package/Config.in b/package/Config.in index 9803c4bb3b..ddc9669d1d 100644 --- a/package/Config.in +++ b/package/Config.in @@ -2704,6 +2704,7 @@ menu "WebOS" source "package/pmloglib/Config.in" source "package/umediaserver/Config.in" source "package/webos/Config.in" + source "package/webos-gmp/Config.in" source "package/webos-userland/Config.in" source "package/webos-wayland-extensions/Config.in" endmenu diff --git a/package/coreutils/coreutils.mk b/package/coreutils/coreutils.mk index 931859b0ac..cb50016c3b 100644 --- a/package/coreutils/coreutils.mk +++ b/package/coreutils/coreutils.mk @@ -81,8 +81,8 @@ ifeq ($(BR2_PACKAGE_GETTEXT_PROVIDES_LIBINTL),y) COREUTILS_CONF_OPTS += --with-libintl-prefix=$(STAGING_DIR)/usr endif -ifeq ($(BR2_PACKAGE_GMP),y) -COREUTILS_DEPENDENCIES += gmp +ifneq ($(BR2_PACKAGE_GMP)$(BR2_PACKAGE_WEBOS_GMP),) +COREUTILS_DEPENDENCIES += $(if $(BR2_PACKAGE_WEBOS_GMP),webos-gmp,gmp) else COREUTILS_CONF_OPTS += --without-gmp endif diff --git a/package/dnsmasq/dnsmasq.mk b/package/dnsmasq/dnsmasq.mk index 46a40c4bbb..120a48bf20 100644 --- a/package/dnsmasq/dnsmasq.mk +++ b/package/dnsmasq/dnsmasq.mk @@ -24,7 +24,7 @@ DNSMASQ_COPTS += -DNO_DHCP endif ifeq ($(BR2_PACKAGE_DNSMASQ_DNSSEC),y) -DNSMASQ_DEPENDENCIES += gmp nettle +DNSMASQ_DEPENDENCIES += $(if $(BR2_PACKAGE_WEBOS_GMP),webos-gmp,gmp) nettle DNSMASQ_COPTS += -DHAVE_DNSSEC endif diff --git a/package/gdb/gdb.mk b/package/gdb/gdb.mk index 2761d49e7a..49b5bd702e 100644 --- a/package/gdb/gdb.mk +++ b/package/gdb/gdb.mk @@ -154,7 +154,7 @@ endif ifeq ($(BR2_GDB_VERSION_10)$(BR2_arc):$(BR2_PACKAGE_GDB_DEBUGGER),:y) GDB_CONF_OPTS += \ --with-libgmp-prefix=$(STAGING_DIR)/usr -GDB_DEPENDENCIES += gmp +GDB_DEPENDENCIES += $(if $(BR2_PACKAGE_WEBOS_GMP),webos-gmp,gmp) endif ifeq ($(BR2_PACKAGE_GDB_SERVER),y) diff --git a/package/gmp/gmp.mk b/package/gmp/gmp.mk index 9b402767fd..76d56a660c 100644 --- a/package/gmp/gmp.mk +++ b/package/gmp/gmp.mk @@ -29,5 +29,9 @@ else GMP_CONF_OPTS += --disable-cxx endif +# Don't build for target if using webOS GMP instead +#ifneq ($(BR2_PACKAGE_WEBOS_GMP),y) $(eval $(autotools-package)) +#endif + $(eval $(host-autotools-package)) diff --git a/package/gnuradio/gnuradio.mk b/package/gnuradio/gnuradio.mk index e36dce081c..4aabcc4d77 100644 --- a/package/gnuradio/gnuradio.mk +++ b/package/gnuradio/gnuradio.mk @@ -19,7 +19,7 @@ GNURADIO_DEPENDENCIES = \ host-swig \ boost \ log4cpp \ - gmp \ + $(if $(BR2_PACKAGE_WEBOS_GMP),webos-gmp,gmp) \ volk GNURADIO_CONF_OPTS = \ diff --git a/package/guile/guile.mk b/package/guile/guile.mk index 9478e75b41..1c3fec215a 100644 --- a/package/guile/guile.mk +++ b/package/guile/guile.mk @@ -16,7 +16,7 @@ GUILE_LICENSE = LGPL-3.0+ GUILE_LICENSE_FILES = LICENSE COPYING COPYING.LESSER GUILE_CPE_ID_VENDOR = gnu -GUILE_DEPENDENCIES = host-guile libunistring libffi gmp bdwgc host-pkgconf +GUILE_DEPENDENCIES = host-guile libunistring libffi $(if $(BR2_PACKAGE_WEBOS_GMP),webos-gmp,gmp) bdwgc host-pkgconf HOST_GUILE_DEPENDENCIES = \ host-libunistring host-libffi host-gmp host-bdwgc host-flex \ host-pkgconf host-gettext host-gperf diff --git a/package/libbytesize/libbytesize.mk b/package/libbytesize/libbytesize.mk index a95ee08357..6efeb04d1d 100644 --- a/package/libbytesize/libbytesize.mk +++ b/package/libbytesize/libbytesize.mk @@ -13,7 +13,7 @@ LIBBYTESIZE_INSTALL_STAGING = YES LIBBYTESIZE_DEPENDENCIES = \ host-pkgconf \ host-gettext \ - gmp \ + $(if $(BR2_PACKAGE_WEBOS_GMP),webos-gmp,gmp) \ mpfr \ pcre2 diff --git a/package/libpbnjson/libpbnjson.mk b/package/libpbnjson/libpbnjson.mk index 9081757d1a..e324125724 100644 --- a/package/libpbnjson/libpbnjson.mk +++ b/package/libpbnjson/libpbnjson.mk @@ -16,7 +16,7 @@ LIBPBNJSON_DEPENDENCIES = \ host-lemon \ cmake-modules-webos \ boost \ - gmp \ + $(if $(BR2_PACKAGE_WEBOS_GMP),webos-gmp,gmp) \ libglib2 \ liburiparser \ yajl diff --git a/package/minetest/minetest.mk b/package/minetest/minetest.mk index 6d56c3222f..9d7159dc2c 100644 --- a/package/minetest/minetest.mk +++ b/package/minetest/minetest.mk @@ -10,7 +10,7 @@ MINETEST_LICENSE = LGPL-2.1+ (code), CC-BY-SA-3.0 (textures and sounds), Zlib (i MINETEST_LICENSE_FILES = LICENSE.txt lib/irrlichtmt/doc/irrlicht-license.txt MINETEST_CPE_ID_VENDOR = minetest -MINETEST_DEPENDENCIES = gmp jsoncpp luajit sqlite zlib zstd +MINETEST_DEPENDENCIES = $(if $(BR2_PACKAGE_WEBOS_GMP),webos-gmp,gmp) jsoncpp luajit sqlite zlib zstd MINETEST_IRRLICHTMT_VERSION = 1.9.0mt5 MINETEST_EXTRA_DOWNLOADS = $(call github,minetest,irrlicht,$(MINETEST_IRRLICHTMT_VERSION))/irrlicht-$(MINETEST_IRRLICHTMT_VERSION).tar.gz diff --git a/package/mpc/mpc.mk b/package/mpc/mpc.mk index 364e4c3c85..088de21220 100644 --- a/package/mpc/mpc.mk +++ b/package/mpc/mpc.mk @@ -9,7 +9,7 @@ MPC_SITE = $(BR2_GNU_MIRROR)/mpc MPC_LICENSE = LGPL-3.0+ MPC_LICENSE_FILES = COPYING.LESSER MPC_INSTALL_STAGING = YES -MPC_DEPENDENCIES = gmp mpfr +MPC_DEPENDENCIES = $(if $(BR2_PACKAGE_WEBOS_GMP),webos-gmp,gmp) mpfr HOST_MPC_DEPENDENCIES = host-gmp host-mpfr $(eval $(autotools-package)) diff --git a/package/mpfr/mpfr.mk b/package/mpfr/mpfr.mk index cd558dae0e..499af9221d 100644 --- a/package/mpfr/mpfr.mk +++ b/package/mpfr/mpfr.mk @@ -11,7 +11,7 @@ MPFR_LICENSE = LGPL-3.0+ MPFR_LICENSE_FILES = COPYING.LESSER MPFR_CPE_ID_VENDOR = gnu MPFR_INSTALL_STAGING = YES -MPFR_DEPENDENCIES = gmp +MPFR_DEPENDENCIES = $(if $(BR2_PACKAGE_WEBOS_GMP),webos-gmp,gmp) HOST_MPFR_DEPENDENCIES = host-gmp MPFR_MAKE_OPTS = RANLIB=$(TARGET_RANLIB) diff --git a/package/mpir/mpir.mk b/package/mpir/mpir.mk index 91f704d30c..d3c1d1c539 100644 --- a/package/mpir/mpir.mk +++ b/package/mpir/mpir.mk @@ -10,7 +10,7 @@ MPIR_SOURCE = mpir-$(MPIR_VERSION).tar.bz2 MPIR_LICENSE = LGPL-3.0+ MPIR_LICENSE_FILES = COPYING.LIB MPIR_INSTALL_STAGING = YES -MPIR_DEPENDENCIES = gmp host-yasm +MPIR_DEPENDENCIES = $(if $(BR2_PACKAGE_WEBOS_GMP),webos-gmp,gmp) host-yasm ifeq ($(BR2_MIPS_NABI32),y) MPIR_CONF_OPTS += ABI=n32 diff --git a/package/nettle/nettle.mk b/package/nettle/nettle.mk index da349e28de..bf5035660c 100644 --- a/package/nettle/nettle.mk +++ b/package/nettle/nettle.mk @@ -6,7 +6,7 @@ NETTLE_VERSION = 2.7.1 NETTLE_SITE = https://ftp.gnu.org/gnu/nettle -NETTLE_DEPENDENCIES = gmp +NETTLE_DEPENDENCIES = $(if $(BR2_PACKAGE_WEBOS_GMP),webos-gmp,gmp) NETTLE_INSTALL_STAGING = YES NETTLE_LICENSE = LGPLv2.1+ NETTLE_LICENSE_FILES = COPYING.LIB diff --git a/package/nftables/nftables.mk b/package/nftables/nftables.mk index 9d60736d7f..8dc9bb8ba8 100644 --- a/package/nftables/nftables.mk +++ b/package/nftables/nftables.mk @@ -14,7 +14,7 @@ NFTABLES_CONF_OPTS = --disable-debug --disable-man-doc --disable-pdf-doc NFTABLES_SELINUX_MODULES = iptables ifeq ($(BR2_PACKAGE_GMP),y) -NFTABLES_DEPENDENCIES += gmp +NFTABLES_DEPENDENCIES += $(if $(BR2_PACKAGE_WEBOS_GMP),webos-gmp,gmp) NFTABLES_CONF_OPTS += --without-mini-gmp else NFTABLES_CONF_OPTS += --with-mini-gmp diff --git a/package/openldap/openldap.mk b/package/openldap/openldap.mk index b5373544ab..444beb6c0d 100644 --- a/package/openldap/openldap.mk +++ b/package/openldap/openldap.mk @@ -36,7 +36,7 @@ OPENLDAP_DEPENDENCIES += openssl OPENLDAP_CONF_ENV = LIBS="`$(PKG_CONFIG_HOST_BINARY) --libs libssl libcrypto`" else ifeq ($(BR2_PACKAGE_GMP),y) OPENLDAP_MP = gmp -OPENLDAP_DEPENDENCIES += gmp +OPENLDAP_DEPENDENCIES += $(if $(BR2_PACKAGE_WEBOS_GMP),webos-gmp,gmp) else OPENLDAP_MP = longlong endif diff --git a/package/openswan/openswan.mk b/package/openswan/openswan.mk index bb56e4516c..0dea4f0d2d 100644 --- a/package/openswan/openswan.mk +++ b/package/openswan/openswan.mk @@ -10,7 +10,7 @@ OPENSWAN_LICENSE = GPL-2.0+, BSD-3-Clause OPENSWAN_LICENSE_FILES = COPYING LICENSE OPENSWAN_CPE_ID_VENDOR = xelerance -OPENSWAN_DEPENDENCIES = host-bison host-flex gmp iproute2 +OPENSWAN_DEPENDENCIES = host-bison host-flex $(if $(BR2_PACKAGE_WEBOS_GMP),webos-gmp,gmp) iproute2 OPENSWAN_MAKE_OPTS = ARCH=$(BR2_ARCH) CC="$(TARGET_CC)" POD2MAN="" XMLTO="" \ USERCOMPILE="$(TARGET_CFLAGS) $(if $(BR2_TOOLCHAIN_SUPPORTS_PIE),-fPIE)" \ USERLINK="$(TARGET_LDFLAGS) $(if $(BR2_TOOLCHAIN_SUPPORTS_PIE),-fPIE)" \ diff --git a/package/php/php.mk b/package/php/php.mk index 4ee6774bd6..91327363c1 100644 --- a/package/php/php.mk +++ b/package/php/php.mk @@ -203,7 +203,7 @@ endif ifeq ($(BR2_PACKAGE_PHP_EXT_GMP),y) PHP_CONF_OPTS += --with-gmp=$(STAGING_DIR)/usr -PHP_DEPENDENCIES += gmp +PHP_DEPENDENCIES += $(if $(BR2_PACKAGE_WEBOS_GMP),webos-gmp,gmp) endif ifeq ($(BR2_PACKAGE_PHP_EXT_READLINE),y) diff --git a/package/ruby/ruby.mk b/package/ruby/ruby.mk index 28b1ec13ef..f86f7fb30c 100644 --- a/package/ruby/ruby.mk +++ b/package/ruby/ruby.mk @@ -76,7 +76,7 @@ ifeq ($(BR2_PACKAGE_ZLIB),y) RUBY_DEPENDENCIES += zlib endif ifeq ($(BR2_PACKAGE_GMP),y) -RUBY_DEPENDENCIES += gmp +RUBY_DEPENDENCIES += $(if $(BR2_PACKAGE_WEBOS_GMP),webos-gmp,gmp) RUBY_CONF_OPTS += --with-gmp else RUBY_CONF_OPTS += --without-gmp diff --git a/package/webos-gmp/0001-disable-stdc.patch b/package/webos-gmp/0001-disable-stdc.patch new file mode 100644 index 0000000000..aaffaf14c5 --- /dev/null +++ b/package/webos-gmp/0001-disable-stdc.patch @@ -0,0 +1,33 @@ +Upstream-Status: Pending + +# "extern inline" in traditional gcc means that the function should be +# inlined wherever it's seen, while in C99, "extern inline" means that i +# the function should only be inlined where the inline definition is +# seen while in other places it's not inlined: +# http://gcc.gnu.org/ml/gcc/2006-11/msg00006.html +# +# gmp checks "--std=gnu99" to use C99 convention however it internally +# defines some "extern inline" functions in gmp.h, which is included +# by mainly .c files and finally lead a flood of redefinition function +# errors when linking objects together. +# +# So disable C99/ANSI detection to stick to tranditional gcc behavior +# +# by Kevin Tian , 2010-08-13 +# +# (this patch is licensed under GPLv2+) + +diff --git a/configure.in b/configure.in +index 450cc92..aab0b59 100644 +--- a/configure.in ++++ b/configure.in +@@ -1869,9 +1869,7 @@ AC_SUBST(DEFN_LONG_LONG_LIMB) + + # The C compiler and preprocessor, put into ANSI mode if possible. + AC_PROG_CC +-AC_PROG_CC_STDC + AC_PROG_CPP +-GMP_H_ANSI + + + # The C compiler on the build system, and associated tests. diff --git a/package/webos-gmp/0002-gmp_fix_for_automake-1.12.patch b/package/webos-gmp/0002-gmp_fix_for_automake-1.12.patch new file mode 100644 index 0000000000..fbd8a39d01 --- /dev/null +++ b/package/webos-gmp/0002-gmp_fix_for_automake-1.12.patch @@ -0,0 +1,48 @@ +Upstream-Status: Pending + +automake 1.12 has depricated automatic de-ANSI-fication support + +this patch avoids these kinds of errors: + +| configure.in:2240: error: automatic de-ANSI-fication support has been removed +| Makefile.am:28: error: automatic de-ANSI-fication support has been removed + +Signed-Off-By: Nitin A Kamble +2012/05/02 + +Index: gmp-4.2.1/configure.in +=================================================================== +--- gmp-4.2.1.orig/configure.in ++++ gmp-4.2.1/configure.in +@@ -67,7 +67,7 @@ dnl + dnl Note that there's a copy of these options in the top-level Makefile.am, + dnl so update there too if changing anything. + dnl +-AM_INIT_AUTOMAKE([1.8 gnu no-dependencies $(top_builddir)/ansi2knr]) ++AM_INIT_AUTOMAKE([1.8 gnu no-dependencies]) + AM_CONFIG_HEADER(config.h:config.in) + AM_MAINTAINER_MODE + +@@ -2022,9 +2022,6 @@ fi + echo " MPN_PATH=\"$path\"" + + +-# Automake ansi2knr support. +-AM_C_PROTOTYPES +- + GMP_PROG_AR + GMP_PROG_NM + +Index: gmp-4.2.1/Makefile.am +=================================================================== +--- gmp-4.2.1.orig/Makefile.am ++++ gmp-4.2.1/Makefile.am +@@ -27,7 +27,7 @@ + # Makefiles in subdirectories, but here we must omit it so automake gives + # the actual ansi2knr build rule, not "cd $(top_builddir) && make ansi2knr". + # +-AUTOMAKE_OPTIONS = 1.8 gnu no-dependencies ansi2knr ++AUTOMAKE_OPTIONS = 1.8 gnu no-dependencies + + + # Libtool -version-info for libgmp.la and libmp.la. See "Versioning" in the diff --git a/package/webos-gmp/0003-gmp-fix-ansi-c99-webos.patch b/package/webos-gmp/0003-gmp-fix-ansi-c99-webos.patch new file mode 100644 index 0000000000..874b957baa --- /dev/null +++ b/package/webos-gmp/0003-gmp-fix-ansi-c99-webos.patch @@ -0,0 +1,27 @@ +This change was extracted from gmp 4.2.2 (2007-09-03) + + From Richard Guenther: + * gmp-h.in (__GMP_EXTERN_INLINE): Declare conditionally on + __GNUC_STDC_INLINE__. + +Index: gmp-4.2.1/gmp-h.in +=================================================================== +--- gmp-4.2.1.orig/gmp-h.in 2006-04-11 11:10:15.000000000 -0700 ++++ gmp-4.2.1/gmp-h.in 2013-11-24 17:21:12.807735622 -0800 +@@ -418,9 +418,15 @@ + + /* gcc has __inline__ in all modes, including strict ansi. Give a prototype + for an inline too, so as to correctly specify "dllimport" on windows, in +- case the function is called rather than inlined. */ ++ case the function is called rather than inlined. ++ GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99 ++ inline semantics, unless -fgnu89-inline is used. */ + #ifdef __GNUC__ ++#ifdef __GNUC_STDC_INLINE__ ++#define __GMP_EXTERN_INLINE extern __inline__ __attribute__ ((__gnu_inline__)) ++#else + #define __GMP_EXTERN_INLINE extern __inline__ ++#endif + #define __GMP_INLINE_PROTOTYPES 1 + #endif + diff --git a/package/webos-gmp/Config.in b/package/webos-gmp/Config.in new file mode 100644 index 0000000000..5666ee0403 --- /dev/null +++ b/package/webos-gmp/Config.in @@ -0,0 +1,10 @@ +config BR2_PACKAGE_WEBOS_GMP + bool "gmp 4.2.1 (shared only)" + depends on BR2_WEBOS_COMPAT + depends on BR2_PACKAGE_GMP + help + The version of gmp used on webOS (up through at least + webOS 8). + + This replaces the normal buildroot gmp on the target (but not + host). diff --git a/package/webos-gmp/webos-gmp.hash b/package/webos-gmp/webos-gmp.hash new file mode 100644 index 0000000000..22a38102cd --- /dev/null +++ b/package/webos-gmp/webos-gmp.hash @@ -0,0 +1,6 @@ +# Locally calculated +sha256 d07ffcb37eecec35c5ec72516d10b35fdf6e6fef1fcf1dcd37e30b8cbf8bf941 gmp-4.2.1.tar.bz2 + +# Locally calculated +sha256 ddb9db7630752f8fdc6898f7c99a99eaeeac5213627ecb093df9c82f56175dc7 COPYING +sha256 5df07007198989c622f5d41de8d703e7bef3d0e79d62e24332ee739a452af62a COPYING.LIB diff --git a/package/webos-gmp/webos-gmp.mk b/package/webos-gmp/webos-gmp.mk new file mode 100644 index 0000000000..c80de3e257 --- /dev/null +++ b/package/webos-gmp/webos-gmp.mk @@ -0,0 +1,25 @@ +################################################################################ +# +# webos-gmp +# +################################################################################ + +WEBOS_GMP_VERSION = 4.2.1 +WEBOS_GMP_SITE = $(BR2_GNU_MIRROR)/gmp +WEBOS_GMP_SOURCE = gmp-$(WEBOS_GMP_VERSION).tar.bz2 +WEBOS_GMP_INSTALL_STAGING = YES +WEBOS_GMP_LICENSE = LGPL-2.1+ or GPL-2.0+ +WEBOS_GMP_LICENSE_FILES = COPYING.LIB COPYING +WEBOS_GMP_CPE_ID_VENDOR = gmplib +WEBOS_GMP_DEPENDENCIES = host-m4 + +# 0001-mpz-inp_raw.c-Avoid-bit-size-overflows.patch +WEBOS_GMP_IGNORE_CVES += CVE-2021-43618 + +ifeq ($(BR2_INSTALL_LIBSTDCPP),y) +WEBOS_GMP_CONF_OPTS += --enable-cxx +else +WEBOS_GMP_CONF_OPTS += --disable-cxx +endif + +$(eval $(autotools-package)) From ffd1d8d24f5a532a1fe33030ac36bb0a0dcdb5bd Mon Sep 17 00:00:00 2001 From: throwaway96 <68320646+throwaway96@users.noreply.github.com> Date: Sun, 4 Feb 2024 20:59:55 -0500 Subject: [PATCH 5/5] add webos-gnutls: gnutls 3.3.30 for target only Should be compatible back to webOS 3.0. LG is unwilling to use later versions of gnutls because some parts were relicensed under the GPLv3. (However, only the tools and OpenSSL compatibility layer are GPLv3, and LG does not ship those. The issue may be dependencies such as nettle and gmp.) gnutls 2.x (libgnutls.so.26): - webOS 1, 2: 2.12.23 gnutls 3.x (libgnutls.so.28): - webOS 3.x: 3.3.5 - webOS 4.x: 3.3.27 - webOS 5-8: 3.3.30 --- package/Config.in | 1 + package/glib-networking/glib-networking.mk | 2 +- package/gnutls/gnutls.mk | 3 + package/webos-gnutls/Config.in | 15 +++++ package/webos-gnutls/webos-gnutls.hash | 5 ++ package/webos-gnutls/webos-gnutls.mk | 75 ++++++++++++++++++++++ 6 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 package/webos-gnutls/Config.in create mode 100644 package/webos-gnutls/webos-gnutls.hash create mode 100644 package/webos-gnutls/webos-gnutls.mk diff --git a/package/Config.in b/package/Config.in index ddc9669d1d..022bdb050f 100644 --- a/package/Config.in +++ b/package/Config.in @@ -2705,6 +2705,7 @@ menu "WebOS" source "package/umediaserver/Config.in" source "package/webos/Config.in" source "package/webos-gmp/Config.in" + source "package/webos-gnutls/Config.in" source "package/webos-userland/Config.in" source "package/webos-wayland-extensions/Config.in" endmenu diff --git a/package/glib-networking/glib-networking.mk b/package/glib-networking/glib-networking.mk index 4adc13d39f..c6573180c3 100644 --- a/package/glib-networking/glib-networking.mk +++ b/package/glib-networking/glib-networking.mk @@ -23,7 +23,7 @@ GLIB_NETWORKING_LICENSE_FILES = COPYING GLIB_NETWORKING_CPE_ID_VENDOR = gnome ifeq ($(BR2_PACKAGE_GNUTLS),y) -GLIB_NETWORKING_DEPENDENCIES += gnutls +GLIB_NETWORKING_DEPENDENCIES += $(if $(BR2_PACKAGE_WEBOS_GNUTLS),webos-gnutls,gnutls) GLIB_NETWORKING_CONF_OPTS += -Dgnutls=enabled else GLIB_NETWORKING_CONF_OPTS += -Dgnutls=disabled diff --git a/package/gnutls/gnutls.mk b/package/gnutls/gnutls.mk index 6e2cc501ef..0818fc8323 100644 --- a/package/gnutls/gnutls.mk +++ b/package/gnutls/gnutls.mk @@ -127,5 +127,8 @@ endif GNUTLS_CONF_ENV += LIBS="$(GNUTLS_LIBS)" +# Don't build for target if using webOS package instead +ifneq ($(BR2_PACKAGE_WEBOS_GNUTLS),y) $(eval $(autotools-package)) +endif $(eval $(host-autotools-package)) diff --git a/package/webos-gnutls/Config.in b/package/webos-gnutls/Config.in new file mode 100644 index 0000000000..cb582bc188 --- /dev/null +++ b/package/webos-gnutls/Config.in @@ -0,0 +1,15 @@ +config BR2_PACKAGE_WEBOS_GNUTLS + bool "gnutls 3.3.30" + depends on BR2_WEBOS_COMPAT + depends on BR2_PACKAGE_GNUTLS + help + The version of gnutls used on webOS 5-8. It should be compatible + back to webOS 3.x in theory. + + webOS 1, 2: 2.12.23 (libgnutls.so.26) + webOS 3.x: 3.3.5 (libgnutls.so.28) + webOS 4.x: 3.3.27 (libgnutls.so.28) + webOS 5-8: 3.3.30 (libgnutls.so.28) + + This replaces the normal buildroot gnutls on the target (but + not host). diff --git a/package/webos-gnutls/webos-gnutls.hash b/package/webos-gnutls/webos-gnutls.hash new file mode 100644 index 0000000000..e50ac481ce --- /dev/null +++ b/package/webos-gnutls/webos-gnutls.hash @@ -0,0 +1,5 @@ +# Locally calculated after checking pgp signature +sha256 41d70107ead3de2f12390909a05eefc9a88def6cd1f0d90ea82a7dac8b8effee gnutls-3.3.30.tar.xz +# Locally calculated +sha256 8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903 COPYING +sha256 6095e9ffa777dd22839f7801aa845b31c9ed07f3d6bf8a26dc5d2dec8ccc0ef3 COPYING.LESSER diff --git a/package/webos-gnutls/webos-gnutls.mk b/package/webos-gnutls/webos-gnutls.mk new file mode 100644 index 0000000000..36a956e1da --- /dev/null +++ b/package/webos-gnutls/webos-gnutls.mk @@ -0,0 +1,75 @@ +################################################################################ +# +# webos-gnutls +# +################################################################################ + +WEBOS_GNUTLS_VERSION_MAJOR = 3.3 +WEBOS_GNUTLS_VERSION = $(WEBOS_GNUTLS_VERSION_MAJOR).30 +WEBOS_GNUTLS_SOURCE = gnutls-$(WEBOS_GNUTLS_VERSION).tar.xz +WEBOS_GNUTLS_SITE = https://www.gnupg.org/ftp/gcrypt/gnutls/v$(WEBOS_GNUTLS_VERSION_MAJOR) +WEBOS_GNUTLS_LICENSE = LGPL-2.1+ (core library) +WEBOS_GNUTLS_LICENSE_FILES = COPYING.LESSER +WEBOS_GNUTLS_DEPENDENCIES = host-pkgconf nettle +WEBOS_GNUTLS_CPE_ID_VENDOR = gnu +# Yocto meta-gplv2 sets --disable-crywrap. +# libgnutls-openssl is not present on webOS (also GPLv3). +# libtasn1 is statically linked on at least webOS 4.0+ but not on webOS 1. +# libp11-kit is not present on webOS. +# There does not seem to be a default trust store. +WEBOS_GNUTLS_CONF_OPTS = \ + --disable-crywrap \ + --disable-openssl-compatibility \ + --with-included-libtasn1 \ + --without-p11-kit \ + --with-default-trust-store-file=no \ + --disable-doc \ + --disable-libdane \ + --disable-rpath \ + --disable-tests \ + --disable-guile \ + --with-libnettle-prefix=$(STAGING_DIR)/usr \ + --without-libdl-prefix \ + --without-libiconv-prefix \ + --without-libintl-prefix \ + --without-libnsl-prefix \ + --without-libpthread-prefix \ + --without-librt-prefix \ + --without-libz-prefix \ + --without-tpm +WEBOS_GNUTLS_CONF_ENV = gl_cv_socket_ipv6=yes \ + ac_cv_header_wchar_h=$(if $(BR2_USE_WCHAR),yes,no) \ + gt_cv_c_wchar_t=$(if $(BR2_USE_WCHAR),yes,no) \ + gt_cv_c_wint_t=$(if $(BR2_USE_WCHAR),yes,no) \ + gl_cv_func_gettimeofday_clobber=no +WEBOS_GNUTLS_INSTALL_STAGING = YES + +# libidn support for nommu must exclude the crywrap wrapper (uses fork) +WEBOS_GNUTLS_CONF_OPTS += $(if $(BR2_USE_MMU),,--disable-crywrap) + +ifeq ($(BR2_PACKAGE_CRYPTODEV_LINUX),y) +WEBOS_GNUTLS_CONF_OPTS += --enable-cryptodev +WEBOS_GNUTLS_DEPENDENCIES += cryptodev-linux +endif + +ifeq ($(BR2_PACKAGE_ZLIB),y) +WEBOS_GNUTLS_CONF_OPTS += --with-zlib +WEBOS_GNUTLS_DEPENDENCIES += zlib +else +WEBOS_GNUTLS_CONF_OPTS += --without-zlib +endif + +# Some examples in doc/examples use wchar +define WEBOS_GNUTLS_DISABLE_DOCS + $(SED) 's/ doc / /' $(@D)/Makefile.in +endef + +define WEBOS_GNUTLS_DISABLE_TOOLS + $(SED) 's/\$$(PROGRAMS)//' $(@D)/src/Makefile.in + $(SED) 's/) install-exec-am/)/' $(@D)/src/Makefile.in +endef + +WEBOS_GNUTLS_POST_PATCH_HOOKS += WEBOS_GNUTLS_DISABLE_DOCS +WEBOS_GNUTLS_POST_PATCH_HOOKS += WEBOS_GNUTLS_DISABLE_TOOLS + +$(eval $(autotools-package))