kumquat-buildroot/package/spidermonkey/0002-allow-building-in-tree.patch
Adam Duskett 335c0bc610 package/spidermonkey: new package
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 10 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.

Signed-off-by: Adam Duskett <aduskett@greenlots.com>
[Thomas: adjust how the libnspr arch dependency is handled]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2019-11-25 21:18:37 +01:00

48 lines
1.9 KiB
Diff

From 07d40f72e1ed1d84a5ddd98ae8490d41a2e19c46 Mon Sep 17 00:00:00 2001
From: Arjan van de Ven <arjan@linux.intel.com>
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 <arjan@linux.intel.com>
Signed-off-by: Adam Duskett <aduskett@gmail.com>
---
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