From patchwork Wed Jul 21 21:45:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 1508473 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=bKwQUEqr; dkim-atps=neutral Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GVTfY1rD2z9sS8 for ; Thu, 22 Jul 2021 07:45:57 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 6496E40210; Wed, 21 Jul 2021 21:45:55 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FWraQR9wy2l3; Wed, 21 Jul 2021 21:45:53 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 810EB40327; Wed, 21 Jul 2021 21:45:52 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 7A7D61C1187 for ; Wed, 21 Jul 2021 21:45:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 6A1AC400F3 for ; Wed, 21 Jul 2021 21:45:26 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp2.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vCQGtRi4Jk-u for ; Wed, 21 Jul 2021 21:45:22 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by smtp2.osuosl.org (Postfix) with ESMTPS id B4404400E1 for ; Wed, 21 Jul 2021 21:45:22 +0000 (UTC) Received: by mail-pj1-x102b.google.com with SMTP id j1so1542594pjj.4 for ; Wed, 21 Jul 2021 14:45:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=mnMH+T+vat6ykkP65fvYPQVHGFHu/Ps15MTFFbz5i5A=; b=bKwQUEqriy0N4h96JmOgruIn8T6uc6CrF2BtPryn1cZ5L81WPWPOZl8RF7lYhiT8Et bWeGYYYPBJ1bVlzW8U7n7bsPQs1665n4dKKXu6ftGZwambRSC5JOJXwQcuzlfrXn2j6Z X1+7+arOaH2jpcD4E6mL5NwkgMbKK2W51rBWTukr7VOi+k1sd1F2SSgCw6SKmt/+Z2UK /+3N2zBrBzFYvgPcyHXIRfHFM8sQETXW9ZDRKukMqC4OQF0QRkh0NXHZBrNYo34NWDVX D7fqpG52Fvy4y/shNN4RJDm+mJoqZjmJD0pzDkTQM1QC/804CyTktuHZzBSPukrivf7P 7X8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=mnMH+T+vat6ykkP65fvYPQVHGFHu/Ps15MTFFbz5i5A=; b=fOfHH/TUKEarq3Z/XfBfTlqied11SVJoIcr9YfDC+ptIShIMpzSUOFnVF9HBE4QXZa LowWKS9pqRCoPYB0WWi1vquybWoRfKTG8oB71EFlbW+GZbJolFoVZ0eIUBe5SXAiH0Ss Md0adlfD1P0Fe0eiKShikN/o/pvRlo/kDoik0BZkeTDWb29HIhSndN3rfLtdz4R0gtK5 A+a65CRtJ4TbAGEvjm0QHsh6zQycB+wDqPVlPlNHxyf+s/KpCXH8nngjNSurTJXOIdZ0 swb/LKxdKuDok+X1cUkXpEhizODEJmdAmHvM3I0PKUF98DZSc5dY9IS5r5IoEIXDSc99 cq9g== X-Gm-Message-State: AOAM530GIzAQ0a47/9xXMe7ikU0UVfL8wsOzdhgiI77TCwYnN/HsjSdI 4yVWSY7Ns6h5s+ZEqs3CBVXCMlMRAgI= X-Google-Smtp-Source: ABdhPJxFPLV4rZGmR43lk7xpAdeKRKqV4NPbQcTRAUzINxdJF7M/ZakfncYFjn++Jf+n+Ygk33tKNA== X-Received: by 2002:a17:90a:8a94:: with SMTP id x20mr5627394pjn.130.1626903921425; Wed, 21 Jul 2021 14:45:21 -0700 (PDT) Received: from adam.duskett ([47.149.13.137]) by smtp.gmail.com with ESMTPSA id t37sm28266330pfg.14.2021.07.21.14.45.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jul 2021 14:45:20 -0700 (PDT) From: Adam Duskett To: buildroot@buildroot.org Date: Wed, 21 Jul 2021 14:45:15 -0700 Message-Id: <20210721214518.227254-1-aduskett@gmail.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2 1/4] package/polkit: bump version to 0.119 and use duktape X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marek Belisko , "Yann E . MORIN" , Thomas Petazzoni , Giulio Benetti , Norbert Lange , Adam Duskett , Maxime Hadjinlian Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Unfortuantly, as of commit 3e1d61868fa8bfc586099302e931433270e5d17d, polkit requires mozjs >= 78, which means spidermonkey is too old. As such, this patch is larger than usual. Spidermonkey has a few major issues: - The source directory after compilation is enormous (2.7G!) - The shared library is 24MB stripped! - It requires python2 to build, which is EOLed, and Buildroot is working towards removing. See: https://elinux.org/Buildroot:Python2Packages Instead of going through the arduous task of updating Spidermonkey, there is a better solution: use duktape. There has been a pending patch for over a year that incorporates duktape as an optional backend for polkit found here: https://gitlab.freedesktop.org/polkit/polkit/-/merge_requests/35 As Thomas Petazzoni put it: "As I am subscribed to notifications on this merge request, I have been following the intermittent discussions taking place on this topic. And indeed, discussions have been sparse, and the polkit maintainer reaction has not been very supportive. It even feels like they are trying to find every possible argument or small issue not to merge the duktape integration." Many people have come out to support using duktape, and many users, including myself, have used polkit with duktape for as long as the above merge request has been around without issues; merging in the above merge request is an acceptable exception to the typical Buildroot package policies. As Thomas also suggested, I have forked polkit on Github (https://github.com/aduskett/polkit-duktape), with the above duktape merge request applied, and a release made with the same tag as upstream (0.119). I refrained from also adding 0001-make-netgroup-support-optional.patch as it is outside of the scope of why the fork exists. Changes: - refactor 0001-make-netgroup-support-optional.patch to work with 0.119 and duktape. - Remove upstream incorporated 0002-jsauthority-memleak.patch - Remove upstream 0003-polkit-0.116-pkttyagent-sigttou-bg-job.patch - Remove any trace of spidermonkey from polkit, udisks, and systemd-polkit - Add duktape as a dependency of polkit - Change POLKIT_SITE to the above polkit-duktape GitHub repository. Signed-off-by: Adam Duskett --- Changes v1 -> v2: - Extend 0001-make-netgroup-support-optional.patch to include duktape support instead of modifying the duktape merge request to make netgroup support optional. (Thomas) .../0001-make-netgroup-support-optional.patch | 41 +++++++++++++++---- package/polkit/0002-jsauthority-memleak.patch | 28 ------------- ...lkit-0.116-pkttyagent-sigttou-bg-job.patch | 34 --------------- package/polkit/Config.in | 24 ++++------- package/polkit/polkit.hash | 4 +- package/polkit/polkit.mk | 12 +++--- package/systemd/Config.in | 17 +++----- package/udisks/Config.in | 23 ++++------- 8 files changed, 59 insertions(+), 124 deletions(-) delete mode 100644 package/polkit/0002-jsauthority-memleak.patch delete mode 100644 package/polkit/0003-polkit-0.116-pkttyagent-sigttou-bg-job.patch diff --git a/package/polkit/0001-make-netgroup-support-optional.patch b/package/polkit/0001-make-netgroup-support-optional.patch index 86916aba34..09c48d7791 100644 --- a/package/polkit/0001-make-netgroup-support-optional.patch +++ b/package/polkit/0001-make-netgroup-support-optional.patch @@ -16,6 +16,7 @@ Fixes bug 50145. Signed-off-by: A. Wilcox Signed-off-by: Khem Raj +[Adam: Extend patch to work with duktape integration.] Signed-off-by: Adam Duskett [Thomas: add introspection.m4.] Signed-off-by: Thomas Petazzoni @@ -24,12 +25,13 @@ Signed-off-by: Thomas Petazzoni configure.ac | 2 +- src/polkit/polkitidentity.c | 16 ++ src/polkit/polkitunixnetgroup.c | 3 + + .../polkitbackendduktapeauthority.c | 2 + .../polkitbackendinteractiveauthority.c | 14 +- - .../polkitbackendjsauthority.cpp | 2 + + .../polkitbackendjsauthority.cpp | 3 +- test/polkit/polkitidentitytest.c | 9 +- test/polkit/polkitunixnetgrouptest.c | 3 + .../test-polkitbackendjsauthority.c | 2 + - 9 files changed, 185 insertions(+), 8 deletions(-) + 10 files changed, 187 insertions(+), 9 deletions(-) create mode 100644 buildutil/introspection.m4 diff --git a/buildutil/introspection.m4 b/buildutil/introspection.m4 @@ -184,7 +186,7 @@ diff --git a/configure.ac b/configure.ac index 5cedb4e..87aa0ad 100644 --- a/configure.ac +++ b/configure.ac -@@ -99,7 +99,7 @@ AC_CHECK_LIB(expat,XML_ParserCreate,[EXPAT_LIBS="-lexpat"], +@@ -111,7 +111,7 @@ AC_CHECK_LIB(expat,XML_ParserCreate,[EXPAT_LIBS="-lexpat"], [AC_MSG_ERROR([Can't find expat library. Please install expat.])]) AC_SUBST(EXPAT_LIBS) @@ -249,6 +251,26 @@ index 8a2b369..83f8d4a 100644 g_return_val_if_fail (name != NULL, NULL); return POLKIT_IDENTITY (g_object_new (POLKIT_TYPE_UNIX_NETGROUP, "name", name, +diff --git a/src/polkitbackend/polkitbackendduktapeauthority.c b/src/polkitbackend/polkitbackendduktapeauthority.c +index 4b4f8fd..e19b009 100644 +--- a/src/polkitbackend/polkitbackendduktapeauthority.c ++++ b/src/polkitbackend/polkitbackendduktapeauthority.c +@@ -1036,6 +1036,7 @@ js_polkit_user_is_in_netgroup (duk_context *cx) + const char *netgroup; + gboolean is_in_netgroup = FALSE; + ++#ifdef HAVE_SETNETGRENT + user = duk_require_string (cx, 0); + netgroup = duk_require_string (cx, 1); + +@@ -1046,6 +1047,7 @@ js_polkit_user_is_in_netgroup (duk_context *cx) + { + is_in_netgroup = TRUE; + } ++#endif + + duk_push_boolean (cx, is_in_netgroup); + return 1; diff --git a/src/polkitbackend/polkitbackendinteractiveauthority.c b/src/polkitbackend/polkitbackendinteractiveauthority.c index 056d9a8..36c2f3d 100644 --- a/src/polkitbackend/polkitbackendinteractiveauthority.c @@ -298,7 +320,7 @@ diff --git a/src/polkitbackend/polkitbackendjsauthority.cpp b/src/polkitbackend/ index 9b752d1..09b2878 100644 --- a/src/polkitbackend/polkitbackendjsauthority.cpp +++ b/src/polkitbackend/polkitbackendjsauthority.cpp -@@ -1502,6 +1502,7 @@ js_polkit_user_is_in_netgroup (JSContext *cx, +@@ -1520,6 +1520,7 @@ js_polkit_user_is_in_netgroup (JSContext *cx, JS::CallArgs args = JS::CallArgsFromVp (argc, vp); @@ -306,14 +328,15 @@ index 9b752d1..09b2878 100644 JS::RootedString usrstr (authority->priv->cx); usrstr = args[0].toString(); user = JS_EncodeStringToUTF8 (cx, usrstr); -@@ -1519,6 +1520,7 @@ js_polkit_user_is_in_netgroup (JSContext *cx, - - JS_free (cx, netgroup); - JS_free (cx, user); +@@ -1534,7 +1535,7 @@ js_polkit_user_is_in_netgroup (JSContext *cx, + { + is_in_netgroup = true; + } +- +#endif - ret = true; + args.rval ().setBoolean (is_in_netgroup); diff --git a/test/polkit/polkitidentitytest.c b/test/polkit/polkitidentitytest.c index e91967b..e829aaa 100644 --- a/test/polkit/polkitidentitytest.c diff --git a/package/polkit/0002-jsauthority-memleak.patch b/package/polkit/0002-jsauthority-memleak.patch deleted file mode 100644 index 4f0733185c..0000000000 --- a/package/polkit/0002-jsauthority-memleak.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 28e3a6653d8c3777b07e0128a0d97d46e586e311 Mon Sep 17 00:00:00 2001 -From: Jan Rybar -Date: Tue, 8 Oct 2019 13:28:18 +0000 -Subject: [PATCH] jsauthority: Fix two minor memory leaks - -(cherry picked from commit 28e3a6653d8c3777b07e0128a0d97d46e586e311) -Signed-off-by: Jan Rybar -Signed-off-by: Adam Duskett ---- - src/polkitbackend/polkitbackendjsauthority.cpp | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/src/polkitbackend/polkitbackendjsauthority.cpp b/src/polkitbackend/polkitbackendjsauthority.cpp -index 9b752d1..e97b8aa 100644 ---- a/src/polkitbackend/polkitbackendjsauthority.cpp -+++ b/src/polkitbackend/polkitbackendjsauthority.cpp -@@ -567,6 +567,8 @@ polkit_backend_js_authority_finalize (GObject *object) - g_strfreev (authority->priv->rules_dirs); - - delete authority->priv->ac; -+ delete authority->priv->js_global; -+ delete authority->priv->js_polkit; - - JS_DestroyContext (authority->priv->cx); - /* JS_ShutDown (); */ --- -2.24.1 - diff --git a/package/polkit/0003-polkit-0.116-pkttyagent-sigttou-bg-job.patch b/package/polkit/0003-polkit-0.116-pkttyagent-sigttou-bg-job.patch deleted file mode 100644 index fb41df3af2..0000000000 --- a/package/polkit/0003-polkit-0.116-pkttyagent-sigttou-bg-job.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 76aae4fce586b400f5fe08df31497db19d624609 Mon Sep 17 00:00:00 2001 -From: Jan Rybar -Date: Thu, 1 Aug 2019 06:46:10 +0000 -Subject: [PATCH] pkttyagent: process stopped by SIGTTOU if run in background - job - - -(cherry picked from commit 76aae4fce586b400f5fe08df31497db19d624609) -Signed-off-by: Jan Rybar -Signed-off-by: Adam Duskett ---- - src/programs/pkttyagent.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/src/programs/pkttyagent.c b/src/programs/pkttyagent.c -index 3c8d502..13879a2 100644 ---- a/src/programs/pkttyagent.c -+++ b/src/programs/pkttyagent.c -@@ -264,6 +264,12 @@ main (int argc, char *argv[]) - - memset (&sa, 0, sizeof (sa)); - sa.sa_handler = &tty_handler; -+/* If tty_handler() resets terminal while pkttyagent is run in background job, -+ the process gets stopped by SIGTTOU. This impacts systemctl, hence it must -+ be blocked for a while and then the process gets killed anyway. -+ */ -+ sigemptyset(&sa.sa_mask); -+ sigaddset(&sa.sa_mask, SIGTTOU); - sigaction (SIGTERM, &sa, &savesigterm); - sigaction (SIGINT, &sa, &savesigint); - sigaction (SIGTSTP, &sa, &savesigtstp); --- -2.24.1 - diff --git a/package/polkit/Config.in b/package/polkit/Config.in index f54b6b4cda..622cbbb90b 100644 --- a/package/polkit/Config.in +++ b/package/polkit/Config.in @@ -1,18 +1,14 @@ config BR2_PACKAGE_POLKIT bool "polkit" - depends on BR2_HOST_GCC_AT_LEAST_4_9 # spidermonkey - depends on BR2_INSTALL_LIBSTDCPP # spidermonkey - depends on BR2_PACKAGE_SPIDERMONKEY_ARCH_SUPPORTS # spidermonkey - depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # spidermonkey - depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL # spidermonkey + depends on BR2_TOOLCHAIN_GCC_AT_LEAST_7 # C++17 + depends on BR2_TOOLCHAIN_HAS_THREADS # libglib2, dbus depends on BR2_USE_MMU # libglib2, dbus depends on BR2_USE_WCHAR # libglib2 - depends on !BR2_STATIC_LIBS # spidermonkey - depends on !BR2_TOOLCHAIN_USES_UCLIBC # spidermonkey + depends on !BR2_STATIC_LIBS # duktape select BR2_PACKAGE_DBUS # runtime + select BR2_PACKAGE_DUKTAPE select BR2_PACKAGE_EXPAT select BR2_PACKAGE_LIBGLIB2 - select BR2_PACKAGE_SPIDERMONKEY help PolicyKit is a toolkit for defining and handling authorizations. It is used for allowing unprivileged @@ -20,13 +16,7 @@ config BR2_PACKAGE_POLKIT http://www.freedesktop.org/wiki/Software/polkit -comment "polkit needs a glibc or musl toolchain with C++, wchar, dynamic library, NPTL, gcc >= 4.9" +comment "polkit needs a toolchain with dynamic library, wchar, threads, gcc >= 7" depends on BR2_USE_MMU - depends on BR2_PACKAGE_SPIDERMONKEY_ARCH_SUPPORTS - depends on BR2_TOOLCHAIN_USES_UCLIBC || \ - !BR2_INSTALL_LIBSTDCPP || \ - BR2_STATIC_LIBS || \ - !BR2_TOOLCHAIN_HAS_THREADS_NPTL || \ - !BR2_HOST_GCC_AT_LEAST_4_9 || \ - !BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 || \ - !BR2_USE_WCHAR + depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_GCC_AT_LEAST_7 || \ + BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS diff --git a/package/polkit/polkit.hash b/package/polkit/polkit.hash index bacd682139..9677e19bb0 100644 --- a/package/polkit/polkit.hash +++ b/package/polkit/polkit.hash @@ -1,5 +1,5 @@ # Locally calculated after checking pgp signature -sha256 88170c9e711e8db305a12fdb8234fac5706c61969b94e084d0f117d8ec5d34b1 polkit-0.116.tar.gz +sha256 88d078f1d1f653fd31fe42e46cc3d9b7dd468e70684075e32fe1766dc7ece517 polkit-0.119.tar.gz # Locally calculated -sha256 d2e2aa973e29c75e1b492e67ea7b7da9de2d501d49a934657971fd74f9a0b0a8 COPYING +sha256 d2e2aa973e29c75e1b492e67ea7b7da9de2d501d49a934657971fd74f9a0b0a8 COPYING diff --git a/package/polkit/polkit.mk b/package/polkit/polkit.mk index bf9b5a7112..f48c103a52 100644 --- a/package/polkit/polkit.mk +++ b/package/polkit/polkit.mk @@ -4,8 +4,8 @@ # ################################################################################ -POLKIT_VERSION = 0.116 -POLKIT_SITE = http://www.freedesktop.org/software/polkit/releases +POLKIT_VERSION = 0.119 +POLKIT_SITE = $(call github,aduskett,polkit-duktape,v$(POLKIT_VERSION)) POLKIT_LICENSE = GPL-2.0 POLKIT_LICENSE_FILES = COPYING POLKIT_CPE_ID_VENDOR = polkit_project @@ -13,11 +13,10 @@ POLKIT_AUTORECONF = YES POLKIT_INSTALL_STAGING = YES POLKIT_DEPENDENCIES = \ - libglib2 host-intltool expat spidermonkey $(TARGET_NLS_DEPENDENCIES) + duktape libglib2 host-intltool expat $(TARGET_NLS_DEPENDENCIES) -# spidermonkey needs C++11 POLKIT_CONF_ENV = \ - CXXFLAGS="$(TARGET_CXXFLAGS) -std=c++11" \ + CXXFLAGS="$(TARGET_CXXFLAGS)" \ LIBS=$(TARGET_NLS_LIBS) POLKIT_CONF_OPTS = \ @@ -25,7 +24,8 @@ POLKIT_CONF_OPTS = \ --disable-man-pages \ --disable-examples \ --disable-libelogind \ - --disable-libsystemd-login + --disable-libsystemd-login \ + --with-duktape ifeq ($(BR2_PACKAGE_GOBJECT_INTROSPECTION),y) POLKIT_CONF_OPTS += --enable-introspection diff --git a/package/systemd/Config.in b/package/systemd/Config.in index b9b1b3b9b4..0148cad791 100644 --- a/package/systemd/Config.in +++ b/package/systemd/Config.in @@ -329,11 +329,8 @@ config BR2_PACKAGE_SYSTEMD_OOMD config BR2_PACKAGE_SYSTEMD_POLKIT bool "enable polkit support" - depends on BR2_HOST_GCC_AT_LEAST_4_9 # polkit - depends on BR2_INSTALL_LIBSTDCPP # polkit - depends on BR2_PACKAGE_SPIDERMONKEY_ARCH_SUPPORTS # polkit - depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # polkit - depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL # polkit + depends on BR2_TOOLCHAIN_GCC_AT_LEAST_7 # polkit -> c++17 + depends on BR2_TOOLCHAIN_HAS_THREADS # polkit depends on BR2_USE_WCHAR # libglib2 select BR2_PACKAGE_POLKIT help @@ -344,13 +341,9 @@ config BR2_PACKAGE_SYSTEMD_POLKIT http://wiki.freedesktop.org/www/Software/polkit/ -comment "polkit support needs a toolchain with C++, wchar, NPTL, gcc >= 4.9" - depends on BR2_PACKAGE_SPIDERMONKEY_ARCH_SUPPORTS - depends on !BR2_INSTALL_LIBSTDCPP || \ - !BR2_TOOLCHAIN_HAS_THREADS_NPTL || \ - !BR2_HOST_GCC_AT_LEAST_4_9 || \ - !BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 || \ - !BR2_USE_WCHAR +comment "polkit support needs a toolchain with threads, wchar, gcc >= 7" + depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_GCC_AT_LEAST_7 || \ + !BR2_TOOLCHAIN_HAS_THREADS config BR2_PACKAGE_SYSTEMD_PORTABLED bool "enable portable services" diff --git a/package/udisks/Config.in b/package/udisks/Config.in index 17993baafc..82f11ae7de 100644 --- a/package/udisks/Config.in +++ b/package/udisks/Config.in @@ -1,16 +1,12 @@ config BR2_PACKAGE_UDISKS bool "udisks" depends on BR2_ENABLE_LOCALE # parted - depends on BR2_HOST_GCC_AT_LEAST_4_9 # spidermonkey - depends on BR2_INSTALL_LIBSTDCPP # spidermonkey depends on BR2_PACKAGE_HAS_UDEV - depends on BR2_PACKAGE_SPIDERMONKEY_ARCH_SUPPORTS # spidermonkey - depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # spidermonkey - depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL # polkit + depends on BR2_TOOLCHAIN_GCC_AT_LEAST_7 # polkit -> C++17 + depends on BR2_TOOLCHAIN_HAS_THREADS # polkit depends on BR2_USE_WCHAR # dbus-glib -> glib2 depends on BR2_TOOLCHAIN_HAS_SYNC_4 # libblockdev -> cryptsetup -> json-c - depends on !BR2_TOOLCHAIN_USES_UCLIBC # polkit - depends on !BR2_STATIC_LIBS # spidermonkey + depends on !BR2_STATIC_LIBS # polkit -> duktape select BR2_PACKAGE_DBUS select BR2_PACKAGE_DBUS_GLIB select BR2_PACKAGE_LIBATASMART @@ -43,14 +39,9 @@ comment "udisks needs udev /dev management" depends on BR2_USE_MMU depends on !BR2_PACKAGE_HAS_UDEV -comment "udisks needs a glibc or musl toolchain with locale, C++, wchar, dynamic library, NPTL, gcc >= 4.9" +comment "udisks needs a toolchain with dynamic library, locale, wchar, threads, gcc >= 7" depends on BR2_USE_MMU - depends on BR2_PACKAGE_SPIDERMONKEY_ARCH_SUPPORTS depends on BR2_TOOLCHAIN_HAS_SYNC_4 - depends on !BR2_ENABLE_LOCALE || BR2_TOOLCHAIN_USES_UCLIBC || \ - !BR2_INSTALL_LIBSTDCPP || \ - BR2_STATIC_LIBS || \ - !BR2_TOOLCHAIN_HAS_THREADS_NPTL || \ - !BR2_HOST_GCC_AT_LEAST_4_9 || \ - !BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 || \ - !BR2_USE_WCHAR + depends on BR2_STATIC_LIBS || !BR2_ENABLE_LOCALE || \ + !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS || \ + !BR2_TOOLCHAIN_GCC_AT_LEAST_7 From patchwork Wed Jul 21 21:45:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 1508471 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=dwdTuss+; dkim-atps=neutral Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GVTf3213fz9sS8 for ; Thu, 22 Jul 2021 07:45:31 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 457C040323; Wed, 21 Jul 2021 21:45:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YNTlI-L2IEft; Wed, 21 Jul 2021 21:45:27 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 7270E4030C; Wed, 21 Jul 2021 21:45:26 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 380BD1C1187 for ; Wed, 21 Jul 2021 21:45:25 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 349334010D for ; Wed, 21 Jul 2021 21:45:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp2.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vVF8UtsmDoj6 for ; Wed, 21 Jul 2021 21:45:23 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by smtp2.osuosl.org (Postfix) with ESMTPS id 3AC2B400F3 for ; Wed, 21 Jul 2021 21:45:23 +0000 (UTC) Received: by mail-pl1-x636.google.com with SMTP id o8so2124148plg.11 for ; Wed, 21 Jul 2021 14:45:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YsJYlmmID2RMZfG/IFk7OruXBN1Id6uepmM2CCKu2ls=; b=dwdTuss+jAouJPOtm9L41ypCMV4opZvn8vFYo+r8e4cyxHynNr+9pfn6hKVWBacReW 6BsBbhB2E6nZRv0DVIXkaWugX5n40RuWrjULIqIDzOILaO2TqhrvpyMfUkumIWcHPJ91 l5XwBMTVMDV57uIaiirhI8dFAtufOtjcwuMVA9pagYvnHi8cq6YpzDkJHQtE4uMVGC25 mBMLhfDCpn4GnPHeX5gGPeN79uh9cC2Fb3TR8piZKwSIC/OMLnJwqgy6y8adeOYn9kQ/ WgLcUyHA2Go+NtUCMtoo5pzRH1MraO5aPoPAEGtJxV3FMtad1YsfPHbTvidI0zzwe+Lh cWdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YsJYlmmID2RMZfG/IFk7OruXBN1Id6uepmM2CCKu2ls=; b=IYRC/ztHWi4uxxcomHxiUQu/AfyHBv0hbxMduBkV1rFMm7kvWmNZFggFpJvSI291ao mvar+meSwg55k7/3Jzhbt1vT62/e4B/PqoK1iQW7fItZFnH9qjISbrXQr1Q5B0oHdoBJ T21ILqCqhYGdVnLDlPLtzHk//KoCIsW93CYEYWurmEIlF0Wbz4doSU1AOfbmw6Scf/7f 80EO/NvXiRnb0yNQ14bDqJspxNzWj4EQeVLwgemKsfmp8PhlbO1RStOSYB90np7UJzE3 Br/mjNRTpJvlYFMVg7Ln1jZqGD1hKAPW4WZBcUlK5uncQIi3+kP89riTwaMb1/pLGfUh rTtw== X-Gm-Message-State: AOAM532KYETeGQg5QN5GsBurQ+gwYpcuorc9LlUx0G+g0dRpZyeGRSHc HNaE2iaVa3be+zA+EWQDSPbW7TiLmB4= X-Google-Smtp-Source: ABdhPJz81VvkSfaDzuNEcjLJda1iXlSYll/ZvJamYEfvGOJo6TdZWoyVUrXSRd/o+jaSTDc6Yx5EOA== X-Received: by 2002:a17:903:2451:b029:12b:3feb:a3ce with SMTP id l17-20020a1709032451b029012b3feba3cemr29178703pls.83.1626903922490; Wed, 21 Jul 2021 14:45:22 -0700 (PDT) Received: from adam.duskett ([47.149.13.137]) by smtp.gmail.com with ESMTPSA id t37sm28266330pfg.14.2021.07.21.14.45.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jul 2021 14:45:22 -0700 (PDT) From: Adam Duskett To: buildroot@buildroot.org Date: Wed, 21 Jul 2021 14:45:16 -0700 Message-Id: <20210721214518.227254-2-aduskett@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210721214518.227254-1-aduskett@gmail.com> References: <20210721214518.227254-1-aduskett@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2 2/4] package/polkit/S50polkit: new file X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marek Belisko , "Yann E . MORIN" , Thomas Petazzoni , Giulio Benetti , Norbert Lange , Adam Duskett , Maxime Hadjinlian Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" The Polkit source does not come with non-systemd init script. Add one that is modeled after package/busybox/S01syslogd. Signed-off-by: Adam Duskett --- package/polkit/S50polkit | 51 ++++++++++++++++++++++++++++++++++++++++ package/polkit/polkit.mk | 5 ++++ 2 files changed, 56 insertions(+) create mode 100755 package/polkit/S50polkit diff --git a/package/polkit/S50polkit b/package/polkit/S50polkit new file mode 100755 index 0000000000..38cb463b8a --- /dev/null +++ b/package/polkit/S50polkit @@ -0,0 +1,51 @@ +#!/bin/sh + +DAEMON="polkitd" +DAEMON_PATH="/usr/lib/polkit-1/${DAEMON}" +PIDFILE="/var/run/${DAEMON}.pid" +POLKITD_ARGS="--no-debug" + +# polkitd does not create a pidfile, so pass "-n" in the command line +# and use "-m" to instruct start-stop-daemon to create one. +start() { + printf 'Starting %s: ' "${DAEMON}" + # shellcheck disable=SC2086 # we need the word splitting + start-stop-daemon -bmSqp "$PIDFILE" -x ${DAEMON_PATH} -- ${POLKITD_ARGS} + status=$? + if [ "$status" -eq 0 ]; then + echo "OK" + else + echo "FAIL" + fi + return "$status" +} + +stop() { + printf 'Stopping %s: ' "${DAEMON}" + start-stop-daemon -Kqp "$PIDFILE" + status=$? + if [ "$status" -eq 0 ]; then + rm -f "$PIDFILE" + echo "OK" + else + echo "FAIL" + fi + return "$status" +} + +restart() { + stop + sleep 1 + start +} + +case "$1" in + start|stop|restart|reload) + "$1";; + reload) + # Restart, since there is no true "reload" feature. + restart;; + *) + echo "Usage: $0 {start|stop|restart|reload}" + exit 1 +esac diff --git a/package/polkit/polkit.mk b/package/polkit/polkit.mk index f48c103a52..d5b3955ddb 100644 --- a/package/polkit/polkit.mk +++ b/package/polkit/polkit.mk @@ -57,4 +57,9 @@ define POLKIT_INSTALL_INIT_SYSTEMD endef +define POLKIT_INSTALL_INIT_SYSV + $(INSTALL) -D -m 0755 package/polkit/S50polkit \ + $(TARGET_DIR)/etc/init.d/S50polkit +endef + $(eval $(autotools-package)) From patchwork Wed Jul 21 21:45:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 1508472 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=i8DbBvUI; dkim-atps=neutral Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GVTfJ0Xt1z9sS8 for ; Thu, 22 Jul 2021 07:45:44 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 8B8FE605A2; Wed, 21 Jul 2021 21:45:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Mk3jEfc2gXSX; Wed, 21 Jul 2021 21:45:40 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id 77B3E605D2; Wed, 21 Jul 2021 21:45:39 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id CCF181C1187 for ; Wed, 21 Jul 2021 21:45:25 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id C9B6E605D2 for ; Wed, 21 Jul 2021 21:45:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9yPPA6dWg2DN for ; Wed, 21 Jul 2021 21:45:24 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by smtp3.osuosl.org (Postfix) with ESMTPS id 9EAFB605A2 for ; Wed, 21 Jul 2021 21:45:24 +0000 (UTC) Received: by mail-pj1-x102c.google.com with SMTP id p4-20020a17090a9304b029016f3020d867so2615076pjo.3 for ; Wed, 21 Jul 2021 14:45:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sndVMwlq5okpwhEjDDR05hsJ4bmO9zOgwddpj4geWPs=; b=i8DbBvUIfjWskj986gr6glkeFQU4PF8d28RpTc1dLVum5EQjVYKADR8dpfU1S7EXcr VklTAPPbhFyuZl5v6+qDumzBJmDSiZUyJva3wMQ2kKLEKeGq45n9gCMGETGTCduIjF0I ZxDgDZoARdNSePtj0m1/OwgMgFwUodP0f5G1tH3sAsSbGsxrQ24ey44DmRijCLJd98I1 LFPsyb8T4q9MlWi3P2U3ZoKLCWf9O4GPWAvpkLtEZNIlIloR5fioMu1LGRmSHRTBAHma zaXOKAMOEK9LXVDurNBNksIO+eSudmFaPb10bC3LLl2mb8FyncTWOWRhZKjdlK+RP9z0 mVcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=sndVMwlq5okpwhEjDDR05hsJ4bmO9zOgwddpj4geWPs=; b=opdgIHtaYyyveZK9lNwAT+YRqm8f+LM8I3cIJbCbvRbp2vMnUkXJS65DeryKUHr55q 6/4umRhua/9v8V4HVzigZDjRMFtPVq2ER22wP/PMY4HvvVXe03XJVHfT60JRPIpEEZEg ZHGF+k3QKQuUW76w2QwfmeMHgV4GwOwo0DpAyqeuhXgA+ZB567PBfP499VSJY4LDREjR /IsH6akuuUFMvb1b9QVry4FSj4cPQXaQCSdTZfT5y35mvW/3XThbnV9PBHCLJSnXFlb+ 8vWDYlZtLjh731JmWK13qUtkmHt5Zz3jB0pRMseiww+qDqHggnKninLYvln7jPHxzMBU j2aQ== X-Gm-Message-State: AOAM533bWE833Wa83Nmig8RjxdCFfFybBmnJNsh5Yu5+DeZIgIQDlcc8 AfmzQ9Fuc7z4CJOQDlyWqGn9IQYdv94= X-Google-Smtp-Source: ABdhPJxSumitUxEIaP6athkc6cBIjAcwRxVy4e3CYb5BldlIaUozoWxuRO4tKfLFcL2ZjzNCf8Mn2Q== X-Received: by 2002:a17:90a:f0d4:: with SMTP id fa20mr5902649pjb.22.1626903923917; Wed, 21 Jul 2021 14:45:23 -0700 (PDT) Received: from adam.duskett ([47.149.13.137]) by smtp.gmail.com with ESMTPSA id t37sm28266330pfg.14.2021.07.21.14.45.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jul 2021 14:45:23 -0700 (PDT) From: Adam Duskett To: buildroot@buildroot.org Date: Wed, 21 Jul 2021 14:45:17 -0700 Message-Id: <20210721214518.227254-3-aduskett@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210721214518.227254-1-aduskett@gmail.com> References: <20210721214518.227254-1-aduskett@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2 3/4] support/testing: add polkit tests X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marek Belisko , "Yann E . MORIN" , Thomas Petazzoni , Giulio Benetti , Norbert Lange , Adam Duskett , Maxime Hadjinlian Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This test script tests polkit with and without systemd. The Systemd test does the following: - The brtest user attempts to restart the systemd-timesyncd service and is denied. - A systemd-timesyncd-restart.rules file provided by polkit-rules-test is copied from /root/ to /etc/polkit-1/rules.d - The brtest user attempts to restart the systemd-timesyncd service and should now succeed. The initd test does the following: - The brtest user attempts to run the test application "hello-polkit" with the command "pkexec hello-polkit" and is denied. - A hello-polkit.rules file provided by polkit-rules-test is copied from /root/ to /etc/polkit-1/rules.d - The brtest user attempts to re-run the test hello-polkit binary with "pkexec hello-polkit" and succeeds. Signed-off-by: Adam Duskett --- .../package/br2-external/polkit/Config.in | 1 + .../package/br2-external/polkit/external.desc | 1 + .../package/br2-external/polkit/external.mk | 1 + .../package/polkit-rules-test/Config.in | 6 ++ .../polkit-rules-test/initd/hello-polkit.c | 6 ++ .../initd/hello-polkit.policy | 14 ++++ .../initd/hello-polkit.rules | 6 ++ .../polkit-rules-test/polkit-rules-test.mk | 38 ++++++++++ .../systemd/systemd-timesyncd-restart.rules | 7 ++ support/testing/tests/package/test_polkit.py | 70 +++++++++++++++++++ 10 files changed, 150 insertions(+) create mode 100644 support/testing/tests/package/br2-external/polkit/Config.in create mode 100644 support/testing/tests/package/br2-external/polkit/external.desc create mode 100644 support/testing/tests/package/br2-external/polkit/external.mk create mode 100644 support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/Config.in create mode 100644 support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/initd/hello-polkit.c create mode 100644 support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/initd/hello-polkit.policy create mode 100644 support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/initd/hello-polkit.rules create mode 100644 support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/polkit-rules-test.mk create mode 100644 support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/systemd/systemd-timesyncd-restart.rules create mode 100644 support/testing/tests/package/test_polkit.py diff --git a/support/testing/tests/package/br2-external/polkit/Config.in b/support/testing/tests/package/br2-external/polkit/Config.in new file mode 100644 index 0000000000..2d11756193 --- /dev/null +++ b/support/testing/tests/package/br2-external/polkit/Config.in @@ -0,0 +1 @@ +source "$BR2_EXTERNAL_POLKIT_PATH/package/polkit-rules-test/Config.in" diff --git a/support/testing/tests/package/br2-external/polkit/external.desc b/support/testing/tests/package/br2-external/polkit/external.desc new file mode 100644 index 0000000000..ecef48692b --- /dev/null +++ b/support/testing/tests/package/br2-external/polkit/external.desc @@ -0,0 +1 @@ +name: POLKIT diff --git a/support/testing/tests/package/br2-external/polkit/external.mk b/support/testing/tests/package/br2-external/polkit/external.mk new file mode 100644 index 0000000000..64e369cce4 --- /dev/null +++ b/support/testing/tests/package/br2-external/polkit/external.mk @@ -0,0 +1 @@ +include $(sort $(wildcard $(BR2_EXTERNAL_POLKIT_PATH)/package/*/*.mk)) diff --git a/support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/Config.in b/support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/Config.in new file mode 100644 index 0000000000..0fe125ec8f --- /dev/null +++ b/support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/Config.in @@ -0,0 +1,6 @@ +config BR2_PACKAGE_POLKIT_RULES_TEST + bool "polkit rules test" + depends on BR2_PACKAGE_POLKIT + help + Simple test to ensure polkit is loading and enforcing rules + correctly. diff --git a/support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/initd/hello-polkit.c b/support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/initd/hello-polkit.c new file mode 100644 index 0000000000..cf5343cd75 --- /dev/null +++ b/support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/initd/hello-polkit.c @@ -0,0 +1,6 @@ +#include + +int main(void){ + printf("Hello polkit!\n"); + return 0; +} diff --git a/support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/initd/hello-polkit.policy b/support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/initd/hello-polkit.policy new file mode 100644 index 0000000000..8220293175 --- /dev/null +++ b/support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/initd/hello-polkit.policy @@ -0,0 +1,14 @@ + + + + + Authentication is required to run the hello world test program + + no + no + + /usr/bin/hello-polkit + + diff --git a/support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/initd/hello-polkit.rules b/support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/initd/hello-polkit.rules new file mode 100644 index 0000000000..a0a66f644d --- /dev/null +++ b/support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/initd/hello-polkit.rules @@ -0,0 +1,6 @@ +polkit.addRule(function(action, subject) { + if (action.id == "org.freedesktop.policykit.pkexec.hello-polkit" && + subject.user == "brtest") { + return polkit.Result.YES; + } +}); diff --git a/support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/polkit-rules-test.mk b/support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/polkit-rules-test.mk new file mode 100644 index 0000000000..4ec3805ee3 --- /dev/null +++ b/support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/polkit-rules-test.mk @@ -0,0 +1,38 @@ +################################################################################ +# +# polkit-rules-test +# +################################################################################ + +POLKIT_RULES_TEST_DEPENDENCIES = polkit + +define POLKIT_RULES_TEST_USERS + brtest -1 brtest -1 =password /home/brtest /bin/sh brtest +endef + +define POLKIT_RULES_TEST_BUILD_CMDS + $(INSTALL) -D $(POLKIT_RULES_TEST_PKGDIR)/initd/hello-polkit.c $(@D)/hello-polkit.c + $(TARGET_CC) $(@D)/hello-polkit.c -o $(@D)/hello-polkit +endef + +# Install the rules file to /root. Test_polkit.py first tests that restarting +# timesyncd as a user fails, then moves the rules file and confirmes restarting +# timesyncd as a user succeeds. +define POLKIT_RULES_TEST_INSTALL_INIT_SYSTEMD + mkdir -p $(TARGET_DIR)/etc/polkit-1/rules.d + $(INSTALL) -D $(POLKIT_RULES_TEST_PKGDIR)/systemd/systemd-timesyncd-restart.rules \ + $(TARGET_DIR)/root/systemd-timesyncd-restart.rules +endef + +define POLKIT_RULES_TEST_INSTALL_INIT_SYSV + mkdir -p $(TARGET_DIR)/usr/share/polkit-1/actions/ + $(INSTALL) -D $(@D)/hello-polkit $(TARGET_DIR)/usr/bin/hello-polkit + + $(INSTALL) -D $(POLKIT_RULES_TEST_PKGDIR)/initd/hello-polkit.policy \ + $(TARGET_DIR)/usr/share/polkit-1/actions/hello-polkit.policy + + $(INSTALL) -D $(POLKIT_RULES_TEST_PKGDIR)/initd/hello-polkit.rules \ + $(TARGET_DIR)/root/hello-polkit.rules +endef + +$(eval $(generic-package)) diff --git a/support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/systemd/systemd-timesyncd-restart.rules b/support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/systemd/systemd-timesyncd-restart.rules new file mode 100644 index 0000000000..9461195091 --- /dev/null +++ b/support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/systemd/systemd-timesyncd-restart.rules @@ -0,0 +1,7 @@ +polkit.addRule(function(action, subject) { + if (action.id == "org.freedesktop.systemd1.manage-units" && + action.lookup("unit") == "systemd-timesyncd.service" && + subject.user == "brtest") { + return polkit.Result.YES; + } +}); diff --git a/support/testing/tests/package/test_polkit.py b/support/testing/tests/package/test_polkit.py new file mode 100644 index 0000000000..502d38d13e --- /dev/null +++ b/support/testing/tests/package/test_polkit.py @@ -0,0 +1,70 @@ +import os +import infra.basetest + + +class TestPolkitInfra(infra.basetest.BRTest): + br2_external = [infra.filepath("tests/package/br2-external/polkit")] + config = \ + """ + BR2_arm=y + BR2_cortex_a9=y + BR2_ARM_ENABLE_VFP=y + BR2_TOOLCHAIN_EXTERNAL=y + BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y + BR2_TARGET_ROOTFS_CPIO=y + BR2_PACKAGE_POLKIT=y + BR2_PACKAGE_POLKIT_RULES_TEST=y + """ + + def base_test_run(self): + cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio") + self.emulator.boot(arch="armv7", kernel="builtin", + options=["-initrd", cpio_file]) + self.emulator.login() + + +class TestPolkitSystemd(TestPolkitInfra): + config = \ + """ + {} + BR2_INIT_SYSTEMD=y + BR2_PACKAGE_SYSTEMD_POLKIT=y + BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0" + # BR2_TARGET_ROOTFS_TAR is not set + """.format(TestPolkitInfra.config) + + def test_run(self): + TestPolkitInfra.base_test_run(self) + + cmd = "su brtest -c '/bin/systemctl restart systemd-timesyncd.service'" + _, exit_code = self.emulator.run(cmd, 10) + self.assertEqual(exit_code, 1) + + cmd = "mv /root/systemd-timesyncd-restart.rules /etc/polkit-1/rules.d" + _, exit_code = self.emulator.run(cmd, 10) + self.assertEqual(exit_code, 0) + + cmd = "su brtest -c '/bin/systemctl restart systemd-timesyncd.service'" + _, exit_code = self.emulator.run(cmd, 10) + self.assertEqual(exit_code, 0) + + +class TestPolkitInitd(TestPolkitInfra): + config = TestPolkitInfra.config + + def test_run(self): + TestPolkitInfra.base_test_run(self) + + cmd = "su brtest -c 'pkexec hello-polkit'" + output, exit_code = self.emulator.run(cmd, 10) + self.assertEqual(exit_code, 127) + self.assertEqual(output[0], "Error executing command as another user: Not authorized") + + cmd = "mv /root/hello-polkit.rules /etc/polkit-1/rules.d/hello-polkit.rules" + _, exit_code = self.emulator.run(cmd, 10) + self.assertEqual(exit_code, 0) + + cmd = "su brtest -c 'pkexec hello-polkit'" + output, exit_code = self.emulator.run(cmd, 10) + self.assertEqual(exit_code, 0) + self.assertEqual(output[0], "Hello polkit!") From patchwork Wed Jul 21 21:45:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 1508475 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=smtp3.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=NVu8Zpb7; dkim-atps=neutral Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GVTg61Gcmz9sS8 for ; Thu, 22 Jul 2021 07:46:26 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 7322C605D2; Wed, 21 Jul 2021 21:46:24 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id G34DfR3keU8x; Wed, 21 Jul 2021 21:46:21 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id 0F7A1605FC; Wed, 21 Jul 2021 21:46:21 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 2C4EA1C1187 for ; Wed, 21 Jul 2021 21:45:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 1BA4E82BA1 for ; Wed, 21 Jul 2021 21:45:29 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp1.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hQ-fVAvlK26L for ; Wed, 21 Jul 2021 21:45:26 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by smtp1.osuosl.org (Postfix) with ESMTPS id 6B6F182B93 for ; Wed, 21 Jul 2021 21:45:26 +0000 (UTC) Received: by mail-pj1-x102d.google.com with SMTP id gx2so3266169pjb.5 for ; Wed, 21 Jul 2021 14:45:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7YZY9HNXJ0vPVXSs7V6qHiWFNHnbdQtGsMZYwqX1fmM=; b=NVu8Zpb7WgXbt1oXMsAZDevJU996IeG2oJ7zSDF4pfgllShbPe7CzTupwJoUUFgjLG ywg+gsXsh2cOhE6jFCfuzITavvY9ZYALpCR4FjXvanpHaHE9N2D8Qtfdyt2VMFpr2GGZ HHcPhaiLUVIf5ENvxLgqypkndB8gyFaJHobs6CgE+vQPFoKDoM306Zn8U/NBzc1k9ORT oiUjfKTq0qo96j5o7KxA7tcciTJ0WDOdqGrFzs7Ii8Q1/X0Nm1sYK7U+SUQPg59U0SD3 LKKcrInIJvWAsbS45TGM/mSfrDHGoq+0l79gUcXRNMTjQ7IqzWs/zmaXPPQSmUV9M7C8 N4Ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7YZY9HNXJ0vPVXSs7V6qHiWFNHnbdQtGsMZYwqX1fmM=; b=Ryp+qE84gpcCiSHm8fXzsBfzA2qtzGDS8Sz01R+DlnPke+HQqrwPVx1XykmOAQF6/l v5DuN6VOI/HehRkkrydoGRd6/xZMb2kqTARWmB8AaGBSms68OnE33nzo8X7A4jATqvx1 nUWqv5KYE9rMYDvGzAXLg98pK419ZDhKQj3d/8eMJQKm84umlQFrr4UVn5o/lxRw/oYg HTG6lpJuUBngL3EupflFpRzsskWRn/VKyJevdX8Vu9TH9FAP06DBrJbkENHlCTttLA3l EE3QO+Vm2/HCHLeBcO7ARhNCEDVWjHAFz989JSdqMsam+6aj8Q7I26VzTKq1lxGkmU5k Sldg== X-Gm-Message-State: AOAM533/Y2q+LjOcZZu79LGTbcIa0xz5TIB7sF6aA0jJrJAgRG7wreOh lGKf1Mov9eNNvnyOfNyeNGKNTTPjPGo= X-Google-Smtp-Source: ABdhPJy+d603+JrfeKvmx0KT6gfUFtd+7oN7uvHgm56YOjwtFrSCFpRDyNHhC2O+W8zEjxUQcRZT0Q== X-Received: by 2002:a17:90b:374d:: with SMTP id ne13mr38473630pjb.124.1626903925239; Wed, 21 Jul 2021 14:45:25 -0700 (PDT) Received: from adam.duskett ([47.149.13.137]) by smtp.gmail.com with ESMTPSA id t37sm28266330pfg.14.2021.07.21.14.45.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jul 2021 14:45:24 -0700 (PDT) From: Adam Duskett To: buildroot@buildroot.org Date: Wed, 21 Jul 2021 14:45:18 -0700 Message-Id: <20210721214518.227254-4-aduskett@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210721214518.227254-1-aduskett@gmail.com> References: <20210721214518.227254-1-aduskett@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2 4/4] package/spidermonkey: drop package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marek Belisko , "Yann E . MORIN" , Thomas Petazzoni , Giulio Benetti , Norbert Lange , Adam Duskett , Maxime Hadjinlian Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Now that Spidermonkey is no longer required to build the polkit package, and no other packages require Spidermonkey, and python2 is required to build the package, it is safe to drop the package. Signed-off-by: Adam Duskett --- Config.in.legacy | 9 ++ package/Config.in | 1 - .../0001-allow-newer-autoconf-versions.patch | 61 -------- .../0002-allow-building-in-tree.patch | 47 ------ ...-allow-unknown-configuration-options.patch | 35 ----- .../0004-fix-building-with-musl.patch | 133 ---------------- .../spidermonkey/0005-add-riscv-support.patch | 121 --------------- ...ers-on-install-instead-of-symlinking.patch | 34 ----- ...ng-on-64-bit-and-32-bit-be-platforms.patch | 144 ------------------ ...-on-ARM64-for-generated-unboxed-obje.patch | 66 -------- ...-clobbering-it-in-the-regex-compiler.patch | 100 ------------ ...lent-year-to-determine-the-time-zone.patch | 103 ------------- ....in-install-shell-only-if-it-s-built.patch | 28 ---- package/spidermonkey/Config.in | 60 -------- package/spidermonkey/spidermonkey.hash | 3 - package/spidermonkey/spidermonkey.mk | 64 -------- 16 files changed, 9 insertions(+), 1000 deletions(-) delete mode 100644 package/spidermonkey/0001-allow-newer-autoconf-versions.patch delete mode 100644 package/spidermonkey/0002-allow-building-in-tree.patch delete mode 100644 package/spidermonkey/0003-allow-unknown-configuration-options.patch delete mode 100644 package/spidermonkey/0004-fix-building-with-musl.patch delete mode 100644 package/spidermonkey/0005-add-riscv-support.patch delete mode 100644 package/spidermonkey/0006-copy-headers-on-install-instead-of-symlinking.patch delete mode 100644 package/spidermonkey/0007-ensure-proper-running-on-64-bit-and-32-bit-be-platforms.patch delete mode 100644 package/spidermonkey/0008-save-and-restore-non-volatile-x28-on-ARM64-for-generated-unboxed-obje.patch delete mode 100644 package/spidermonkey/0009-save-x28-before-clobbering-it-in-the-regex-compiler.patch delete mode 100644 package/spidermonkey/0010-always-use-the-equivalent-year-to-determine-the-time-zone.patch delete mode 100644 package/spidermonkey/0011-js-src-Makefile.in-install-shell-only-if-it-s-built.patch delete mode 100644 package/spidermonkey/Config.in delete mode 100644 package/spidermonkey/spidermonkey.hash delete mode 100644 package/spidermonkey/spidermonkey.mk diff --git a/Config.in.legacy b/Config.in.legacy index 1beaa664d7..fb2255f6bb 100644 --- a/Config.in.legacy +++ b/Config.in.legacy @@ -154,6 +154,15 @@ config BR2_PACKAGE_KODI_LIBVA the kodi-specific dependencies limiting libva support to non- OPENGLES platforms were removed including this option. +config BR2_PACKAGE_SPIDERMONKEY + bool "The spidermonkey package has been removed" + select BR2_LEGACY + help + The spidermonkey package was removed. The only package that + depended on spidermonkey was polkit. The spidermonkey + dependency is replaced with duktape, which saves 24~MB of + space on the target and 2.7G~ on the host. + config BR2_PACKAGE_PHP_EXT_XMLRPC bool "PHP XMLRPC extension removed" select BR2_LEGACY diff --git a/package/Config.in b/package/Config.in index d49aff3de4..3c0d4653ac 100644 --- a/package/Config.in +++ b/package/Config.in @@ -1638,7 +1638,6 @@ endif source "package/jszip/Config.in" source "package/openlayers/Config.in" source "package/popperjs/Config.in" - source "package/spidermonkey/Config.in" source "package/vuejs/Config.in" endmenu diff --git a/package/spidermonkey/0001-allow-newer-autoconf-versions.patch b/package/spidermonkey/0001-allow-newer-autoconf-versions.patch deleted file mode 100644 index 61becb68f3..0000000000 --- a/package/spidermonkey/0001-allow-newer-autoconf-versions.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 646a78262b18e19721cd41ee515215221dd241b6 Mon Sep 17 00:00:00 2001 -From: Hongxu Jia -Date: Thu, 12 Jul 2018 18:12:42 +0800 -Subject: [PATCH] allow newer autoconf versions - -Spidermonkey is hardcoded to use Autoconf 2.13, which is from 1999! -The reasoning behind using 2.13 is because newer versions of Autoconf at the -time did not work correctly with the custom m4 macros in the source code. -However: Because we are building just the spidermonkey engine instead of the -entire firefox package, and we are using a tarball with a pre-setup -old-configure file, there is no need for the old version of autoconf. - -See: https://bugzilla.mozilla.org/show_bug.cgi?id=104642 - -Upstream-Status: Inappropriate [embedded specific] - -Signed-off-by: Hongxu Jia -Signed-off-by: Adam Duskett ---- - build/moz.configure/old.configure | 4 ++-- - js/src/old-configure | 2 +- - 2 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/build/moz.configure/old.configure b/build/moz.configure/old.configure -index 17d0c5bf..436fcc5e 100644 ---- a/build/moz.configure/old.configure -+++ b/build/moz.configure/old.configure -@@ -33,7 +33,7 @@ def autoconf(mozconfig, autoconf): - autoconf = autoconf[0] if autoconf else None - - for ac in (mozconfig_autoconf, autoconf, 'autoconf-2.13', 'autoconf2.13', -- 'autoconf213'): -+ 'autoconf213', 'autoconf'): - if ac: - autoconf = find_program(ac) - if autoconf: -@@ -87,7 +87,7 @@ def prepare_configure(old_configure, mozconfig, autoconf, build_env, shell, - old_configure = os.path.join(old_configure_dir, 'js', 'src', - os.path.basename(old_configure)) - -- refresh = True -+ refresh = False - if exists(old_configure): - mtime = getmtime(old_configure) - aclocal = os.path.join(build_env.topsrcdir, 'build', 'autoconf', -diff --git a/js/src/old-configure b/js/src/old-configure -index 58cc646f..ebd2646e 100644 ---- a/js/src/old-configure -+++ b/js/src/old-configure -@@ -587,7 +587,7 @@ if test -z "$srcdir"; then - ac_prog=$0 - ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` - test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. -- srcdir=$ac_confdir -+ srcdir="$ac_confdir/../../" - if test ! -r $srcdir/$ac_unique_file; then - srcdir=.. - fi --- -2.23.0 - diff --git a/package/spidermonkey/0002-allow-building-in-tree.patch b/package/spidermonkey/0002-allow-building-in-tree.patch deleted file mode 100644 index 533747cb41..0000000000 --- a/package/spidermonkey/0002-allow-building-in-tree.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 07d40f72e1ed1d84a5ddd98ae8490d41a2e19c46 Mon Sep 17 00:00:00 2001 -From: Arjan van de Ven -Date: Wed, 5 Sep 2018 11:39:01 +0000 -Subject: [PATCH] allow building in tree - -By default, spidermonkey must be configured and built out-of-tree, -otherwise the following error occurs: - -FATAL ERROR PROCESSING MOZBUILD FILE -============================== - -The error occurred while processing the following file or one of the files it -includes: - js/src/shell/moz.build - -The error occurred when validating the result of the execution. The reported -error is: - Path specified in LOCAL_INCLUDES is not allowed: - .. (resolved to js/src) - -Remove this check, as spidermonkey builds without issue in-tree. - -Signed-off-by: Arjan van de Ven -Signed-off-by: Adam Duskett ---- - python/mozbuild/mozbuild/frontend/emitter.py | 5 ----- - 1 file changed, 5 deletions(-) - -diff --git a/python/mozbuild/mozbuild/frontend/emitter.py b/python/mozbuild/mozbuild/frontend/emitter.py -index 642b381c..c37fbf5d 100644 ---- a/python/mozbuild/mozbuild/frontend/emitter.py -+++ b/python/mozbuild/mozbuild/frontend/emitter.py -@@ -1127,11 +1127,6 @@ class TreeMetadataEmitter(LoggingMixin): - raise SandboxValidationError('Path specified in LOCAL_INCLUDES ' - 'does not exist: %s (resolved to %s)' % (local_include, - full_path), context) -- if (full_path == context.config.topsrcdir or -- full_path == context.config.topobjdir): -- raise SandboxValidationError('Path specified in LOCAL_INCLUDES ' -- 'is not allowed: %s (resolved to %s)' % (local_include, -- full_path), context) - include_obj = LocalInclude(context, local_include) - local_includes.append(include_obj.path.full_path) - yield include_obj --- -2.23.0 - diff --git a/package/spidermonkey/0003-allow-unknown-configuration-options.patch b/package/spidermonkey/0003-allow-unknown-configuration-options.patch deleted file mode 100644 index b489075a94..0000000000 --- a/package/spidermonkey/0003-allow-unknown-configuration-options.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 4a06a1a6a71293decb83aee7adb74bc709493106 Mon Sep 17 00:00:00 2001 -From: Philip Chimento -Date: Wed, 5 Jul 2017 22:57:09 -0700 -Subject: [PATCH] allow unknown configuration options - -By default, if an unknown parameter is passed to configure, an error is raised. -Replace the raise with a pass and continue. - -Fixes: https://bugzilla.mozilla.org/show_bug.cgi?id=1379540 - -Signed-off-by: Philip Chimento -Signed-off-by: Adam Duskett ---- - js/src/configure | 9 +++++++++ - python/mozbuild/mozbuild/configure/__init__.py | 2 +- - python/mozbuild/mozbuild/configure/options.py | 6 +++++- - 3 files changed, 15 insertions(+), 2 deletions(-) - create mode 100755 js/src/configure - -diff --git a/python/mozbuild/mozbuild/configure/__init__.py b/python/mozbuild/mozbuild/configure/__init__.py -index 0fe640ca..09b460d3 100644 ---- a/python/mozbuild/mozbuild/configure/__init__.py -+++ b/python/mozbuild/mozbuild/configure/__init__.py -@@ -421,7 +421,7 @@ def run(self, path=None): - # All options should have been removed (handled) by now. - for arg in self._helper: - without_value = arg.split('=', 1)[0] -- raise InvalidOptionError('Unknown option: %s' % without_value) -+ pass - - # Run the execution queue - for func, args in self._execution_queue: --- -2.23.0 - diff --git a/package/spidermonkey/0004-fix-building-with-musl.patch b/package/spidermonkey/0004-fix-building-with-musl.patch deleted file mode 100644 index 8d8b10fb71..0000000000 --- a/package/spidermonkey/0004-fix-building-with-musl.patch +++ /dev/null @@ -1,133 +0,0 @@ -From 0c9e8f586ba52a9aef5ed298e8315b2598b8fb72 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Sat, 25 May 2019 16:54:45 -0700 -Subject: [PATCH] fix building with musl - -The MIPS specific header is not provided by musl -linux kernel headers provide which has same definitions - -Upstream-Status: Pending - -Signed-off-by: Khem Raj -Signed-off-by: Adam Duskett ---- ---- - js/src/jsmath.cpp | 2 +- - memory/build/Mutex.h | 4 ++-- - mozglue/misc/TimeStamp_darwin.cpp | 1 - - mozglue/misc/TimeStamp_posix.cpp | 1 - - nsprpub/pr/src/misc/prsystem.c | 1 - - third_party/python/psutil/psutil/_psutil_bsd.c | 1 - - third_party/python/psutil/psutil/_psutil_osx.c | 1 - - third_party/python/psutil/psutil/arch/osx/process_info.c | 1 - - 8 files changed, 3 insertions(+), 9 deletions(-) - -diff --git a/js/src/jsmath.cpp b/js/src/jsmath.cpp -index a28968be..8facaa81 100644 ---- a/js/src/jsmath.cpp -+++ b/js/src/jsmath.cpp -@@ -71,7 +71,7 @@ - #elif defined(__s390__) - #define GETRANDOM_NR 349 - #elif defined(__mips__) --#include -+#include - #if _MIPS_SIM == _MIPS_SIM_ABI32 - #define GETRANDOM_NR 4353 - #elif _MIPS_SIM == _MIPS_SIM_ABI64 -diff --git a/memory/build/Mutex.h b/memory/build/Mutex.h -index cb8b1e7d..7b9eb1de 100644 ---- a/memory/build/Mutex.h -+++ b/memory/build/Mutex.h -@@ -42,7 +42,7 @@ struct Mutex { - if (pthread_mutexattr_init(&attr) != 0) { - return false; - } -- pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ADAPTIVE_NP); -+ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_STALLED); - if (pthread_mutex_init(&mMutex, &attr) != 0) { - pthread_mutexattr_destroy(&attr); - return false; -@@ -102,7 +102,7 @@ typedef Mutex StaticMutex; - - #if defined(XP_DARWIN) - #define STATIC_MUTEX_INIT OS_SPINLOCK_INIT --#elif defined(XP_LINUX) && !defined(ANDROID) -+#elif defined(XP_LINUX) && !defined(ANDROID) && defined(__GLIBC__) - #define STATIC_MUTEX_INIT PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP - #else - #define STATIC_MUTEX_INIT PTHREAD_MUTEX_INITIALIZER -diff --git a/mozglue/misc/TimeStamp_darwin.cpp b/mozglue/misc/TimeStamp_darwin.cpp -index d2abe9a5..d065649c 100644 ---- a/mozglue/misc/TimeStamp_darwin.cpp -+++ b/mozglue/misc/TimeStamp_darwin.cpp -@@ -19,7 +19,6 @@ - - #include - #include --#include - #include - #include - -diff --git a/mozglue/misc/TimeStamp_posix.cpp b/mozglue/misc/TimeStamp_posix.cpp -index 86c7609a..a37bd93a 100644 ---- a/mozglue/misc/TimeStamp_posix.cpp -+++ b/mozglue/misc/TimeStamp_posix.cpp -@@ -21,7 +21,6 @@ - #if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || \ - defined(__OpenBSD__) - #include --#include - #endif - - #if defined(__DragonFly__) || defined(__FreeBSD__) -diff --git a/nsprpub/pr/src/misc/prsystem.c b/nsprpub/pr/src/misc/prsystem.c -index eba85fb0..54b57bb9 100644 ---- a/nsprpub/pr/src/misc/prsystem.c -+++ b/nsprpub/pr/src/misc/prsystem.c -@@ -27,7 +27,6 @@ - || defined(OPENBSD) || defined(DRAGONFLY) || defined(DARWIN) - #define _PR_HAVE_SYSCTL - #include --#include - #endif - - #if defined(DARWIN) -diff --git a/third_party/python/psutil/psutil/_psutil_bsd.c b/third_party/python/psutil/psutil/_psutil_bsd.c -index 9a2ed04b..9e0d34cb 100644 ---- a/third_party/python/psutil/psutil/_psutil_bsd.c -+++ b/third_party/python/psutil/psutil/_psutil_bsd.c -@@ -29,7 +29,6 @@ - #include - #include - #include --#include - #include - #include - #include -diff --git a/third_party/python/psutil/psutil/_psutil_osx.c b/third_party/python/psutil/psutil/_psutil_osx.c -index 55dd64ca..ec356339 100644 ---- a/third_party/python/psutil/psutil/_psutil_osx.c -+++ b/third_party/python/psutil/psutil/_psutil_osx.c -@@ -13,7 +13,6 @@ - #include - #include - #include --#include - #include - #include - #include -diff --git a/third_party/python/psutil/psutil/arch/osx/process_info.c b/third_party/python/psutil/psutil/arch/osx/process_info.c -index 40c79a2c..8de0dcbd 100644 ---- a/third_party/python/psutil/psutil/arch/osx/process_info.c -+++ b/third_party/python/psutil/psutil/arch/osx/process_info.c -@@ -16,7 +16,6 @@ - #include - #include - #include --#include - #include - - #include "process_info.h" --- -2.23.0 diff --git a/package/spidermonkey/0005-add-riscv-support.patch b/package/spidermonkey/0005-add-riscv-support.patch deleted file mode 100644 index 6b7ea3265f..0000000000 --- a/package/spidermonkey/0005-add-riscv-support.patch +++ /dev/null @@ -1,121 +0,0 @@ -From 64ad80e6d95871f17be4cd01da15581f41ac0b2b Mon Sep 17 00:00:00 2001 -From: Stefan O'Rear -Date: Fri, 11 Nov 2016 21:10:34 -0700 -Subject: [PATCH] Add RISC-V support - -These changes allow spidermonkey to cross-compile for riscv64 and riscv32. - -Upstream-status: Submitted -See: https://bugzilla.mozilla.org/show_bug.cgi?id=1318905 - -Signed-off-by: Stefan O'Rear -Signed-off-by: Ricardo Salveti -Signed-off-by: Adam Duskett ---- - build/autoconf/config.guess | 3 +++ - build/moz.configure/init.configure | 3 +++ - js/src/jit/AtomicOperations.h | 2 ++ - js/src/jit/none/AtomicOperations-feeling-lucky.h | 8 ++++++++ - mfbt/tests/TestPoisonArea.cpp | 3 +++ - python/mozbuild/mozbuild/configure/constants.py | 4 ++++ - 6 files changed, 23 insertions(+) - -diff --git a/build/autoconf/config.guess b/build/autoconf/config.guess -index d5d667d4..1277a862 100755 ---- a/build/autoconf/config.guess -+++ b/build/autoconf/config.guess -@@ -1029,6 +1029,9 @@ EOF - ppcle:Linux:*:*) - echo powerpcle-unknown-linux-${LIBC} - exit ;; -+ riscv32:Linux:*:* | riscv64:Linux:*:*) -+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} -+ exit ;; - s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux-${LIBC} - exit ;; -diff --git a/build/moz.configure/init.configure b/build/moz.configure/init.configure -index 83b8d705..ef33db50 100644 ---- a/build/moz.configure/init.configure -+++ b/build/moz.configure/init.configure -@@ -676,6 +676,9 @@ def split_triplet(triplet, allow_unknown=False): - elif cpu == 'sh4': - canonical_cpu = 'sh4' - endianness = 'little' -+ elif cpu in ('riscv32', 'riscv64'): -+ canonical_cpu = cpu -+ endianness = 'little' - elif allow_unknown: - canonical_cpu = cpu - endianness = 'unknown' -diff --git a/js/src/jit/AtomicOperations.h b/js/src/jit/AtomicOperations.h -index 3501e65b..fda0b148 100644 ---- a/js/src/jit/AtomicOperations.h -+++ b/js/src/jit/AtomicOperations.h -@@ -393,6 +393,8 @@ inline bool AtomicOperations::isLockfreeJS(int32_t size) { - #include "jit/none/AtomicOperations-feeling-lucky.h" - #elif defined(__s390__) || defined(__s390x__) - #include "jit/none/AtomicOperations-feeling-lucky.h" -+#elif defined(__riscv) -+#include "jit/none/AtomicOperations-feeling-lucky.h" - #else - #error "No AtomicOperations support provided for this platform" - #endif -diff --git a/js/src/jit/none/AtomicOperations-feeling-lucky.h b/js/src/jit/none/AtomicOperations-feeling-lucky.h -index c0b43699..42b1f3e0 100644 ---- a/js/src/jit/none/AtomicOperations-feeling-lucky.h -+++ b/js/src/jit/none/AtomicOperations-feeling-lucky.h -@@ -80,6 +80,14 @@ - #define GNUC_COMPATIBLE - #endif - -+#ifdef __riscv -+#define GNUC_COMPATIBLE -+#ifdef __riscv_xlen == 64 -+#define HAS_64BIT_ATOMICS -+#define HAS_64BIT_LOCKFREE -+#endif -+#endif -+ - // The default implementation tactic for gcc/clang is to use the newer - // __atomic intrinsics added for use in C++11 . Where that - // isn't available, we use GCC's older __sync functions instead. -diff --git a/mfbt/tests/TestPoisonArea.cpp b/mfbt/tests/TestPoisonArea.cpp -index 06c24ed0..fba9263c 100644 ---- a/mfbt/tests/TestPoisonArea.cpp -+++ b/mfbt/tests/TestPoisonArea.cpp -@@ -168,6 +168,9 @@ static const ia64_instr _return_instr = - #define RETURN_INSTR _return_instr - #define RETURN_INSTR_TYPE ia64_instr - -+#elif defined __riscv -+#define RETURN_INSTR 0x80828082 /* ret; ret */ -+ - #else - #error "Need return instruction for this architecture" - #endif -diff --git a/python/mozbuild/mozbuild/configure/constants.py b/python/mozbuild/mozbuild/configure/constants.py -index 33ae5a45..1067b6a4 100644 ---- a/python/mozbuild/mozbuild/configure/constants.py -+++ b/python/mozbuild/mozbuild/configure/constants.py -@@ -50,6 +50,8 @@ CPU_bitness = { - 'mips64': 64, - 'ppc': 32, - 'ppc64': 64, -+ 'riscv32': 32, -+ 'riscv64': 64, - 's390': 32, - 's390x': 64, - 'sh4': 32, -@@ -82,6 +84,8 @@ CPU_preprocessor_checks = OrderedDict(( - ('s390', '__s390__'), - ('ppc64', '__powerpc64__'), - ('ppc', '__powerpc__'), -+ ('riscv32', '__riscv && __SIZEOF_POINTER__ == 4'), -+ ('riscv64', '__riscv && __SIZEOF_POINTER__ == 8'), - ('Alpha', '__alpha__'), - ('hppa', '__hppa__'), - ('sparc64', '__sparc__ && __arch64__'), --- -2.23.0 - diff --git a/package/spidermonkey/0006-copy-headers-on-install-instead-of-symlinking.patch b/package/spidermonkey/0006-copy-headers-on-install-instead-of-symlinking.patch deleted file mode 100644 index 10ca54c702..0000000000 --- a/package/spidermonkey/0006-copy-headers-on-install-instead-of-symlinking.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 903a79a1efff18fc7cc50db09a3fe5d768adc9a8 Mon 19 Mar 2018 09:58:06 +0100 -From: Rico Tzschichholz -Date: Wed, 5 Jul 2017 22:45:59 -0700 -Subject: build: Copy headers on install instead of symlinking - -Patch ported from mozjs52 by Philip Chimento - -Signed-off-by: Rico Tzschichholz -Signed-off-by: Adam Duskett ---- - python/mozbuild/mozbuild/backend/recursivemake.py | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/python/mozbuild/mozbuild/backend/recursivemake.py b/python/mozbuild/mozbuild/backend/recursivemake.py -index dd9020d..6918ef8 100644 ---- a/python/mozbuild/mozbuild/backend/recursivemake.py -+++ b/python/mozbuild/mozbuild/backend/recursivemake.py -@@ -1427,11 +1427,11 @@ class RecursiveMakeBackend(CommonBackend): - raise Exception("Wildcards are only supported in the filename part of " - "srcdir-relative or absolute paths.") - -- install_manifest.add_pattern_link(basepath, wild, path) -+ install_manifest.add_pattern_copy(basepath, wild, path) - else: -- install_manifest.add_pattern_link(f.srcdir, f, path) -+ install_manifest.add_pattern_copy(f.srcdir, f, path) - else: -- install_manifest.add_link(f.full_path, dest) -+ install_manifest.add_copy(f.full_path, dest) - else: - install_manifest.add_optional_exists(dest) - backend_file.write('%s_FILES += %s\n' % ( --- -2.23.0 diff --git a/package/spidermonkey/0007-ensure-proper-running-on-64-bit-and-32-bit-be-platforms.patch b/package/spidermonkey/0007-ensure-proper-running-on-64-bit-and-32-bit-be-platforms.patch deleted file mode 100644 index 9ffd69380a..0000000000 --- a/package/spidermonkey/0007-ensure-proper-running-on-64-bit-and-32-bit-be-platforms.patch +++ /dev/null @@ -1,144 +0,0 @@ -From f66d410f3ba767efb91c6b9545d373267cd975f2 Mon Sep 17 00:00:00 2001 -From: Philip Chimento -Date: Sat, 7 Sep 2019 20:43:40 +0200 -Subject: [PATCH] ensure proper running on 64-bit and 32-bit BE platforms - -See: https://salsa.debian.org/gnome-team/mozjs60/blob/debian/master/debian/patches/jsproperty-endian.patch - -Signed-off-by: Philip Chimento -Signed-off-by: Adam Duskett ---- - js/src/gc/Marking-inl.h | 16 ++++++++++++++++ - js/src/gc/RelocationOverlay.h | 13 ++++++++++++- - js/src/jsfriendapi.h | 8 ++++++++ - js/src/vm/StringType.h | 13 +++++++++++++ - 4 files changed, 49 insertions(+), 1 deletion(-) - -diff --git a/js/src/gc/Marking-inl.h b/js/src/gc/Marking-inl.h -index 6d2a4c7..c773c21 100644 ---- a/js/src/gc/Marking-inl.h -+++ b/js/src/gc/Marking-inl.h -@@ -82,12 +82,28 @@ inline void RelocationOverlay::forwardTo(Cell* cell) { - MOZ_ASSERT(!isForwarded()); - // The location of magic_ is important because it must never be valid to see - // the value Relocated there in a GC thing that has not been moved. -+#if MOZ_LITTLE_ENDIAN || JS_BITS_PER_WORD == 32 -+ // On 32-bit, the magic_ aliases with whatever comes after the first -+ // pointer; on little-endian 64-bit, the magic_ aliases with the -+ // 32 most significant bits of the pointer, which are the second half. - static_assert(offsetof(RelocationOverlay, magic_) == - offsetof(JSObject, group_) + sizeof(uint32_t), - "RelocationOverlay::magic_ is in the wrong location"); - static_assert(offsetof(RelocationOverlay, magic_) == - offsetof(js::Shape, base_) + sizeof(uint32_t), - "RelocationOverlay::magic_ is in the wrong location"); -+#elif JS_BITS_PER_WORD == 64 -+ // On big-endian 64-bit, the magic_ aliases with the 32 most -+ // significant bits of the pointer, but now that's the first half. -+ static_assert(offsetof(RelocationOverlay, magic_) == -+ offsetof(JSObject, group_), -+ "RelocationOverlay::magic_ is in the wrong location"); -+ static_assert(offsetof(RelocationOverlay, magic_) == -+ offsetof(js::Shape, base_), -+ "RelocationOverlay::magic_ is in the wrong location"); -+#else -+# error "Unknown endianness or word size" -+#endif - static_assert( - offsetof(RelocationOverlay, magic_) == offsetof(JSString, d.u1.length), - "RelocationOverlay::magic_ is in the wrong location"); -diff --git a/js/src/gc/RelocationOverlay.h b/js/src/gc/RelocationOverlay.h -index a568843..399a541 100644 ---- a/js/src/gc/RelocationOverlay.h -+++ b/js/src/gc/RelocationOverlay.h -@@ -33,14 +33,25 @@ class RelocationOverlay { - /* See comment in js/public/HeapAPI.h. */ - static const uint32_t Relocated = js::gc::Relocated; - -+#if MOZ_LITTLE_ENDIAN || JS_BITS_PER_WORD == 32 - /* -- * Keep the low 32 bits untouched. Use them to distinguish strings from -+ * Keep the first 32 bits untouched. Use them to distinguish strings from - * objects in the nursery. - */ - uint32_t preserve_; - - /* Set to Relocated when moved. */ - uint32_t magic_; -+#elif JS_BITS_PER_WORD == 64 -+ /* -+ * On big-endian, we need to reorder to keep preserve_ lined up with the -+ * low 32 bits of the aligned group_ pointer in JSObject. -+ */ -+ uint32_t magic_; -+ uint32_t preserve_; -+#else -+# error "Unknown endianness or word size" -+#endif - - /* The location |this| was moved to. */ - Cell* newLocation_; -diff --git a/js/src/jsfriendapi.h b/js/src/jsfriendapi.h -index 4b8d18a..70ce0a1 100644 ---- a/js/src/jsfriendapi.h -+++ b/js/src/jsfriendapi.h -@@ -9,6 +9,7 @@ - - #include "mozilla/Atomics.h" - #include "mozilla/Casting.h" -+#include "mozilla/EndianUtils.h" - #include "mozilla/Maybe.h" - #include "mozilla/MemoryReporting.h" - #include "mozilla/UniquePtr.h" -@@ -609,8 +610,15 @@ struct String { - static const uint32_t LATIN1_CHARS_BIT = JS_BIT(6); - static const uint32_t EXTERNAL_FLAGS = LINEAR_BIT | NON_ATOM_BIT | JS_BIT(5); - static const uint32_t TYPE_FLAGS_MASK = JS_BIT(6) - 1; -+#if MOZ_LITTLE_ENDIAN || JS_BITS_PER_WORD == 32 - uint32_t flags; - uint32_t length; -+#elif JS_BITS_PER_WORD == 64 -+ uint32_t length; -+ uint32_t flags; -+#else -+# error "Unknown endianness or word size" -+#endif - union { - const JS::Latin1Char* nonInlineCharsLatin1; - const char16_t* nonInlineCharsTwoByte; -diff --git a/js/src/vm/StringType.h b/js/src/vm/StringType.h -index cde3427..c3400db 100644 ---- a/js/src/vm/StringType.h -+++ b/js/src/vm/StringType.h -@@ -7,6 +7,7 @@ - #ifndef vm_StringType_h - #define vm_StringType_h - -+#include "mozilla/EndianUtils.h" - #include "mozilla/MemoryReporting.h" - #include "mozilla/PodOperations.h" - #include "mozilla/Range.h" -@@ -168,8 +169,20 @@ class JSString : public js::gc::Cell { - struct Data { - union { - struct { -+#if MOZ_LITTLE_ENDIAN || JS_BITS_PER_WORD == 32 - uint32_t flags; /* JSString */ - uint32_t length; /* JSString */ -+#elif JS_BITS_PER_WORD == 64 -+ /* -+ * On big-endian, we need to reorder to keep flags lined up -+ * with the low 32 bits of the aligned group_ pointer in -+ * JSObject. -+ */ -+ uint32_t length; /* JSString */ -+ uint32_t flags; /* JSString */ -+#else -+# error "Unknown endianness or word size" -+#endif - }; - uintptr_t flattenData; /* JSRope (temporary while flattening) */ - } u1; --- -2.23.0 - diff --git a/package/spidermonkey/0008-save-and-restore-non-volatile-x28-on-ARM64-for-generated-unboxed-obje.patch b/package/spidermonkey/0008-save-and-restore-non-volatile-x28-on-ARM64-for-generated-unboxed-obje.patch deleted file mode 100644 index 9fd4340ffe..0000000000 --- a/package/spidermonkey/0008-save-and-restore-non-volatile-x28-on-ARM64-for-generated-unboxed-obje.patch +++ /dev/null @@ -1,66 +0,0 @@ -From 903a79a1efff18fc7cc50db09a3fe5d768adc9a8 Mon 19 Mar 2018 09:58:06 +0100 -From: Lars T Hansen -Date: Fri, 23 Mar 2018 22:01:33 +0000 -Subject: [PATCH] save and restore non-volatile x28 on ARM64 for generated unboxed object constructor - -Fixes: https://bugzilla.mozilla.org/show_bug.cgi?id=1375074 - -Upsream-status: Applied -See: https://hg.mozilla.org/mozilla-central/rev/800abe66894d - -Signed-off-by: Lars T Hansen -Signed-off-by: Adam Duskett ---- - js/src/vm/UnboxedObject.cpp | 30 ++++++++++++++++++++++++++---- - 1 file changed, 26 insertions(+), 4 deletions(-) - -diff --git a/js/src/vm/UnboxedObject.cpp b/js/src/vm/UnboxedObject.cpp -index 35ca20d7405f..1c20a1093d13 100644 ---- a/js/src/vm/UnboxedObject.cpp -+++ b/js/src/vm/UnboxedObject.cpp -@@ -86,9 +86,16 @@ static const uintptr_t CLEAR_CONSTRUCTOR_CODE_TOKEN = 0x1; - #endif - - #ifdef JS_CODEGEN_ARM64 -- // ARM64 communicates stack address via sp, but uses a pseudo-sp for -- // addressing. -- masm.initStackPtr(); -+ // ARM64 communicates stack address via sp, but uses a pseudo-sp (PSP) for -+ // addressing. The register we use for PSP may however also be used by -+ // calling code, and it is nonvolatile, so save it. Do this as a special -+ // case first because the generic save/restore code needs the PSP to be -+ // initialized already. -+ MOZ_ASSERT(PseudoStackPointer64.Is(masm.GetStackPointer64())); -+ masm.Str(PseudoStackPointer64, vixl::MemOperand(sp, -16, vixl::PreIndex)); -+ -+ // Initialize the PSP from the SP. -+ masm.initStackPtr(); - #endif - - MOZ_ASSERT(propertiesReg.volatile_()); -@@ -239,7 +246,22 @@ static const uintptr_t CLEAR_CONSTRUCTOR_CODE_TOKEN = 0x1; - if (ScratchDoubleReg.volatile_()) masm.pop(ScratchDoubleReg); - masm.PopRegsInMask(savedNonVolatileRegisters); - -- masm.abiret(); -+#ifdef JS_CODEGEN_ARM64 -+ // Now restore the value that was in the PSP register on entry, and return. -+ -+ // Obtain the correct SP from the PSP. -+ masm.Mov(sp, PseudoStackPointer64); -+ -+ // Restore the saved value of the PSP register, this value is whatever the -+ // caller had saved in it, not any actual SP value, and it must not be -+ // overwritten subsequently. -+ masm.Ldr(PseudoStackPointer64, vixl::MemOperand(sp, 16, vixl::PostIndex)); -+ -+ // Perform a plain Ret(), as abiret() will move SP <- PSP and that is wrong. -+ masm.Ret(vixl::lr); -+#else -+ masm.abiret(); -+#endif - - masm.bind(&failureStoreOther); - --- -2.23.0 diff --git a/package/spidermonkey/0009-save-x28-before-clobbering-it-in-the-regex-compiler.patch b/package/spidermonkey/0009-save-x28-before-clobbering-it-in-the-regex-compiler.patch deleted file mode 100644 index b4623c5961..0000000000 --- a/package/spidermonkey/0009-save-x28-before-clobbering-it-in-the-regex-compiler.patch +++ /dev/null @@ -1,100 +0,0 @@ -From 903a79a1efff18fc7cc50db09a3fe5d768adc9a8 Mon 19 Mar 2018 09:58:06 +0100 -From: Lars T Hansen -Date: Fri, 23 Mar 2018 22:01:33 +0000 -Subject: [PATCH] save x28 before clobbering it in the regex compiler - -Fixes: https://bugzilla.mozilla.org/show_bug.cgi?id=1445907 - -Upsream-status: Applied -See: https://hg.mozilla.org/mozilla-central/rev/903a79a1efff - -Signed-off-by: Lars T Hansen -Signed-off-by: Adam Duskett ---- -diff --git a/js/src/irregexp/NativeRegExpMacroAssembler.cpp b/js/src/irregexp/NativeRegExpMacroAssembler.cpp ---- a/js/src/irregexp/NativeRegExpMacroAssembler.cpp -+++ b/js/src/irregexp/NativeRegExpMacroAssembler.cpp -@@ -118,17 +118,25 @@ NativeRegExpMacroAssembler::GenerateCode - - Label return_temp0; - - // Finalize code - write the entry point code now we know how many - // registers we need. - masm.bind(&entry_label_); - - #ifdef JS_CODEGEN_ARM64 -- // ARM64 communicates stack address via sp, but uses a pseudo-sp for addressing. -+ // ARM64 communicates stack address via SP, but uses a pseudo-sp (PSP) for -+ // addressing. The register we use for PSP may however also be used by -+ // calling code, and it is nonvolatile, so save it. Do this as a special -+ // case first because the generic save/restore code needs the PSP to be -+ // initialized already. -+ MOZ_ASSERT(PseudoStackPointer64.Is(masm.GetStackPointer64())); -+ masm.Str(PseudoStackPointer64, vixl::MemOperand(sp, -16, vixl::PreIndex)); -+ -+ // Initialize the PSP from the SP. - masm.initStackPtr(); - #endif - - // Push non-volatile registers which might be modified by jitcode. - size_t pushedNonVolatileRegisters = 0; - for (GeneralRegisterForwardIterator iter(savedNonVolatileRegisters); iter.more(); ++iter) { - masm.Push(*iter); - pushedNonVolatileRegisters++; -@@ -416,17 +424,32 @@ NativeRegExpMacroAssembler::GenerateCode - masm.pop(temp0); - masm.movePtr(temp0, StackPointer); - #endif - - // Restore non-volatile registers which were saved on entry. - for (GeneralRegisterBackwardIterator iter(savedNonVolatileRegisters); iter.more(); ++iter) - masm.Pop(*iter); - -+#ifdef JS_CODEGEN_ARM64 -+ // Now restore the value that was in the PSP register on entry, and return. -+ -+ // Obtain the correct SP from the PSP. -+ masm.Mov(sp, PseudoStackPointer64); -+ -+ // Restore the saved value of the PSP register, this value is whatever the -+ // caller had saved in it, not any actual SP value, and it must not be -+ // overwritten subsequently. -+ masm.Ldr(PseudoStackPointer64, vixl::MemOperand(sp, 16, vixl::PostIndex)); -+ -+ // Perform a plain Ret(), as abiret() will move SP <- PSP and that is wrong. -+ masm.Ret(vixl::lr); -+#else - masm.abiret(); -+#endif - - // Backtrack code (branch target for conditional backtracks). - if (backtrack_label_.used()) { - masm.bind(&backtrack_label_); - Backtrack(); - } - - // Backtrack stack overflow code. -diff --git a/js/src/jit-test/tests/regexp/bug1445907.js b/js/src/jit-test/tests/regexp/bug1445907.js -new file mode 100644 ---- /dev/null -+++ b/js/src/jit-test/tests/regexp/bug1445907.js -@@ -0,0 +1,15 @@ -+// On ARM64, we failed to save x28 properly when generating code for the regexp -+// matcher. -+// -+// There's wasm and Debugger code here because the combination forces the use of -+// x28 and exposes the bug when running on the simulator. -+ -+if (!wasmIsSupported()) -+ quit(); -+ -+var g = newGlobal(''); -+var dbg = new Debugger(g); -+g.eval(`var m = new WebAssembly.Instance(new WebAssembly.Module(wasmTextToBinary('(module (func (export "test")))')))`); -+var re = /./; -+dbg.onEnterFrame = function(frame) { re.exec("x") }; -+result = g.eval("m.exports.test()"); - --- -2.23.0 - diff --git a/package/spidermonkey/0010-always-use-the-equivalent-year-to-determine-the-time-zone.patch b/package/spidermonkey/0010-always-use-the-equivalent-year-to-determine-the-time-zone.patch deleted file mode 100644 index 7ebe80a8a0..0000000000 --- a/package/spidermonkey/0010-always-use-the-equivalent-year-to-determine-the-time-zone.patch +++ /dev/null @@ -1,103 +0,0 @@ -From 903a79a1efff18fc7cc50db09a3fe5d768adc9a8 Mon 19 Mar 2018 09:58:06 +0100 -From: André Bargull -Date: Wed, 8 Nov 2017 03:23:41 -0800 -Subject: always use the equivalent year to determine the time zone offset and - name - -Fixes: https://bugzilla.mozilla.org/show_bug.cgi?id=1415202 - -Upsream-status: Applied -See: https://hg.mozilla.org/mozilla-central/rev/ce9f1466ec78 - -Reviewed-by: Jeff Walden -Signed-off-by: André Bargull -Signed-off-by: Adam Duskett ---- - js/src/jsdate.cpp | 11 +++++++---- - js/src/vm/Time.cpp | 14 ++++---------- - js/src/vm/Time.h | 2 +- - 3 files changed, 12 insertions(+), 15 deletions(-) - -diff --git a/js/src/jsdate.cpp b/js/src/jsdate.cpp -index 07af3d18c865..ff8fd6c3763c 100644 ---- a/js/src/jsdate.cpp -+++ b/js/src/jsdate.cpp -@@ -2353,12 +2353,15 @@ static PRMJTime ToPRMJTime(double localTime, double utcTime) { - static size_t FormatTime(char* buf, int buflen, const char* fmt, double utcTime, - double localTime) { - PRMJTime prtm = ToPRMJTime(localTime, utcTime); -- int eqivalentYear = IsRepresentableAsTime32(utcTime) -- ? prtm.tm_year -- : EquivalentYearForDST(prtm.tm_year); -+ // If an equivalent year was used to compute the date/time components, use -+ // the same equivalent year to determine the time zone name and offset in -+ // PRMJ_FormatTime(...). -+ int timeZoneYear = IsRepresentableAsTime32(utcTime) -+ ? prtm.tm_year -+ : EquivalentYearForDST(prtm.tm_year); - int offsetInSeconds = (int)floor((localTime - utcTime) / msPerSecond); - -- return PRMJ_FormatTime(buf, buflen, fmt, &prtm, eqivalentYear, -+ return PRMJ_FormatTime(buf, buflen, fmt, &prtm, timeZoneYear, - offsetInSeconds); - } - -diff --git a/js/src/vm/Time.cpp b/js/src/vm/Time.cpp -index f59977f0d0e9..5ee4794b3e83 100644 ---- a/js/src/vm/Time.cpp -+++ b/js/src/vm/Time.cpp -@@ -247,7 +247,7 @@ static void PRMJ_InvalidParameterHandler(const wchar_t* expression, - - /* Format a time value into a buffer. Same semantics as strftime() */ - size_t PRMJ_FormatTime(char* buf, int buflen, const char* fmt, -- const PRMJTime* prtm, int equivalentYear, -+ const PRMJTime* prtm, int timeZoneYear, - int offsetInSeconds) { - size_t result = 0; - #if defined(XP_UNIX) || defined(XP_WIN) -@@ -280,7 +280,8 @@ size_t PRMJ_FormatTime(char* buf, int buflen, const char* fmt, - * Fill out |td| to the time represented by |prtm|, leaving the - * timezone fields zeroed out. localtime_r will then fill in the - * timezone fields for that local time according to the system's -- * timezone parameters. -+ * timezone parameters. Use |timeZoneYear| for the year to ensure the -+ * time zone name matches the time zone offset used by the caller. - */ - struct tm td; - memset(&td, 0, sizeof(td)); -@@ -290,19 +291,12 @@ size_t PRMJ_FormatTime(char* buf, int buflen, const char* fmt, - td.tm_mday = prtm->tm_mday; - td.tm_mon = prtm->tm_mon; - td.tm_wday = prtm->tm_wday; -- td.tm_year = prtm->tm_year - 1900; -+ td.tm_year = timeZoneYear - 1900; - td.tm_yday = prtm->tm_yday; - td.tm_isdst = prtm->tm_isdst; - - time_t t = mktime(&td); - -- // If |prtm| cannot be represented in |time_t| the year is probably -- // out of range, try again with the DST equivalent year. -- if (t == static_cast(-1)) { -- td.tm_year = equivalentYear - 1900; -- t = mktime(&td); -- } -- - // If either mktime or localtime_r failed, fill in the fallback time - // zone offset |offsetInSeconds| and set the time zone identifier to - // the empty string. -diff --git a/js/src/vm/Time.h b/js/src/vm/Time.h -index 3a51d869c922..37b7faeec028 100644 ---- a/js/src/vm/Time.h -+++ b/js/src/vm/Time.h -@@ -49,7 +49,7 @@ inline void PRMJ_NowShutdown() {} - - /* Format a time value into a buffer. Same semantics as strftime() */ - extern size_t PRMJ_FormatTime(char* buf, int buflen, const char* fmt, -- const PRMJTime* tm, int equivalentYear, -+ const PRMJTime* tm, int timeZoneYear, - int offsetInSeconds); - - /** --- -2.23.0 diff --git a/package/spidermonkey/0011-js-src-Makefile.in-install-shell-only-if-it-s-built.patch b/package/spidermonkey/0011-js-src-Makefile.in-install-shell-only-if-it-s-built.patch deleted file mode 100644 index f6092af7ef..0000000000 --- a/package/spidermonkey/0011-js-src-Makefile.in-install-shell-only-if-it-s-built.patch +++ /dev/null @@ -1,28 +0,0 @@ -From b5e4a9926cf50d12e9c5c05c6d1b161e5b662d62 Mon Sep 17 00:00:00 2001 -From: Carlos Santos -Date: Sat, 7 Mar 2020 23:42:02 -0300 -Subject: [PATCH] js/src/Makefile.in: install shell only if it's built - -Prevents an installation error if we configure with --disable-js-shell. - -Signed-off-by: Carlos Santos ---- - js/src/Makefile.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/js/src/Makefile.in b/js/src/Makefile.in -index 4ac9f48..9c8fb64 100644 ---- a/js/src/Makefile.in -+++ b/js/src/Makefile.in -@@ -136,7 +136,7 @@ endif - - install:: - $(MAKE) -C build install -- $(MAKE) -C shell install -+ if [ -d shell ]; then $(MAKE) -C shell install; fi - - ifdef HAVE_DTRACE - javascript-trace.h: $(srcdir)/devtools/javascript-trace.d --- -2.18.2 - diff --git a/package/spidermonkey/Config.in b/package/spidermonkey/Config.in deleted file mode 100644 index e015e84ad2..0000000000 --- a/package/spidermonkey/Config.in +++ /dev/null @@ -1,60 +0,0 @@ -config BR2_PACKAGE_SPIDERMONKEY_ARCH_SUPPORTS - bool - default y if BR2_aarch64 - default y if BR2_arm || BR2_armeb - default y if BR2_i386 || BR2_x86_64 - default y if BR2_mips || BR2_mipsel || BR2_mips64 || BR2_mips64el - default y if BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le - default y if BR2_riscv - default y if BR2_sh4 || BR2_sh4a - default y if BR2_sparc || BR2_sparc64 - depends on BR2_PACKAGE_LIBNSPR_ARCH_SUPPORT # libnspr - -config BR2_PACKAGE_SPIDERMONKEY_JIT_ARCH_SUPPORTS - bool - default y if BR2_aarch64 || BR2_arm || BR2_armeb || BR2_i386 || BR2_x86_64 - -config BR2_PACKAGE_SPIDERMONKEY - bool "spidermonkey" - depends on BR2_HOST_GCC_AT_LEAST_4_9 - depends on BR2_INSTALL_LIBSTDCPP - depends on BR2_PACKAGE_SPIDERMONKEY_ARCH_SUPPORTS - depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 - depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL # needs pthread_getattr_np() - depends on BR2_USE_MMU # fork in executable tools. - depends on BR2_USE_WCHAR - depends on !BR2_TOOLCHAIN_USES_UCLIBC # No way to check for fenv support. - depends on !BR2_STATIC_LIBS # dlopen - select BR2_PACKAGE_HOST_PYTHON - select BR2_PACKAGE_HOST_PYTHON_SSL - select BR2_PACKAGE_LIBNSPR - select BR2_PACKAGE_ZLIB - help - SpiderMonkey is the code-name for Mozilla Firefox's C++ - implementation of JavaScript. It is intended to be embedded in - other applications that provide host environments for - JavaScript. - - https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey - -if BR2_PACKAGE_SPIDERMONKEY - -config BR2_PACKAGE_SPIDERMONKEY_JS_SHELL - bool "JS shell" - help - Build the JavaScript shell. - - WARNING: increases target image size by around 24 MiB. - -endif - -comment "spidermonkey needs a glibc or musl toolchain with C++, wchar, dynamic library, NPTL, gcc >= 4.9" - depends on BR2_USE_MMU - depends on BR2_PACKAGE_SPIDERMONKEY_ARCH_SUPPORTS - depends on BR2_TOOLCHAIN_USES_UCLIBC || \ - !BR2_INSTALL_LIBSTDCPP || \ - BR2_STATIC_LIBS || \ - !BR2_TOOLCHAIN_HAS_THREADS_NPTL || \ - !BR2_HOST_GCC_AT_LEAST_4_9 || \ - !BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 || \ - !BR2_USE_WCHAR diff --git a/package/spidermonkey/spidermonkey.hash b/package/spidermonkey/spidermonkey.hash deleted file mode 100644 index ccb0265861..0000000000 --- a/package/spidermonkey/spidermonkey.hash +++ /dev/null @@ -1,3 +0,0 @@ -# Locally computed -sha256 f51039c997415fd0f13f8e01966b4a8ff80cbf90deb8b14c18827104a369cc0d mozjs-60.5.2.tar.bz2 -sha256 aaac93a33bec26d5d1a9c5efc1e7dc6bd215d8a4f1e1a7fc5315a67adfd51338 moz.configure diff --git a/package/spidermonkey/spidermonkey.mk b/package/spidermonkey/spidermonkey.mk deleted file mode 100644 index 50afdc1758..0000000000 --- a/package/spidermonkey/spidermonkey.mk +++ /dev/null @@ -1,64 +0,0 @@ -################################################################################ -# -# spidermonkey -# -################################################################################ - -# Use a tarball with only the spidermonkey source code and a pre-setup -# old-configure in src/js.This prevents having to use autoconf 2.13 and -# makes the package much 31M instead of 257M -SPIDERMONKEY_VERSION = 60.5.2 -SPIDERMONKEY_SOURCE = mozjs-$(SPIDERMONKEY_VERSION).tar.bz2 -SPIDERMONKEY_SITE = https://gentoo.osuosl.org/distfiles/9a -SPIDERMONKEY_SUBDIR = js/src -SPIDERMONKEY_LICENSE = MPL-2.0 -SPIDERMONKEY_LICENSE_FILES = moz.configure -SPIDERMONKEY_INSTALL_STAGING = YES - -SPIDERMONKEY_DEPENDENCIES = \ - host-python \ - libnspr \ - zlib - -SPIDERMONKEY_CONF_ENV = \ - PYTHON="$(HOST_DIR)/bin/python2" - -# spidermonkey mixes up target and host. -# spidermonkey does not allow building against a system jemalloc, -# as it causes a conflict with glibc. -SPIDERMONKEY_CONF_OPTS = \ - --host=$(GNU_HOST_NAME) \ - --target=$(GNU_TARGET_NAME) \ - --disable-jemalloc \ - --enable-shared-js \ - --with-system-zlib \ - --with-system-nspr \ - --with-nspr-exec-prefix="$(STAGING_DIR)/usr" - -ifeq ($(BR2_PACKAGE_SPIDERMONKEY_JIT_ARCH_SUPPORTS),y) -SPIDERMONKEY_CONF_OPTS += --enable-ion -else -SPIDERMONKEY_CONF_OPTS += --disable-ion -endif - -ifeq ($(BR2_PACKAGE_SPIDERMONKEY_JS_SHELL),y) -SPIDERMONKEY_CONF_OPTS += --enable-js-shell -else -SPIDERMONKEY_CONF_OPTS += --disable-js-shell -endif - -ifeq ($(BR2_PACKAGE_READLINE),y) -SPIDERMONKEY_CONF_OPTS += --enable-readline -SPIDERMONKEY_DEPENDENCIES += readline -else -SPIDERMONKEY_CONF_OPTS += --disable-readline -endif - -# Remove unneeded files -define SPIDERMONKEY_CLEANUP - rm -rf $(TARGET_DIR)/usr/lib/libjs_static.ajs - rm -rf $(TARGET_DIR)/usr/bin/js60-config -endef -SPIDERMONKEY_POST_INSTALL_TARGET_HOOKS += SPIDERMONKEY_CLEANUP - -$(eval $(autotools-package))