335c0bc610
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>
48 lines
1.7 KiB
Plaintext
48 lines
1.7 KiB
Plaintext
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_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
|
|
|
|
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_TOOLCHAIN_GCC_AT_LEAST_4_9 || \
|
|
!BR2_USE_WCHAR
|