Skip to contentSkip to conversation

spidermonkey: new package.

PATCH Superseded aduskett at gmail.com 2 participants 8 messages Nov 24, 2019 – Nov 25, 2019 RISC-V

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover spidermonkey: new package.

From: Adam Duskett <[email protected]>

Spidermonkey is Mozilla's JavaScript engine written in C and C++. It is used in various Mozilla products, including Firefox, and is available under the MPL2.

There are 19 patches currently required to properly cross-compile spidermonkey:

1) 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 do 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, newer versions of Autoconf work without issue.
See: See: https://bugzilla.mozilla.org/show_bug.cgi?id=104642
for further explanation.

2) 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:
The path specified in LOCAL_INCLUDES is not allowed:
.. (resolved to js/src)
Remove this check, as spidermonkey builds without issue in-tree.

3) 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

4) fix-building-with-musl
- The MIPS specific header <sgidefs.h> is not provided by musl. The Linux kernel headers <asm/sgidefs.h> provide the same definitions.

5) add-riscv-support
- Submitted upstream:

    See: https://bugzilla.mozilla.org/show_bug.cgi?id=1318905

6) copy-headers-on-install-instead-of-symlinking
- When installing, instead of linking the headers to the source directory, copy them.

7) ensure-proper-running-on-64-bit-and-32-bit-be-platforms
- Taken from the Fedora RPM

    Applied upstream.
    Fixes: https://bugzilla.mozilla.org/show_bug.cgi?id=1488552

8) 0008-save-and-restore-non-volatile-x28-on-ARM64-for-generated-unboxed-obje
- Taken from the Fedora RPM:

    Applied upstream.
    Fixes: https://bugzilla.mozilla.org/show_bug.cgi?id=1375074

9) save-x28-before-clobbering-it-in-the-regex-compiler
- Taken from the Fedora RPM:

    Applied upstream.
    Fixes: https://bugzilla.mozilla.org/show_bug.cgi?id=1445907

10) always-use-the-equivalent-year-to-determine-the-time-zone
- Taken from the Fedora RPM:

    Applied upstream.
    Fixes: https://bugzilla.mozilla.org/show_bug.cgi?id=1415202

Typically, The Firefox source tarball is used to build spidermonkey; however, this has two disadvantages:
- It's large. The Firefox source tarball is over 250M.
- It requires Autoconf 2.13
Instead, use a tarball with only the Spidermonkey source code in it with a pre-setup configure file. This tarball reduces the size to 31M and prevents the Autoconf 2.13 requirement.

Also in this patch set:
- Update polkit to 0.116
- Update polkit to support systemd-logind
- Update polkit to support linux-pam

Tested with test-pkg -a
- 44 tests completed:
- 18 OK
- 26 SKIPPED
- 0 FAILED

Changes from v1 -> v2:
- When making large patch series like this, I tend to do all of my work in my own fork of buildroot, and then copy the changes over to a master copy of buildroot. I was testing spidermonkey without host_python_ssl to make sure it's actually a requirement (It is), and I forgot to re-add it back before making the patch. Doh!

Adam Duskett (4):
spidermonkey: new package
package/polkit: bump to version 0.116 package/polkit: support different authentication frameworks package/polkit: enable systemd login support

 DEVELOPERS                                    |   2 +
 package/Config.in                             |   1 +
 .../0001-make-netgroup-support-optional.patch | 232 ++++++++++++++++++
 package/polkit/Config.in                      |  22 +-
 package/polkit/polkit.hash                    |   2 +-
 package/polkit/polkit.mk                      |  22 +-
 .../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 ++++++++
 package/spidermonkey/Config.in                |  39 +++
 package/spidermonkey/spidermonkey.hash        |   3 +
 package/spidermonkey/spidermonkey.mk          |  58 +++++
 19 files changed, 1213 insertions(+), 12 deletions(-)
 create mode 100644 package/polkit/0001-make-netgroup-support-optional.patch
 create mode 100644 package/spidermonkey/0001-allow-newer-autoconf-versions.patch
 create mode 100644 package/spidermonkey/0002-allow-building-in-tree.patch
 create mode 100644 package/spidermonkey/0003-allow-unknown-configuration-options.patch
 create mode 100644 package/spidermonkey/0004-fix-building-with-musl.patch
 create mode 100644 package/spidermonkey/0005-add-riscv-support.patch
 create mode 100644 package/spidermonkey/0006-copy-headers-on-install-instead-of-symlinking.patch
 create mode 100644 package/spidermonkey/0007-ensure-proper-running-on-64-bit-and-32-bit-be-platforms.patch
 create mode 100644 package/spidermonkey/0008-save-and-restore-non-volatile-x28-on-ARM64-for-generated-unboxed-obje.patch
 create mode 100644 package/spidermonkey/0009-save-x28-before-clobbering-it-in-the-regex-compiler.patch
 create mode 100644 package/spidermonkey/0010-always-use-the-equivalent-year-to-determine-the-time-zone.patch
 create mode 100644 package/spidermonkey/Config.in
 create mode 100644 package/spidermonkey/spidermonkey.hash
 create mode 100644 package/spidermonkey/spidermonkey.mk
Signature · 1 line
2.23.0
#1 lore raw

PATCH v2 1/4 spidermonkey: new package

From: Adam Duskett <[email protected]>

Spidermonkey is Mozilla's JavaScript engine written in C and C++. It is used in various Mozilla products, including Firefox, and is available under the MPL2.

There are 19 patches currently required to properly cross-compile spidermonkey:

1) 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 do 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, newer versions of Autoconf work without issue.
See: See: https://bugzilla.mozilla.org/show_bug.cgi?id=104642
for further explanation.

2) 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:
The path specified in LOCAL_INCLUDES is not allowed:
.. (resolved to js/src)
Remove this check, as spidermonkey builds without issue in-tree.

3) 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

4) fix-building-with-musl
- The MIPS specific header <sgidefs.h> is not provided by musl. The Linux kernel headers <asm/sgidefs.h> provide the same definitions.

5) add-riscv-support
- Submitted upstream:

    See: https://bugzilla.mozilla.org/show_bug.cgi?id=1318905

6) copy-headers-on-install-instead-of-symlinking
- When installing, instead of linking the headers to the source directory, copy them.

7) ensure-proper-running-on-64-bit-and-32-bit-be-platforms
- Taken from the Fedora RPM

    Applied upstream.
    Fixes: https://bugzilla.mozilla.org/show_bug.cgi?id=1488552

8) 0008-save-and-restore-non-volatile-x28-on-ARM64-for-generated-unboxed-obje
- Taken from the Fedora RPM:

    Applied upstream.
    Fixes: https://bugzilla.mozilla.org/show_bug.cgi?id=1375074

9) save-x28-before-clobbering-it-in-the-regex-compiler
- Taken from the Fedora RPM:

    Applied upstream.
    Fixes: https://bugzilla.mozilla.org/show_bug.cgi?id=1445907

10) always-use-the-equivalent-year-to-determine-the-time-zone
- Taken from the Fedora RPM:

    Applied upstream.
    Fixes: https://bugzilla.mozilla.org/show_bug.cgi?id=1415202

Typically, The Firefox source tarball is used to build spidermonkey; however, this has two disadvantages:
- It's large. The Firefox source tarball is over 250M.
- It requires Autoconf 2.13
Instead, use a tarball with only the Spidermonkey source code in it with a pre-setup configure file. This tarball reduces the size to 31M and prevents the Autoconf 2.13 requirement.

---
Changes v1 -> v2:
- Add select BR2_PACKAGE_HOST_PYTHON_SSL to package/spidermonkey/Config.in this line was left out from a old Config file that was copied over when making the patch.

 DEVELOPERS                                    |   1 +
 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 +++++++++++++
 package/spidermonkey/Config.in                |  39 +++++
 package/spidermonkey/spidermonkey.hash        |   3 +
 package/spidermonkey/spidermonkey.mk          |  58 +++++++
 15 files changed, 946 insertions(+)
 create mode 100644 package/spidermonkey/0001-allow-newer-autoconf-versions.patch
 create mode 100644 package/spidermonkey/0002-allow-building-in-tree.patch
 create mode 100644 package/spidermonkey/0003-allow-unknown-configuration-options.patch
 create mode 100644 package/spidermonkey/0004-fix-building-with-musl.patch
 create mode 100644 package/spidermonkey/0005-add-riscv-support.patch
 create mode 100644 package/spidermonkey/0006-copy-headers-on-install-instead-of-symlinking.patch
 create mode 100644 package/spidermonkey/0007-ensure-proper-running-on-64-bit-and-32-bit-be-platforms.patch
 create mode 100644 package/spidermonkey/0008-save-and-restore-non-volatile-x28-on-ARM64-for-generated-unboxed-obje.patch
 create mode 100644 package/spidermonkey/0009-save-x28-before-clobbering-it-in-the-regex-compiler.patch
 create mode 100644 package/spidermonkey/0010-always-use-the-equivalent-year-to-determine-the-time-zone.patch
 create mode 100644 package/spidermonkey/Config.in
 create mode 100644 package/spidermonkey/spidermonkey.hash
 create mode 100644 package/spidermonkey/spidermonkey.mk
DEVELOPERS +1 -0
index 98f67fbc96..1f05d1fe4c 100644
@@ -73,6 +73,7 @@ F:	package/selinux-python/
 F:	package/semodule-utils/
 F:	package/setools/
 F:	package/sngrep/
+F:	package/spidermonkey/
 F:	package/systemd/
 
 N:	Adam Heinrich <[email protected]>
package/Config.in +1 -0
index 9210ec0ac8..04872dc850 100644
@@ -1489,6 +1489,7 @@ endif
 	source "package/jsmin/Config.in"
 	source "package/json-javascript/Config.in"
 	source "package/openlayers/Config.in"
+	source "package/spidermonkey/Config.in"
 endmenu
 
 menu "JSON/XML"
package/spidermonkey/0001-allow-newer-autoconf-versions.patch new file +61 -0

61 lines not on this page · raw message

package/spidermonkey/0002-allow-building-in-tree.patch new file +47 -0

47 lines not on this page · raw message

package/spidermonkey/0003-allow-unknown-configuration-options.patch new file +35 -0
new file mode 100644
index 0000000000..b489075a94
@@ -0,0 +1,35 @@
+From 4a06a1a6a71293decb83aee7adb74bc709493106 Mon Sep 17 00:00:00 2001
+From: Philip Chimento <[email protected]>
+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 <[email protected]>
+Signed-off-by: Adam Duskett <[email protected]>
+---
+ 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
+
package/spidermonkey/0004-fix-building-with-musl.patch new file +133 -0

133 lines not on this page · raw message

package/spidermonkey/0005-add-riscv-support.patch new file +121 -0

121 lines not on this page · raw message

package/spidermonkey/0006-copy-headers-on-install-instead-of-symlinking.patch new file +34 -0
new file mode 100644
index 0000000000..10ca54c702
@@ -0,0 +1,34 @@
+From 903a79a1efff18fc7cc50db09a3fe5d768adc9a8 Mon 19 Mar 2018 09:58:06 +0100
+From: Rico Tzschichholz <[email protected]>
+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 <[email protected]>
+Signed-off-by: Adam Duskett <[email protected]>
+---
+ 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
package/spidermonkey/0007-ensure-proper-running-on-64-bit-and-32-bit-be-platforms.patch new file +144 -0

144 lines not on this page · raw message

package/spidermonkey/0008-save-and-restore-non-volatile-x28-on-ARM64-for-generated-unboxed-obje.patch new file +66 -0

66 lines not on this page · raw message

package/spidermonkey/0009-save-x28-before-clobbering-it-in-the-regex-compiler.patch new file +100 -0

100 lines not on this page · raw message

package/spidermonkey/0010-always-use-the-equivalent-year-to-determine-the-time-zone.patch new file +103 -0

103 lines not on this page · raw message

package/spidermonkey/Config.in new file +39 -0
new file mode 100644
index 0000000000..1a5e0e29a5
@@ -0,0 +1,39 @@
+config BR2_PACKAGE_SPIDERMONKEY_ARCH_SUPPORTS
+	bool
+	default y
+	depends on !BR2_nios2
+	depends on !BR2_aarch64_be
+
+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_INSTALL_LIBSTDCPP
+	depends on BR2_USE_WCHAR
+	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_STATIC_LIBS # dlopen
+	depends on BR2_PACKAGE_LIBNSPR_ARCH_SUPPORT # libnspr
+	depends on !BR2_TOOLCHAIN_USES_UCLIBC # No way to check for fenv support.
+	depends on BR2_PACKAGE_SPIDERMONKEY_ARCH_SUPPORTS
+	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
+
+comment "spidermonkey needs a glibc or musl toolchain with C++, wchar, dynamic library, NPTL, gcc >= 4.9"
+	depends on BR2_TOOLCHAIN_USES_UCLIBC
+	depends on BR2_PACKAGE_LIBNSPR_ARCH_SUPPORT
+	depends on BR2_USE_MMU || !BR2_USE_WCHAR
+	depends on !BR2_INSTALL_LIBSTDCPP || BR2_STATIC_LIBS || \
+	!BR2_TOOLCHAIN_HAS_THREADS_NPTL || !BR2_TOOLCHAIN_GCC_AT_LEAST_5
package/spidermonkey/spidermonkey.hash new file +3 -0
new file mode 100644
index 0000000000..ccb0265861
@@ -0,0 +1,3 @@
+# Locally computed
+sha256 f51039c997415fd0f13f8e01966b4a8ff80cbf90deb8b14c18827104a369cc0d mozjs-60.5.2.tar.bz2
+sha256 aaac93a33bec26d5d1a9c5efc1e7dc6bd215d8a4f1e1a7fc5315a67adfd51338 moz.configure
package/spidermonkey/spidermonkey.mk new file +58 -0

58 lines not on this page · raw message

Signature · 1 line
2.23.0
#2 lore raw

PATCH v2 1/4 spidermonkey: new package

Hello Adam,

Thanks a lot for this!

Quoted 6 lines · On Sun, 24 Nov 2019 13:48:20 -0800 aduskett at gmail.com wrote:

From: Adam Duskett <[email protected]>

Spidermonkey is Mozilla's JavaScript engine written in C and C++. It is used in various Mozilla products, including Firefox, and is available under the MPL2.

There are 19 patches currently required to properly cross-compile spidermonkey:

You have 10 patches, not 19.

Thanks a lot for writing down the details of why each patch is needed, this is very useful to have in the commit log.

package/spidermonkey/0004-fix-building-with-musl.patch line 7

Quoted 13 lines
package/spidermonkey/0004-fix-building-with-musl.patch new file +7 -0
new file mode 100644
index 0000000000..8d8b10fb71
@@ -0,0 +1,133 @@
+From 0c9e8f586ba52a9aef5ed298e8315b2598b8fb72 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Sat, 25 May 2019 16:54:45 -0700
+Subject: [PATCH] fix building with musl
+
+The MIPS specific header <sgidefs.h> is not provided by musl
+linux kernel headers provide <asm/sgidefs.h> which has same definitions

This is doing a lot more than switching to asm/sgidefs.h. But well, OK you're not the author of the patch.

package/spidermonkey/Config.in line 5

Quoted 11 lines
package/spidermonkey/Config.in new file +5 -0
new file mode 100644
index 0000000000..1a5e0e29a5
@@ -0,0 +1,39 @@
+config BR2_PACKAGE_SPIDERMONKEY_ARCH_SUPPORTS
+	bool
+	default y
+	depends on !BR2_nios2
+	depends on !BR2_aarch64_be

It is generally better to have an explicit list of supported architectures, rather than a list of exclusions.

Quoted 6 lines
package/spidermonkey/Config.in new file +6 -0
+
+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

package/spidermonkey/Config.in line 21

Quoted 10 lines
package/spidermonkey/Config.in new file +10 -0
+	bool "spidermonkey"
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_USE_WCHAR
+	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_STATIC_LIBS # dlopen
+	depends on BR2_PACKAGE_LIBNSPR_ARCH_SUPPORT # libnspr
+	depends on !BR2_TOOLCHAIN_USES_UCLIBC # No way to check for fenv support.
+	depends on BR2_PACKAGE_SPIDERMONKEY_ARCH_SUPPORTS

Alphabetic ordering.

Quoted 8 lines
package/spidermonkey/Config.in new file +8 -0
+	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

package/spidermonkey/Config.in line 39

Quoted 10 lines
package/spidermonkey/Config.in new file +10 -0
+	  JavaScript.
+
+	  https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey
+
+comment "spidermonkey needs a glibc or musl toolchain with C++, wchar, dynamic library, NPTL, gcc >= 4.9"
+	depends on BR2_TOOLCHAIN_USES_UCLIBC
+	depends on BR2_PACKAGE_LIBNSPR_ARCH_SUPPORT
+	depends on BR2_USE_MMU || !BR2_USE_WCHAR
+	depends on !BR2_INSTALL_LIBSTDCPP || BR2_STATIC_LIBS || \
+	!BR2_TOOLCHAIN_HAS_THREADS_NPTL || !BR2_TOOLCHAIN_GCC_AT_LEAST_5

This is not good. It should be:

	depends on BR2_USE_MMU
	depends on BR2_PACKAGE_LIBNSPR_ARCH_SUPPORT
	depends on !BR2_TOOLCHAIN_USES_UCLIBC || \
		!BR2_INSTALL_LIBSTDCPP || \
		BR2_STATIC_LIBS || \
		!BR2_TOOLCHAIN_HAS_THREADS_NPTL || \
		!BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 || \
		!BR2_USE_WCHAR

Also, please double check the gcc version dependency: you're using 4.9 in some places, and 5 in another place.

Quoted 12 lines
package/spidermonkey/spidermonkey.mk new file +6 -0
new file mode 100644
index 0000000000..583ccb803f
@@ -0,0 +1,58 @@
+################################################################################
+#
+# spidermonkey
+#
+################################################################################
+

package/spidermonkey/spidermonkey.mk line 16

Quoted 10 lines
package/spidermonkey/spidermonkey.mk new file +10 -0
+# 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_INSTALL_STAGING = YES
+SPIDERMONKEY_LICENSE_FILES = moz.configure

Could you put this line right after the _LICENSE line ? It makes sense to keep both together.

package/spidermonkey/spidermonkey.mk line 20

Quoted 3 lines
package/spidermonkey/spidermonkey.mk new file +3 -0
+SPIDERMONKEY_DEPENDENCIES = \
+	host-perl \
+	host-python \

You really need to build our own version of Perl? You can't use the Perl provided by the system? Buildroot has a hard dependency on Perl, so you have the guarantee that a Perl interpreter is available.

package/spidermonkey/spidermonkey.mk line 21

Quoted 1 line
package/spidermonkey/spidermonkey.mk new file +1 -0
+	host-zip \

Just curious, what do you need from host-zip ?

Quoted 4 lines
package/spidermonkey/spidermonkey.mk new file +4 -0
+	libnspr \
+	zlib
+
+SPIDERMONKEY_CONF_ENV += \

package/spidermonkey/spidermonkey.mk line 35

Quoted 10 lines
package/spidermonkey/spidermonkey.mk new file +10 -0
+	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 \
+	--disable-readline \

This line should not be here but below in an else clause of the readline conditional [1].

package/spidermonkey/spidermonkey.mk line 42

Quoted 7 lines
package/spidermonkey/spidermonkey.mk new file +7 -0
+	--enable-shared-js \
+	--enable-ion \
+	--with-system-zlib \
+	--with-system-nspr \
+	--with-nspr-exec-prefix="$(STAGING_DIR)/usr"
+
+ifneq ($(BR2_PACKAGE_SPIDERMONKEY_JIT_ARCH_SUPPORTS),y)

Better:

ifeq ($(BR2_PACKAGE_SPIDERMONKEY_JIT_ARCH_SUPPORTS),y) SPIDERMONKEY_CONF_OPTS += --enable-ion
else
SPIDERMONKEY_CONF_OPTS += --disable-ion
endif

package/spidermonkey/spidermonkey.mk line 48

Quoted 6 lines
package/spidermonkey/spidermonkey.mk new file +6 -0
+SPIDERMONKEY_CONF_OPTS += --disable-ion
+endif
+
+ifeq ($(BR2_PACKAGE_READLINE),y)
+SPIDERMONKEY_CONF_OPTS += --enable-readline
+SPIDERMONKEY_DEPENDENCIES += readline

[1] here.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#3 lore raw

PATCH v2 2/4 package/polkit: bump to version 0.116

In reply to aduskett at gmail.com

From: Adam Duskett <[email protected]>

Other changes:
- Add spidermonkey as a dependency.
- Add 0001-make-netgroup-support-optional.patch to allow building on musl.

---
 DEVELOPERS                                    |   1 +
 .../0001-make-netgroup-support-optional.patch | 232 ++++++++++++++++++
 package/polkit/Config.in                      |  22 +-
 package/polkit/polkit.hash                    |   2 +-
 package/polkit/polkit.mk                      |   8 +-
 5 files changed, 255 insertions(+), 10 deletions(-)
 create mode 100644 package/polkit/0001-make-netgroup-support-optional.patch
DEVELOPERS +1 -0
index 1f05d1fe4c..e3d1c694f8 100644
@@ -53,6 +53,7 @@ F:	package/openjdk/
 F:	package/openjdk-bin/
 F:	package/php/
 F:	package/policycoreutils/
+F:	package/polkit/
 F:	package/python3/
 F:	package/python-aioredis/
 F:	package/python-asgiref/
package/polkit/0001-make-netgroup-support-optional.patch new file +232 -0

232 lines not on this page · raw message

package/polkit/Config.in +16 -6
index ac17cb4dc3..716fc44c93 100644
@@ -1,11 +1,17 @@
 config BR2_PACKAGE_POLKIT
 	bool "polkit"
+	depends on BR2_INSTALL_LIBSTDCPP # spidermonkey
+	depends on BR2_PACKAGE_LIBNSPR_ARCH_SUPPORT # spidermonkey -> libnspr
+	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 -> pthread_getattr_np()
 	depends on BR2_USE_MMU # libglib2
-	depends on BR2_TOOLCHAIN_HAS_THREADS # libglib2
-	depends on BR2_TOOLCHAIN_USES_GLIBC
 	depends on BR2_USE_WCHAR # libglib2
-	select BR2_PACKAGE_LIBGLIB2
+	depends on !BR2_STATIC_LIBS # spidermonkey -> dlopen()
+	depends on !BR2_TOOLCHAIN_USES_UCLIBC # spidermonkey -> fenv
 	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
@@ -13,6 +19,10 @@ config BR2_PACKAGE_POLKIT
 
 	  http://www.freedesktop.org/wiki/Software/polkit
 
-comment "polkit needs a toolchain w/ wchar, threads"
-	depends on BR2_USE_MMU
-	depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS
+comment "polkit needs a glibc or musl toolchain with C++, wchar, dynamic library, NPTL, gcc >= 4.9"
+	depends on BR2_TOOLCHAIN_USES_UCLIBC
+	depends on BR2_PACKAGE_LIBNSPR_ARCH_SUPPORT
+	depends on BR2_PACKAGE_SPIDERMONKEY_ARCH_SUPPORTS
+	depends on BR2_USE_MMU || !BR2_USE_WCHAR
+	depends on !BR2_INSTALL_LIBSTDCPP || BR2_STATIC_LIBS || \
+	!BR2_TOOLCHAIN_HAS_THREADS_NPTL || !BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
package/polkit/polkit.hash +1 -1
index 6368091c4a..bacd682139 100644
@@ -1,5 +1,5 @@
 # Locally calculated after checking pgp signature
-sha256	8fdc7cc8ba4750fcce1a4db9daa759c12afebc7901237e1c993c38f08985e1df	polkit-0.105.tar.gz
+sha256	88170c9e711e8db305a12fdb8234fac5706c61969b94e084d0f117d8ec5d34b1	polkit-0.116.tar.gz
 
 # Locally calculated
 sha256	d2e2aa973e29c75e1b492e67ea7b7da9de2d501d49a934657971fd74f9a0b0a8	COPYING
package/polkit/polkit.mk +5 -3
index fb4c171c52..5d85ea9897 100644
@@ -4,20 +4,22 @@
 #
 ################################################################################
 
-POLKIT_VERSION = 0.105
+POLKIT_VERSION = 0.116
 POLKIT_SITE = http://www.freedesktop.org/software/polkit/releases
 POLKIT_LICENSE = GPL-2.0
 POLKIT_LICENSE_FILES = COPYING
 
 POLKIT_INSTALL_STAGING = YES
 
-POLKIT_DEPENDENCIES = libglib2 host-intltool expat
+POLKIT_DEPENDENCIES = libglib2 host-intltool expat spidermonkey
 
 # We could also support --with-authfw=pam
 POLKIT_CONF_OPTS = \
 	--with-authfw=shadow \
 	--with-os-type=unknown \
 	--disable-man-pages \
-	--disable-examples
+	--disable-examples \
+	--enable-libsystemd-login=no \
+	--enable-libelogind=no
 
 $(eval $(autotools-package))
Signature · 1 line
2.23.0
#4 lore raw

PATCH v2 2/4 package/polkit: bump to version 0.116

Quoted 9 lines · On Sun, 24 Nov 2019 13:48:21 -0800 aduskett at gmail.com wrote:
package/polkit/Config.in +2 -0
index ac17cb4dc3..716fc44c93 100644
@@ -1,11 +1,17 @@
 config BR2_PACKAGE_POLKIT
 	bool "polkit"
+	depends on BR2_INSTALL_LIBSTDCPP # spidermonkey
+	depends on BR2_PACKAGE_LIBNSPR_ARCH_SUPPORT # spidermonkey -> libnspr

package/polkit/Config.in line 11

Quoted 10 lines
package/polkit/Config.in +5 -3
+	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 -> pthread_getattr_np()
 	depends on BR2_USE_MMU # libglib2
-	depends on BR2_TOOLCHAIN_HAS_THREADS # libglib2
-	depends on BR2_TOOLCHAIN_USES_GLIBC
 	depends on BR2_USE_WCHAR # libglib2
-	select BR2_PACKAGE_LIBGLIB2
+	depends on !BR2_STATIC_LIBS # spidermonkey -> dlopen()
+	depends on !BR2_TOOLCHAIN_USES_UCLIBC # spidermonkey -> fenv

You don't really have to detail the transitive dependencies, i.e no need to repeat dlopen(), fenv, etc.

Quoted 10 lines
package/polkit/Config.in +2 -0
 	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
@@ -13,6 +19,10 @@ config BR2_PACKAGE_POLKIT
 
 	  http://www.freedesktop.org/wiki/Software/polkit
 

package/polkit/Config.in config BR2_PACKAGE_POLKIT · line 28

Quoted 10 lines
package/polkit/Config.in +7 -3
-comment "polkit needs a toolchain w/ wchar, threads"
-	depends on BR2_USE_MMU
-	depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS
+comment "polkit needs a glibc or musl toolchain with C++, wchar, dynamic library, NPTL, gcc >= 4.9"
+	depends on BR2_TOOLCHAIN_USES_UCLIBC
+	depends on BR2_PACKAGE_LIBNSPR_ARCH_SUPPORT
+	depends on BR2_PACKAGE_SPIDERMONKEY_ARCH_SUPPORTS
+	depends on BR2_USE_MMU || !BR2_USE_WCHAR
+	depends on !BR2_INSTALL_LIBSTDCPP || BR2_STATIC_LIBS || \
+	!BR2_TOOLCHAIN_HAS_THREADS_NPTL || !BR2_TOOLCHAIN_GCC_AT_LEAST_4_9

Please also fix this, as I reported on the spidermonkey patch.

package/polkit/Config.in

Quoted 8 lines

# We could also support --with-authfw=pam
POLKIT_CONF_OPTS = \

package/polkit/Config.in +2 -1
 	--with-authfw=shadow \
 	--with-os-type=unknown \
 	--disable-man-pages \
-	--disable-examples
+	--disable-examples \
+	--enable-libsystemd-login=no \

--disable-libsystemd-login

package/polkit/Config.in

Quoted 1 line
package/polkit/Config.in +1 -0
+	--enable-libelogind=no

--disable-libelogind

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#5 lore raw

PATCH v2 3/4 package/polkit: support different authentication frameworks

In reply to aduskett at gmail.com

From: Adam Duskett <[email protected]>

Use pam if available, otherwise use shadow.

---
 package/polkit/polkit.mk | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
package/polkit/polkit.mk +6 -2
index 5d85ea9897..4135a64d6b 100644
@@ -13,13 +13,17 @@ POLKIT_INSTALL_STAGING = YES
 
 POLKIT_DEPENDENCIES = libglib2 host-intltool expat spidermonkey
 
-# We could also support --with-authfw=pam
 POLKIT_CONF_OPTS = \
-	--with-authfw=shadow \
 	--with-os-type=unknown \
 	--disable-man-pages \
 	--disable-examples \
 	--enable-libsystemd-login=no \
 	--enable-libelogind=no
 
+ifeq ($(BR2_PACKAGE_LINUX_PAM),y)
+POLKIT_CONF_OPTS += --with-authfw=pam
+else
+POLKIT_CONF_OPTS += --with-authfw=shadow
+endif
+
 $(eval $(autotools-package))
Signature · 1 line
2.23.0
#6 lore raw

PATCH v2 4/4 package/polkit: enable systemd login support

In reply to aduskett at gmail.com

From: Adam Duskett <[email protected]>

If systemd-logind is selected, enable libsystemd-login support.

---
 package/polkit/polkit.mk | 6 ++++++
 1 file changed, 6 insertions(+)
package/polkit/polkit.mk +6 -0
index 4135a64d6b..5e04c0908c 100644
@@ -26,4 +26,10 @@ else
 POLKIT_CONF_OPTS += --with-authfw=shadow
 endif
 
+ifeq ($(BR2_PACKAGE_SYSTEMD_LOGIND),y)
+POLKIT_DEPENDENCIES += systemd
+POLKIT_CONF_OPTS += \
+	--enable-libsystemd-login=yes
+endif
+
 $(eval $(autotools-package))
Signature · 1 line
2.23.0
#7 lore raw

PATCH v2 4/4 package/polkit: enable systemd login support

Quoted 14 lines · On Sun, 24 Nov 2019 13:48:23 -0800 aduskett at gmail.com wrote:

From: Adam Duskett <[email protected]>

If systemd-logind is selected, enable libsystemd-login support.

---
 package/polkit/polkit.mk | 6 ++++++
 1 file changed, 6 insertions(+)
package/polkit/polkit.mk +0 -0
index 4135a64d6b..5e04c0908c 100644

package/polkit/polkit.mk else · line 32

Quoted 7 lines
package/polkit/polkit.mk +4 -0
@@ -26,4 +26,10 @@ else
 POLKIT_CONF_OPTS += --with-authfw=shadow
 endif
 
+ifeq ($(BR2_PACKAGE_SYSTEMD_LOGIND),y)
+POLKIT_DEPENDENCIES += systemd
+POLKIT_CONF_OPTS += \
+	--enable-libsystemd-login=yes

Just --enable-libsystemd-login, and then have an else clause with --disable-libsystemd-login (and drop if from the unconditional POLKIT_CONF_OPTS assignment).

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com