From patchwork Mon Jul 5 05:40:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 1500568 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::138; helo=smtp1.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=C23kWzjD; dkim-atps=neutral Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (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 4GJF1453sBz9sX1 for ; Mon, 5 Jul 2021 15:41:28 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id AA79883753; Mon, 5 Jul 2021 05:41:21 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org 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 HpzTvO0ZZ5rL; Mon, 5 Jul 2021 05:41:21 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id 2036F835BA; Mon, 5 Jul 2021 05:41:20 +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 245321BF46A for ; Mon, 5 Jul 2021 05:41:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 13B00835BA for ; Mon, 5 Jul 2021 05:41:06 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org 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 Im637n8DmoWp for ; Mon, 5 Jul 2021 05:41:05 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by smtp1.osuosl.org (Postfix) with ESMTPS id 155C0835B9 for ; Mon, 5 Jul 2021 05:41:04 +0000 (UTC) Received: by mail-pf1-x431.google.com with SMTP id f17so4216468pfj.8 for ; Sun, 04 Jul 2021 22:41:04 -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=8ab2Tg+KoVum6+LEAREqTcD7Eh5hl9phNtFDKR4qesU=; b=C23kWzjDbwD7SzyDIFKbhvVxaxYporYfQf7espMMbKB9ubA7Oo3hkyIzl/RTYzsaL5 KJWtpO3yjqjK+sCi8X60D95tCDZCcdiW/UdyRDiwAYXqgmPqJLXzPOJ0kvmPFp8FpoWJ i9kEG8ksqgFXbfUTXCZZWtt+b8zeJXeD7HMuvQVR+ARB2oaRInn6GfVqZoWkWMusnzUH T+6CWk/YE9hbHqpUVsz3lM6Jk2xhTnod/HCAcQK9js5NQSXAxH9tByeGbBdO04IyZ0aW j9n2We41QkfiM7kOzb9ckAeWBT9I971t3rBVuiEXvIAbQSdOabDdL6SV3Djf4q9ZiRdO fGTg== 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=8ab2Tg+KoVum6+LEAREqTcD7Eh5hl9phNtFDKR4qesU=; b=NMPn/MNea8adSjLN1ICQnBMMuhEEI6v+44ydCcS3Oj3IHF6V+58lYpI2lbBhdicEPU t5RgiOuchc7VfiOoxJzP6a4BnYVynySoUI8Q+vdSvpmJ/C2U5A3omSDQHQFzmGmp0C01 o1X7Wd6tfUoddFMWNsvwOXWigPfCs8BlPNsk9i1L2f8AB5xFnkBJ6roBnbzeGEtgczEW 7gIF0Z6QjbquDzfYr54abNgMViycVqxg2P61ySUYC/RAXSEIyhiABGJm1xRNVZXetSIl Lx8EK/yLLDDLkFxpUDdrbfYlrUvKPOAodPW37Ax9sHRS1NgkFwLmVhZm0HGYrVw7D603 1rYA== X-Gm-Message-State: AOAM531MtcZJL+BzfRajDp6hn+jYf8T/BZV+/rl3+Xp5ztO8htUt+D7O qp5yjjRXqXwhF0eodqlvEuofT3olum5NoQ== X-Google-Smtp-Source: ABdhPJxZbQQvrkCnO0AehOfO1MLCvXxxR6laNLaSn7wkjhj85bANeiuRLMnKSEAJ/0yza2GrYr501w== X-Received: by 2002:a63:9d03:: with SMTP id i3mr13937595pgd.397.1625463664203; Sun, 04 Jul 2021 22:41:04 -0700 (PDT) Received: from adam.duskett ([47.149.13.137]) by smtp.gmail.com with ESMTPSA id f20sm4807781pfv.47.2021.07.04.22.41.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Jul 2021 22:41:03 -0700 (PDT) From: Adam Duskett To: buildroot@buildroot.org Date: Sun, 4 Jul 2021 22:40:56 -0700 Message-Id: <20210705054100.2857251-2-aduskett@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210705054100.2857251-1-aduskett@gmail.com> References: <20210705054100.2857251-1-aduskett@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/5] package/duktape/duktape.pc.in: 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 , Fabrice Fontaine , Thomas Petazzoni , Giulio Benetti , Maxime Hadjinlian , "Yann E . MORIN" , Adam Duskett , Norbert Lange Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Most distributions include a duktape.pc file bundled with the duktape development package. As the duktape source does not include a .pc file, add one to the package/duktape directory and install it to the staging directory. This is used by the polkit duktape patch later in the series. Signed-off-by: Adam Duskett --- package/duktape/duktape.mk | 4 ++++ package/duktape/duktape.pc.in | 10 ++++++++++ 2 files changed, 14 insertions(+) create mode 100644 package/duktape/duktape.pc.in diff --git a/package/duktape/duktape.mk b/package/duktape/duktape.mk index aadd609248..89a6e451f5 100644 --- a/package/duktape/duktape.mk +++ b/package/duktape/duktape.mk @@ -19,6 +19,10 @@ endef define DUKTAPE_INSTALL_STAGING_CMDS $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) -f Makefile.sharedlibrary \ INSTALL_PREFIX=$(STAGING_DIR)/usr install + $(INSTALL) -D -m 0644 $(DUKTAPE_PKGDIR)/duktape.pc.in \ + $(STAGING_DIR)/usr/lib/pkgconfig/duktape.pc + $(SED) 's/@VERSION@/$(DUKTAPE_VERSION)/g;' \ + $(STAGING_DIR)/usr/lib/pkgconfig/duktape.pc endef define DUKTAPE_INSTALL_TARGET_CMDS diff --git a/package/duktape/duktape.pc.in b/package/duktape/duktape.pc.in new file mode 100644 index 0000000000..eaef5f6994 --- /dev/null +++ b/package/duktape/duktape.pc.in @@ -0,0 +1,10 @@ +prefix=/usr +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: duktape +Description: Embeddable Javascript engine +Version: @VERSION@ +Libs: -L${libdir} -lduktape +Cflags: -I${includedir}/ From patchwork Mon Jul 5 05:40:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 1500572 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::133; helo=smtp2.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=uDrnsmW7; dkim-atps=neutral Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) (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 4GJF1m3Pg4z9sX1 for ; Mon, 5 Jul 2021 15:42:03 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 9F6F9400B5; Mon, 5 Jul 2021 05:42:00 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org 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 gITARhp0X0W3; Mon, 5 Jul 2021 05:41:59 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id 6E4DE40168; Mon, 5 Jul 2021 05:41:58 +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 07E621BF981 for ; Mon, 5 Jul 2021 05:41:10 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 047CD60789 for ; Mon, 5 Jul 2021 05:41:10 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp3.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com 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 ydw-HNjPI5qN for ; Mon, 5 Jul 2021 05:41:06 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by smtp3.osuosl.org (Postfix) with ESMTPS id 00502605BA for ; Mon, 5 Jul 2021 05:41:05 +0000 (UTC) Received: by mail-pl1-x634.google.com with SMTP id c15so9629495pls.13 for ; Sun, 04 Jul 2021 22:41:05 -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=O/7Y50W++n/DII2mvtcAer1+8U/l191IvdUq0eiNBps=; b=uDrnsmW7EQScBk5X/jjUamcuhoyO5bjpHgomyvxIJpXyx47rEBFx3UI0QrKRqKUOkq vkzDIqHfM/fklAGx6edD9BqfhzMN98OtdYLDU6Y+aqU3nZs7N9Ht+07YQy05gwYdWz8F yD6I4iTthRkzHo6sV9L4wQpVXKtL8WN6CkMupX6wPaV7+jcHb9dVmeWnJ/7UNJG+vvoy 7PPtHyIcifehZ7O4gHKtzg3lzp8OQR6ijIBG/k69ah625SzW7Ku+SNgDk1uTOakSmKa0 RUT1baFINJ/T+v8d/lkGhXYEGcIJ09SKqomJVchuc5pwbzoZpWwjakpmnWpiq47mzIiH OWJg== 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=O/7Y50W++n/DII2mvtcAer1+8U/l191IvdUq0eiNBps=; b=DkLjLQPMqPX5EaRc60Exz39JcQdnJbWGTZR2Nqt9IOnjBpFmfmZfdjJwL9w8EXZPwK A/32/s2VtXKe6nip9h6sNrgDpMw6hpOI6ythK/1+RbPcQHcfyJHykSySiCvOA9U27O6g Gsuz6whqXW2eJvbAxATa+sDbdqKi9ENcxK/aIp/OV+/o+iTKSPL0K7Z75jtd+0S6ghIW PLUJjxuH4q+8b7ZuDDTUApDaJ63rc6xZybcZ/AW3pOshqFeez8V3xn3bkQk4ge8PNyc0 B+DuYgHv8N/SCcb9hrUpY41/RPHXNCZyv+g1IE1TAeHQQbEGi/efCfrWWO6etODjpN15 MNow== X-Gm-Message-State: AOAM530T1G8ut6GpBwM8t3qC3VDlQ6lNAoswYJCx2ihHnWJsIWZQdlxr fxqcWYuf4N97Xscnq84MsNJN/mVQs/IdYg== X-Google-Smtp-Source: ABdhPJz9Xd7zEspHk2lnAIDY33u9Guk/9hyYppYSAU4PuSDcdcVMSlI1b2OL0/K/fX8mgyi30cz1rg== X-Received: by 2002:a17:902:f54d:b029:128:e54f:48f5 with SMTP id h13-20020a170902f54db0290128e54f48f5mr10917174plf.68.1625463665191; Sun, 04 Jul 2021 22:41:05 -0700 (PDT) Received: from adam.duskett ([47.149.13.137]) by smtp.gmail.com with ESMTPSA id f20sm4807781pfv.47.2021.07.04.22.41.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Jul 2021 22:41:04 -0700 (PDT) From: Adam Duskett To: buildroot@buildroot.org Date: Sun, 4 Jul 2021 22:40:57 -0700 Message-Id: <20210705054100.2857251-3-aduskett@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210705054100.2857251-1-aduskett@gmail.com> References: <20210705054100.2857251-1-aduskett@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 2/5] 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 , Fabrice Fontaine , Thomas Petazzoni , Giulio Benetti , Maxime Hadjinlian , "Yann E . MORIN" , Adam Duskett , Norbert Lange 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), with one small change: Netgroup support was yet again made optional. :) 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 - 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 --- .../0001-make-netgroup-support-optional.patch | 19 ++++++----- 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, 37 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..155531f398 100644 --- a/package/polkit/0001-make-netgroup-support-optional.patch +++ b/package/polkit/0001-make-netgroup-support-optional.patch @@ -25,11 +25,11 @@ Signed-off-by: Thomas Petazzoni src/polkit/polkitidentity.c | 16 ++ src/polkit/polkitunixnetgroup.c | 3 + .../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(-) + 9 files changed, 185 insertions(+), 9 deletions(-) create mode 100644 buildutil/introspection.m4 diff --git a/buildutil/introspection.m4 b/buildutil/introspection.m4 @@ -184,7 +184,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"], +@@ -100,7 +100,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) @@ -298,7 +298,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 +306,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..f19cc5edbf 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 999bd3c2e50e02b464efd14a81da6ddef8c8359b3b720ce4c68dc23820a9567e 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..7249980a79 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,$(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 d658308213..6bc6294a78 100644 --- a/package/systemd/Config.in +++ b/package/systemd/Config.in @@ -320,11 +320,8 @@ config BR2_PACKAGE_SYSTEMD_NETWORKD 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 @@ -335,13 +332,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 Mon Jul 5 05:40:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 1500570 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.138; helo=smtp1.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=KDSooV8J; dkim-atps=neutral Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (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 4GJF1F3xdfz9sX1 for ; Mon, 5 Jul 2021 15:41:37 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 6676A835BA; Mon, 5 Jul 2021 05:41:34 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org 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 18B_Awiuz4iP; Mon, 5 Jul 2021 05:41:33 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id A215083A4A; Mon, 5 Jul 2021 05:41:32 +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 6C3221BF46A for ; Mon, 5 Jul 2021 05:41:07 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 67E6040168 for ; Mon, 5 Jul 2021 05:41:07 +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 yQRQ45PjV3B6 for ; Mon, 5 Jul 2021 05:41:06 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by smtp2.osuosl.org (Postfix) with ESMTPS id D43FA400B5 for ; Mon, 5 Jul 2021 05:41:06 +0000 (UTC) Received: by mail-pj1-x1034.google.com with SMTP id ie21so9313320pjb.0 for ; Sun, 04 Jul 2021 22:41:06 -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=EWP9lDhygKs9X80IHJrGMJBQskxx9/EdGrGfB/pU7XA=; b=KDSooV8JaMjQhIJVx1REGJyl3IruKBviyO8O56HrdWPeGR82st0Jy0RhzZHfEeEDyP zsbJuTSMK5/3U68DvpPCWZab9JsATZ+lGUmC+rzh6yXHKR1OOrhk0to7niaQuRDYbaBm E1YCAVfpSfRc6R+x3F4o4Yby5lU/6qVXUFzw3QMFkfwNCI2UTE1RdZTGbPBB8wbL4zM3 DXC9BnPE8iItekfJslGofzs+3tNthfyzX6x9ut3d/pAd1xyAJHbYW4pTRc3Ce3xacHhB I5ASIVjegx95BF3a1iX51gesCyd4U2vA3f8Dokh4GCuk4lky4Uutlo0eIwSrd0ug/o7Z hXjA== 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=EWP9lDhygKs9X80IHJrGMJBQskxx9/EdGrGfB/pU7XA=; b=OrPjaC1ou/2JZS0Q+7+yPenU609Y0joDy7KQyluqd4DLqcD+9T4B+L/sumLeyCBCVP JA82GoIKIoJ9UQl+Qx2jh+RejEzD+JPG/XOgFRsNIGk9EH9JzL+1Ds2kG9amkpQzb93Y iVc/Fhrryah7XY14deJ5l0Zt6RCTUyzKyeRkRWCbjTsVUAaOVe448HWxG17DcK/kYmNn SBTTjYS5+M7LYsgSKDn2moH2GyZ1GsfmDqOSQ8RuxfJjWIWNqE5FtU6vu2n/R6GNzb8P bp/smcNcqayi32hReYjkHS3e3lCRzrB27zPsGDZkOdsbh7aHNtjsXE10r02eMIpmaabH ktyA== X-Gm-Message-State: AOAM5307WGMaQD22mKuOQdyLGju/RdgSebhUltj9FJNVIbWmK0Wx1J6N fTpudeCVlnO/9oj8jb5EG24tD55g1GgfCA== X-Google-Smtp-Source: ABdhPJxTbhadwAGoVxuV4ARYCtnsQZOJ1p7LUjpdW4JTfLFhFbqkbpbZgrYkLpYuUYt6IUEF1ebHTA== X-Received: by 2002:a17:90a:a607:: with SMTP id c7mr13686096pjq.199.1625463666166; Sun, 04 Jul 2021 22:41:06 -0700 (PDT) Received: from adam.duskett ([47.149.13.137]) by smtp.gmail.com with ESMTPSA id f20sm4807781pfv.47.2021.07.04.22.41.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Jul 2021 22:41:05 -0700 (PDT) From: Adam Duskett To: buildroot@buildroot.org Date: Sun, 4 Jul 2021 22:40:58 -0700 Message-Id: <20210705054100.2857251-4-aduskett@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210705054100.2857251-1-aduskett@gmail.com> References: <20210705054100.2857251-1-aduskett@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 3/5] 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 , Fabrice Fontaine , Thomas Petazzoni , Giulio Benetti , Maxime Hadjinlian , "Yann E . MORIN" , Adam Duskett , Norbert Lange 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 | 4 ++++ 2 files changed, 55 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 7249980a79..d534c3d6f5 100644 --- a/package/polkit/polkit.mk +++ b/package/polkit/polkit.mk @@ -54,7 +54,11 @@ endef define POLKIT_INSTALL_INIT_SYSTEMD $(INSTALL) -D -m 644 $(POLKIT_PKGDIR)/polkit.service \ $(TARGET_DIR)/usr/lib/systemd/system/polkit.service +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 Mon Jul 5 05:40:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 1500571 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=D3zF1Gje; 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 4GJF1V4Lkxz9sXM for ; Mon, 5 Jul 2021 15:41:50 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 49286605BA; Mon, 5 Jul 2021 05:41:47 +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 8_TBUdQz9Q6O; Mon, 5 Jul 2021 05:41:46 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id 4766B60789; Mon, 5 Jul 2021 05:41:45 +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 DAF021BF46A for ; Mon, 5 Jul 2021 05:41:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id CAA84835BA for ; Mon, 5 Jul 2021 05:41:09 +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 k0mW74Pm2Hau for ; Mon, 5 Jul 2021 05:41:07 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by smtp1.osuosl.org (Postfix) with ESMTPS id E9B2E835B9 for ; Mon, 5 Jul 2021 05:41:07 +0000 (UTC) Received: by mail-pf1-x431.google.com with SMTP id 145so1771711pfv.0 for ; Sun, 04 Jul 2021 22:41:07 -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=D3zF1Gjex9Gz84VPPFH5p68WNFbaFWpkPioMHKvDll15ZmPTnpSXQx0nqRfhovNQzt oB1Y1DJNnGOgffhu3nrglFpstHxK5quAd0iIE1l2FPL8WKsDoV+OeF2JtEhj95VL4kPo vX42lJBncwj60fnEgqNdLmLlurn9xw2A+GtM/a4mJ2lMY2Hc7YpjytGnycrFKxkdlkAk FVTHnc95BhEGRwIRWp6p1G5g+FzkBsTttmjvGc1OgnPY+K/GjK5HrWpiTudRVuK0pRu8 j7QcpjJ1T9iG5VikJVUm81iiIa+x3bHgjgQnJlu3348ilkJD5VwZbR/Pab5DCknSVzw9 3yaw== 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=jUuzFap9p/lsXCgoli43FLoeF6w8KVs1UFXFqWCsmn6FWBK/TotKpN4ETu2E1WZRHZ uzuh2lo2GgDflfJQ1A13nTKyUN286sDY9KSuK7SRyWMl4cNfzw4l4LYN53bGNLckCE9V 6U4lB6eiOWLiqJmyuj80HXPksiRF+wEEfoc1TssyfnyzI9yKLHJ/V4/P8tvNZ0C+gV5f YiYowMoXCfbN01CiqXBsFR0u1WLRE9cPmJdntZhT+gtiYCmHFJoJWPRQkyYLknDI0LBO /nAHN+80Ov1h7JEDQmS/Kx8qGNjPzxNPTbhiisuEo0fyiv1x8+IxxR/G46Vvgp4y37Hj QcSg== X-Gm-Message-State: AOAM5330WmLwUvTacIS/K3A+oKkvmS8lANMI/oV8Op10OTTf4dcQPNYe c1EhZA6P3Fy6yFr4t7ZQLGR6xcNWtKyoUg== X-Google-Smtp-Source: ABdhPJzO5LoK10bMZ0jpHQEgRA/1z8CBajjvU38CSYqZQ7bM+JNrXOh8aeRmN8bPc+CNks/7JgTsZQ== X-Received: by 2002:a63:d06:: with SMTP id c6mr13658300pgl.121.1625463667226; Sun, 04 Jul 2021 22:41:07 -0700 (PDT) Received: from adam.duskett ([47.149.13.137]) by smtp.gmail.com with ESMTPSA id f20sm4807781pfv.47.2021.07.04.22.41.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Jul 2021 22:41:06 -0700 (PDT) From: Adam Duskett To: buildroot@buildroot.org Date: Sun, 4 Jul 2021 22:40:59 -0700 Message-Id: <20210705054100.2857251-5-aduskett@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210705054100.2857251-1-aduskett@gmail.com> References: <20210705054100.2857251-1-aduskett@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 4/5] 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 , Fabrice Fontaine , Thomas Petazzoni , Giulio Benetti , Maxime Hadjinlian , "Yann E . MORIN" , Adam Duskett , Norbert Lange 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 Mon Jul 5 05:41:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 1500574 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=d8Kz4oum; 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 4GJF215Fq2z9sX1 for ; Mon, 5 Jul 2021 15:42:17 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 56CDC605BA; Mon, 5 Jul 2021 05:42:15 +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 QiH4WkyVD15Z; Mon, 5 Jul 2021 05:42:12 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id 0361C60789; Mon, 5 Jul 2021 05:42:12 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 7400B1BF46A for ; Mon, 5 Jul 2021 05:41:13 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 58E7B4044E for ; Mon, 5 Jul 2021 05:41:13 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp4.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com 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 mJTY6uaw8taz for ; Mon, 5 Jul 2021 05:41:09 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by smtp4.osuosl.org (Postfix) with ESMTPS id BBAB3403F6 for ; Mon, 5 Jul 2021 05:41:09 +0000 (UTC) Received: by mail-pj1-x1030.google.com with SMTP id l11so11042601pji.5 for ; Sun, 04 Jul 2021 22:41:09 -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=e5u7K8kS0g/tH9JcO1FxdLVwBJxzWsCVrObFXPo4W+Q=; b=d8Kz4oumn5IA+GBmMDBDI471w4AEBT8qiHkKfWhB6wNdMMWHRMs1xEqITQumvGu2sc IHEh/z5U296wEsy+GEMe4RHykPEI1fZqlVupkO8LixGHWhTGJil+gqJAzW5jiaslv2R8 8Knu2/UaZMSv5liR3TyQKR+ExqoRoTt/L+pSVPbLr3YKTw5iERe+mOgI26KQY+90WII1 d1Sz7wwbXnqNmNVO5sjzEYS6KnpZhVUNVGUSwzo6THrfhJWhUd2mxBi33u9cNQMVnlHI p1Z1dIRzopoVC9uMDdQanS0jWZve4LofkdDAaHa+NaOpjYr+xacJm4JlUA0C0yiKZ1OJ MB1g== 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=e5u7K8kS0g/tH9JcO1FxdLVwBJxzWsCVrObFXPo4W+Q=; b=tXlnIjRpLa31SA5nFWfxqnVELvuIcqUFBsNWcGXXv7YKpJT0xRPWqTNiXil+oZuJy2 mdLrzKRFfgRBWmGKGbUKbmtEqjfKo2vX0UhbzbA/DWbLdPJ3hRT6oF12AN8nnX1lTtll Iiy1BjYKNa+oRbfOjnz5AWiSourbV3lcWo6yVLVG78AyaysJBfcja+3BzTTB1Ff6yp26 PUT7Nqunq2hnopqTXCsonuF/vqmoBtVYWkIY75sxIsSh58FtYKTtHZNQJAYrlep9vKbh kIFMF7ffqtU2cjXZIANHSONrOT51u046pV7MWM1mYUCQAQkIc0t24KhOSATt4iEE3iZj 20UA== X-Gm-Message-State: AOAM5308BZ/ozX1FpmKNPRpcko8vPnxrsW/W1suOkuQlXO5VF1KvYAWP xyeCPTGRSyfcMyyVRt5Em6H3L5Zv6GDw9Q== X-Google-Smtp-Source: ABdhPJxFMtRMu8xgYVHWiqEumCw+hKZihMg1i1KYlU7GKEZaRjj38mf0XuU04RhM2m+jojuBW2R//w== X-Received: by 2002:a17:90a:901:: with SMTP id n1mr13329058pjn.44.1625463668502; Sun, 04 Jul 2021 22:41:08 -0700 (PDT) Received: from adam.duskett ([47.149.13.137]) by smtp.gmail.com with ESMTPSA id f20sm4807781pfv.47.2021.07.04.22.41.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Jul 2021 22:41:08 -0700 (PDT) From: Adam Duskett To: buildroot@buildroot.org Date: Sun, 4 Jul 2021 22:41:00 -0700 Message-Id: <20210705054100.2857251-6-aduskett@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210705054100.2857251-1-aduskett@gmail.com> References: <20210705054100.2857251-1-aduskett@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 5/5] 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 , Fabrice Fontaine , Thomas Petazzoni , Giulio Benetti , Maxime Hadjinlian , "Yann E . MORIN" , Adam Duskett , Norbert Lange 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 bcbb625edb..95116b4571 100644 --- a/Config.in.legacy +++ b/Config.in.legacy @@ -146,6 +146,15 @@ endif comment "Legacy options removed in 2021.05" +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 22947edf2c..96184abb29 100644 --- a/package/Config.in +++ b/package/Config.in @@ -1635,7 +1635,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))