From e764ca5214afe7831a54184b93b9ba6882605165 Mon Sep 17 00:00:00 2001 From: Andreas Müller Date: Mon, 1 Nov 2021 12:49:06 +0100 Subject: mozjs: Move back to recipes-extended - no meta-python specifics required MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Andreas Müller Signed-off-by: Khem Raj --- .../0001-Cargo.toml-do-not-abort-on-panic.patch | 29 --------- ...t-use-autoconf-s-config.sub-to-canonicali.patch | 28 --------- ...oz.configure-do-not-look-for-llvm-objdump.patch | 43 ------------- ...ure-do-not-try-to-find-a-suitable-upstrea.patch | 65 -------------------- .../mozjs/mozjs/0004-use-asm-sgidefs.h.patch | 35 ----------- .../mozjs/mozjs/fix-musl-build.patch | 15 ----- .../mozjs/mozjs/nojit-32bit-arch-fix.patch | 21 ------- .../recipes-extended/mozjs/mozjs/riscv32.patch | 45 -------------- .../recipes-extended/mozjs/mozjs_91.2.0.bb | 71 ---------------------- .../0001-Cargo.toml-do-not-abort-on-panic.patch | 29 +++++++++ ...t-use-autoconf-s-config.sub-to-canonicali.patch | 28 +++++++++ ...oz.configure-do-not-look-for-llvm-objdump.patch | 43 +++++++++++++ ...ure-do-not-try-to-find-a-suitable-upstrea.patch | 65 ++++++++++++++++++++ .../mozjs/mozjs/0004-use-asm-sgidefs.h.patch | 35 +++++++++++ .../mozjs/mozjs/fix-musl-build.patch | 15 +++++ .../mozjs/mozjs/nojit-32bit-arch-fix.patch | 21 +++++++ meta-oe/recipes-extended/mozjs/mozjs/riscv32.patch | 45 ++++++++++++++ meta-oe/recipes-extended/mozjs/mozjs_91.2.0.bb | 71 ++++++++++++++++++++++ 18 files changed, 352 insertions(+), 352 deletions(-) delete mode 100644 meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs/0001-Cargo.toml-do-not-abort-on-panic.patch delete mode 100644 meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs/0001-build-do-not-use-autoconf-s-config.sub-to-canonicali.patch delete mode 100644 meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs/0002-moz.configure-do-not-look-for-llvm-objdump.patch delete mode 100644 meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs/0003-rust.configure-do-not-try-to-find-a-suitable-upstrea.patch delete mode 100644 meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs/0004-use-asm-sgidefs.h.patch delete mode 100644 meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs/fix-musl-build.patch delete mode 100644 meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs/nojit-32bit-arch-fix.patch delete mode 100644 meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs/riscv32.patch delete mode 100644 meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs_91.2.0.bb create mode 100644 meta-oe/recipes-extended/mozjs/mozjs/0001-Cargo.toml-do-not-abort-on-panic.patch create mode 100644 meta-oe/recipes-extended/mozjs/mozjs/0001-build-do-not-use-autoconf-s-config.sub-to-canonicali.patch create mode 100644 meta-oe/recipes-extended/mozjs/mozjs/0002-moz.configure-do-not-look-for-llvm-objdump.patch create mode 100644 meta-oe/recipes-extended/mozjs/mozjs/0003-rust.configure-do-not-try-to-find-a-suitable-upstrea.patch create mode 100644 meta-oe/recipes-extended/mozjs/mozjs/0004-use-asm-sgidefs.h.patch create mode 100644 meta-oe/recipes-extended/mozjs/mozjs/fix-musl-build.patch create mode 100644 meta-oe/recipes-extended/mozjs/mozjs/nojit-32bit-arch-fix.patch create mode 100644 meta-oe/recipes-extended/mozjs/mozjs/riscv32.patch create mode 100644 meta-oe/recipes-extended/mozjs/mozjs_91.2.0.bb diff --git a/meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs/0001-Cargo.toml-do-not-abort-on-panic.patch b/meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs/0001-Cargo.toml-do-not-abort-on-panic.patch deleted file mode 100644 index e09848f403..0000000000 --- a/meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs/0001-Cargo.toml-do-not-abort-on-panic.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 9e37248870b2b955293754933c789ca00bca06ef Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin -Date: Fri, 1 Oct 2021 13:00:24 +0200 -Subject: [PATCH] Cargo.toml: do not abort on panic - -OE's rust is configured to unwind, and this setting clashes with it/ - -Upstream-Status: Inappropriate [oe-core specific] -Signed-off-by: Alexander Kanavin ---- - Cargo.toml | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - ---- a/Cargo.toml -+++ b/Cargo.toml -@@ -51,13 +51,11 @@ opt-level = 1 - rpath = false - lto = false - debug-assertions = true --panic = "abort" - - [profile.release] - opt-level = 2 - rpath = false - debug-assertions = false --panic = "abort" - - # Optimize build dependencies, because bindgen and proc macros / style - # compilation take more to run than to build otherwise. diff --git a/meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs/0001-build-do-not-use-autoconf-s-config.sub-to-canonicali.patch b/meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs/0001-build-do-not-use-autoconf-s-config.sub-to-canonicali.patch deleted file mode 100644 index a2ccf6b916..0000000000 --- a/meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs/0001-build-do-not-use-autoconf-s-config.sub-to-canonicali.patch +++ /dev/null @@ -1,28 +0,0 @@ -From e5b95b3918588e2930c9af7ba304c57e871b2d55 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin -Date: Thu, 7 Oct 2021 12:44:18 +0200 -Subject: [PATCH] build: do not use autoconf's config.sub to 'canonicalize' - names - -The outcome is that processed names no longer match our custom rust -target definitions, and the build fails. - -Upstream-Status: Inappropriate [oe-core specific] -Signed-off-by: Alexander Kanavin ---- - build/moz.configure/init.configure | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/build/moz.configure/init.configure b/build/moz.configure/init.configure -index 3a164c6558..99dfc9054a 100644 ---- a/build/moz.configure/init.configure -+++ b/build/moz.configure/init.configure -@@ -823,7 +823,7 @@ def help_host_target(help, host, target): - - def config_sub(shell, triplet): - config_sub = os.path.join(os.path.dirname(__file__), "..", "autoconf", "config.sub") -- return check_cmd_output(shell, config_sub, triplet).strip() -+ return triplet - - - @depends("--host", shell) diff --git a/meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs/0002-moz.configure-do-not-look-for-llvm-objdump.patch b/meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs/0002-moz.configure-do-not-look-for-llvm-objdump.patch deleted file mode 100644 index 6ff83e3bb2..0000000000 --- a/meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs/0002-moz.configure-do-not-look-for-llvm-objdump.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 0133ddb86eb6e0741e02b0032c41468db6438530 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin -Date: Fri, 1 Oct 2021 13:01:10 +0200 -Subject: [PATCH] moz.configure: do not look for llvm-objdump - -This avoid dragging in a dependency that isn't even needed -for js builds. - -Upstream-Status: Inappropriate [oe-core specific] -Signed-off-by: Alexander Kanavin ---- - moz.configure | 18 +++++++++--------- - 1 file changed, 9 insertions(+), 9 deletions(-) - -diff --git a/moz.configure b/moz.configure -index fc66b520d0..15de9a2ee0 100755 ---- a/moz.configure -+++ b/moz.configure -@@ -994,15 +994,15 @@ def llvm_objdump(host_c_compiler, c_compiler, bindgen_config_paths): - return (llvm_objdump,) - - --llvm_objdump = check_prog( -- "LLVM_OBJDUMP", -- llvm_objdump, -- what="llvm-objdump", -- when="--enable-compile-environment", -- paths=clang_search_path, --) -- --add_old_configure_assignment("LLVM_OBJDUMP", llvm_objdump) -+#llvm_objdump = check_prog( -+# "LLVM_OBJDUMP", -+# llvm_objdump, -+# what="llvm-objdump", -+# when="--enable-compile-environment", -+# paths=clang_search_path, -+#) -+ -+#add_old_configure_assignment("LLVM_OBJDUMP", llvm_objdump) - - - option("--enable-dtrace", help="Build with dtrace support") diff --git a/meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs/0003-rust.configure-do-not-try-to-find-a-suitable-upstrea.patch b/meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs/0003-rust.configure-do-not-try-to-find-a-suitable-upstrea.patch deleted file mode 100644 index c440bf178f..0000000000 --- a/meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs/0003-rust.configure-do-not-try-to-find-a-suitable-upstrea.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 749ba11fd6a69c8180945d4866415d16ae06a9c0 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin -Date: Fri, 1 Oct 2021 13:02:17 +0200 -Subject: [PATCH] rust.configure: do not try to find a suitable upstream target - -OE is using custom targets and so this is bound to fail. - -Upstream-Status: Inapppropriate [oe-core specific] -Signed-off-by: Alexander Kanavin ---- - build/moz.configure/rust.configure | 34 ++---------------------------- - 1 file changed, 2 insertions(+), 32 deletions(-) - -diff --git a/build/moz.configure/rust.configure b/build/moz.configure/rust.configure -index cd77d72bb7..4b6481cbe3 100644 ---- a/build/moz.configure/rust.configure -+++ b/build/moz.configure/rust.configure -@@ -459,33 +459,7 @@ def assert_rust_compile(host_or_target, rustc_target, rustc): - def rust_host_triple( - rustc, host, compiler_info, rustc_host, rust_supported_targets, arm_target - ): -- rustc_target = detect_rustc_target( -- host, compiler_info, arm_target, rust_supported_targets -- ) -- if rustc_target != rustc_host: -- if host.alias == rustc_target: -- configure_host = host.alias -- else: -- configure_host = "{}/{}".format(host.alias, rustc_target) -- die( -- dedent( -- """\ -- The rust compiler host ({rustc}) is not suitable for the configure host ({configure}). -- -- You can solve this by: -- * Set your configure host to match the rust compiler host by editing your -- mozconfig and adding "ac_add_options --host={rustc}". -- * Or, install the rust toolchain for {configure}, if supported, by running -- "rustup default stable-{rustc_target}" -- """.format( -- rustc=rustc_host, -- configure=configure_host, -- rustc_target=rustc_target, -- ) -- ) -- ) -- assert_rust_compile(host, rustc_target, rustc) -- return rustc_target -+ return rustc_host - - - @depends( -@@ -495,11 +469,7 @@ def rust_host_triple( - def rust_target_triple( - rustc, target, compiler_info, rust_supported_targets, arm_target - ): -- rustc_target = detect_rustc_target( -- target, compiler_info, arm_target, rust_supported_targets -- ) -- assert_rust_compile(target, rustc_target, rustc) -- return rustc_target -+ return target.alias - - - set_config("RUST_TARGET", rust_target_triple) diff --git a/meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs/0004-use-asm-sgidefs.h.patch b/meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs/0004-use-asm-sgidefs.h.patch deleted file mode 100644 index b56f0b95b5..0000000000 --- a/meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs/0004-use-asm-sgidefs.h.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 65acc8800dba7e10da882871d4648241805c47ce Mon Sep 17 00:00:00 2001 -From: Andre McCurdy -Date: Sat, 30 Apr 2016 15:29:06 -0700 -Subject: [PATCH] use - -Build fix for MIPS with musl libc - -The MIPS specific header is provided by glibc and uclibc -but not by musl. Regardless of the libc, the kernel headers provide - which provides the same definitions, so use that -instead. - -Upstream-Status: Pending - -[Vincent: -Taken from: https://sourceware.org/bugzilla/show_bug.cgi?id=21070] - -Signed-off-by: Andre McCurdy -Signed-off-by: Khem Raj -Signed-off-by: Vicente Olivert Riera ---- - gdb/mips-linux-nat.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/mfbt/RandomNum.cpp -+++ b/mfbt/RandomNum.cpp -@@ -52,7 +52,7 @@ extern "C" BOOLEAN NTAPI RtlGenRandom(PV - # 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/meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs/fix-musl-build.patch b/meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs/fix-musl-build.patch deleted file mode 100644 index c0834af589..0000000000 --- a/meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs/fix-musl-build.patch +++ /dev/null @@ -1,15 +0,0 @@ -Upstream: No -Reason: mozjs60 miscompiles on musl if built with HAVE_THREAD_TLS_KEYWORD: -https://github.com/void-linux/void-packages/issues/2598 ---- a/js/src/old-configure.in -+++ b/js/src/old-configure.in -@@ -1072,6 +1072,9 @@ if test "$ac_cv_thread_keyword" = yes; t - *-android*|*-linuxandroid*) - : - ;; -+ *-musl*) -+ : -+ ;; - *) - AC_DEFINE(HAVE_THREAD_TLS_KEYWORD) - ;; diff --git a/meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs/nojit-32bit-arch-fix.patch b/meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs/nojit-32bit-arch-fix.patch deleted file mode 100644 index f308b4863f..0000000000 --- a/meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs/nojit-32bit-arch-fix.patch +++ /dev/null @@ -1,21 +0,0 @@ -Fix build when JIT is disabled on 32bit systems - -This fixes a compile time assert -js/src/wasm/WasmFrame.cpp:57:3: error: static_assert failed due to requirement '(__builtin_offsetof(js::wasm::DebugFrame, frame_) + sizeof(js::wasm::Frame)) % Alignment == 0' "Aligned after pushing DebugFrame" - static_assert((offsetof(DebugFrame, frame_) + sizeof(Frame)) % Alignment == 0, - ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Upstream-Status: Pending -Signed-off-by: Khem Raj - ---- a/js/src/wasm/WasmFrame.h -+++ b/js/src/wasm/WasmFrame.h -@@ -230,6 +230,8 @@ class DebugFrame { - // Avoid -Wunused-private-field warnings. - protected: - #if defined(JS_CODEGEN_MIPS32) || defined(JS_CODEGEN_ARM) || \ -+ (defined(JS_CODEGEN_NONE) && \ -+ (defined(__riscv) && __riscv_xlen == 32) || defined(__mips__)) || \ - defined(JS_CODEGEN_X86) || defined(__wasi__) - // See alignmentStaticAsserts(). For MIPS32, ARM32 and X86 DebugFrame is only - // 4-byte aligned, so we add another word to get up to 8-byte diff --git a/meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs/riscv32.patch b/meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs/riscv32.patch deleted file mode 100644 index fe9c332a00..0000000000 --- a/meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs/riscv32.patch +++ /dev/null @@ -1,45 +0,0 @@ -Add RISCV32 support - -Upstream-Status: Pending -Signed-off-by: Khem Raj - ---- a/build/moz.configure/init.configure -+++ b/build/moz.configure/init.configure -@@ -765,6 +765,9 @@ def split_triplet(triplet, allow_msvc=Fa - elif cpu.startswith("aarch64"): - canonical_cpu = "aarch64" - endianness = "little" -+ elif cpu in ("riscv32", "riscv32gc"): -+ canonical_cpu = "riscv32" -+ endianness = "little" - elif cpu in ("riscv64", "riscv64gc"): - canonical_cpu = "riscv64" - endianness = "little" ---- a/python/mozbuild/mozbuild/configure/constants.py -+++ b/python/mozbuild/mozbuild/configure/constants.py -@@ -52,6 +52,7 @@ CPU_bitness = { - "mips64": 64, - "ppc": 32, - "ppc64": 64, -+ 'riscv32': 32, - "riscv64": 64, - "s390": 32, - "s390x": 64, -@@ -94,6 +95,7 @@ CPU_preprocessor_checks = OrderedDict( - ("m68k", "__m68k__"), - ("mips64", "__mips64"), - ("mips32", "__mips__"), -+ ("riscv32", "__riscv && __riscv_xlen == 32"), - ("riscv64", "__riscv && __riscv_xlen == 64"), - ("sh4", "__sh__"), - ("wasm32", "__wasm32__"), ---- a/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py -+++ b/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py -@@ -1186,6 +1186,7 @@ class LinuxCrossCompileToolchainTest(Bas - "m68k-unknown-linux-gnu": big_endian + {"__m68k__": 1}, - "mips64-unknown-linux-gnuabi64": big_endian + {"__mips64": 1, "__mips__": 1}, - "mips-unknown-linux-gnu": big_endian + {"__mips__": 1}, -+ "riscv32-unknown-linux-gnu": little_endian + {"__riscv": 1, "__riscv_xlen": 32}, - "riscv64-unknown-linux-gnu": little_endian + {"__riscv": 1, "__riscv_xlen": 64}, - "sh4-unknown-linux-gnu": little_endian + {"__sh__": 1}, - } diff --git a/meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs_91.2.0.bb b/meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs_91.2.0.bb deleted file mode 100644 index a1a5ddc3b0..0000000000 --- a/meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs_91.2.0.bb +++ /dev/null @@ -1,71 +0,0 @@ -SUMMARY = "SpiderMonkey is Mozilla's JavaScript engine written in C/C++" -HOMEPAGE = "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey" -LICENSE = "MPL-2.0" -LIC_FILES_CHKSUM = "file://LICENSE;md5=dc9b6ecd19a14a54a628edaaf23733bf" - -SRC_URI = "https://archive.mozilla.org/pub/firefox/releases/${PV}esr/source/firefox-${PV}esr.source.tar.xz \ - file://0001-Cargo.toml-do-not-abort-on-panic.patch \ - file://0002-moz.configure-do-not-look-for-llvm-objdump.patch \ - file://0003-rust.configure-do-not-try-to-find-a-suitable-upstrea.patch \ - file://0004-use-asm-sgidefs.h.patch \ - file://fix-musl-build.patch \ - file://0001-build-do-not-use-autoconf-s-config.sub-to-canonicali.patch \ - file://riscv32.patch \ - file://nojit-32bit-arch-fix.patch \ - " -SRC_URI[sha256sum] = "3ef3cfd321d0c2c80ee1b41b8baf7a1ea4daf93c29e1377274933440ff5e42c3" - -S = "${WORKDIR}/firefox-${@d.getVar("PV").replace("esr", "")}" - -inherit pkgconfig perlnative python3native rust - -DEPENDS += "zlib cargo-native python3" - -B = "${WORKDIR}/build" - -export PYTHONPATH = "${S}/build:${S}/third_party/python/PyYAML/lib3:${S}/testing/mozbase/mozfile:${S}/python/mozboot:${S}/third_party/python/distro:${S}/testing/mozbase/mozinfo:${S}/config:${S}/testing/mozbase/manifestparser:${S}/third_party/python/pytoml:${S}/testing/mozbase/mozprocess:${S}/third_party/python/six:${S}/python/mozbuild:${S}/python/mozbuild/mozbuild:${S}/python/mach:${S}/third_party/python/jsmin:${S}/python/mozversioncontrol" - -export HOST_CC = "${BUILD_CC}" -export HOST_CXX = "${BUILD_CXX}" -export HOST_CFLAGS = "${BUILD_CFLAGS}" -export HOST_CPPFLAGS = "${BUILD_CPPFLAGS}" -export HOST_CXXFLAGS = "${BUILD_CXXFLAGS}" - -export AS = "${CC}" - -export RUSTFLAGS - -JIT ?= "" - -JIT:mipsarch = "--disable-jit" - -do_configure() { - cd ${B} - python3 ${S}/configure.py \ - --enable-project=js \ - --target=${HOST_SYS} \ - --host=${BUILD_SYS} \ - --prefix=${prefix} \ - --libdir=${libdir} \ - --disable-jemalloc \ - ${JIT} - -} - -do_install() { - oe_runmake 'DESTDIR=${D}' install -} - -inherit multilib_script multilib_header - -MULTILIB_SCRIPTS += " ${PN}-dev:${bindir}/js91-config" - -do_install:append() { - oe_multilib_header mozjs-91/js-config.h - sed -e 's@${STAGING_DIR_HOST}@@g' \ - -i ${D}${bindir}/js91-config -} - -PACKAGES =+ "lib${BPN}-staticdev lib${BPN}" -FILES:lib${BPN}-staticdev += "${libdir}/libjs_static.ajs" -FILES:lib${BPN} += "${libdir}/lib*" diff --git a/meta-oe/recipes-extended/mozjs/mozjs/0001-Cargo.toml-do-not-abort-on-panic.patch b/meta-oe/recipes-extended/mozjs/mozjs/0001-Cargo.toml-do-not-abort-on-panic.patch new file mode 100644 index 0000000000..e09848f403 --- /dev/null +++ b/meta-oe/recipes-extended/mozjs/mozjs/0001-Cargo.toml-do-not-abort-on-panic.patch @@ -0,0 +1,29 @@ +From 9e37248870b2b955293754933c789ca00bca06ef Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Fri, 1 Oct 2021 13:00:24 +0200 +Subject: [PATCH] Cargo.toml: do not abort on panic + +OE's rust is configured to unwind, and this setting clashes with it/ + +Upstream-Status: Inappropriate [oe-core specific] +Signed-off-by: Alexander Kanavin +--- + Cargo.toml | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -51,13 +51,11 @@ opt-level = 1 + rpath = false + lto = false + debug-assertions = true +-panic = "abort" + + [profile.release] + opt-level = 2 + rpath = false + debug-assertions = false +-panic = "abort" + + # Optimize build dependencies, because bindgen and proc macros / style + # compilation take more to run than to build otherwise. diff --git a/meta-oe/recipes-extended/mozjs/mozjs/0001-build-do-not-use-autoconf-s-config.sub-to-canonicali.patch b/meta-oe/recipes-extended/mozjs/mozjs/0001-build-do-not-use-autoconf-s-config.sub-to-canonicali.patch new file mode 100644 index 0000000000..a2ccf6b916 --- /dev/null +++ b/meta-oe/recipes-extended/mozjs/mozjs/0001-build-do-not-use-autoconf-s-config.sub-to-canonicali.patch @@ -0,0 +1,28 @@ +From e5b95b3918588e2930c9af7ba304c57e871b2d55 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Thu, 7 Oct 2021 12:44:18 +0200 +Subject: [PATCH] build: do not use autoconf's config.sub to 'canonicalize' + names + +The outcome is that processed names no longer match our custom rust +target definitions, and the build fails. + +Upstream-Status: Inappropriate [oe-core specific] +Signed-off-by: Alexander Kanavin +--- + build/moz.configure/init.configure | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/build/moz.configure/init.configure b/build/moz.configure/init.configure +index 3a164c6558..99dfc9054a 100644 +--- a/build/moz.configure/init.configure ++++ b/build/moz.configure/init.configure +@@ -823,7 +823,7 @@ def help_host_target(help, host, target): + + def config_sub(shell, triplet): + config_sub = os.path.join(os.path.dirname(__file__), "..", "autoconf", "config.sub") +- return check_cmd_output(shell, config_sub, triplet).strip() ++ return triplet + + + @depends("--host", shell) diff --git a/meta-oe/recipes-extended/mozjs/mozjs/0002-moz.configure-do-not-look-for-llvm-objdump.patch b/meta-oe/recipes-extended/mozjs/mozjs/0002-moz.configure-do-not-look-for-llvm-objdump.patch new file mode 100644 index 0000000000..6ff83e3bb2 --- /dev/null +++ b/meta-oe/recipes-extended/mozjs/mozjs/0002-moz.configure-do-not-look-for-llvm-objdump.patch @@ -0,0 +1,43 @@ +From 0133ddb86eb6e0741e02b0032c41468db6438530 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Fri, 1 Oct 2021 13:01:10 +0200 +Subject: [PATCH] moz.configure: do not look for llvm-objdump + +This avoid dragging in a dependency that isn't even needed +for js builds. + +Upstream-Status: Inappropriate [oe-core specific] +Signed-off-by: Alexander Kanavin +--- + moz.configure | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +diff --git a/moz.configure b/moz.configure +index fc66b520d0..15de9a2ee0 100755 +--- a/moz.configure ++++ b/moz.configure +@@ -994,15 +994,15 @@ def llvm_objdump(host_c_compiler, c_compiler, bindgen_config_paths): + return (llvm_objdump,) + + +-llvm_objdump = check_prog( +- "LLVM_OBJDUMP", +- llvm_objdump, +- what="llvm-objdump", +- when="--enable-compile-environment", +- paths=clang_search_path, +-) +- +-add_old_configure_assignment("LLVM_OBJDUMP", llvm_objdump) ++#llvm_objdump = check_prog( ++# "LLVM_OBJDUMP", ++# llvm_objdump, ++# what="llvm-objdump", ++# when="--enable-compile-environment", ++# paths=clang_search_path, ++#) ++ ++#add_old_configure_assignment("LLVM_OBJDUMP", llvm_objdump) + + + option("--enable-dtrace", help="Build with dtrace support") diff --git a/meta-oe/recipes-extended/mozjs/mozjs/0003-rust.configure-do-not-try-to-find-a-suitable-upstrea.patch b/meta-oe/recipes-extended/mozjs/mozjs/0003-rust.configure-do-not-try-to-find-a-suitable-upstrea.patch new file mode 100644 index 0000000000..c440bf178f --- /dev/null +++ b/meta-oe/recipes-extended/mozjs/mozjs/0003-rust.configure-do-not-try-to-find-a-suitable-upstrea.patch @@ -0,0 +1,65 @@ +From 749ba11fd6a69c8180945d4866415d16ae06a9c0 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Fri, 1 Oct 2021 13:02:17 +0200 +Subject: [PATCH] rust.configure: do not try to find a suitable upstream target + +OE is using custom targets and so this is bound to fail. + +Upstream-Status: Inapppropriate [oe-core specific] +Signed-off-by: Alexander Kanavin +--- + build/moz.configure/rust.configure | 34 ++---------------------------- + 1 file changed, 2 insertions(+), 32 deletions(-) + +diff --git a/build/moz.configure/rust.configure b/build/moz.configure/rust.configure +index cd77d72bb7..4b6481cbe3 100644 +--- a/build/moz.configure/rust.configure ++++ b/build/moz.configure/rust.configure +@@ -459,33 +459,7 @@ def assert_rust_compile(host_or_target, rustc_target, rustc): + def rust_host_triple( + rustc, host, compiler_info, rustc_host, rust_supported_targets, arm_target + ): +- rustc_target = detect_rustc_target( +- host, compiler_info, arm_target, rust_supported_targets +- ) +- if rustc_target != rustc_host: +- if host.alias == rustc_target: +- configure_host = host.alias +- else: +- configure_host = "{}/{}".format(host.alias, rustc_target) +- die( +- dedent( +- """\ +- The rust compiler host ({rustc}) is not suitable for the configure host ({configure}). +- +- You can solve this by: +- * Set your configure host to match the rust compiler host by editing your +- mozconfig and adding "ac_add_options --host={rustc}". +- * Or, install the rust toolchain for {configure}, if supported, by running +- "rustup default stable-{rustc_target}" +- """.format( +- rustc=rustc_host, +- configure=configure_host, +- rustc_target=rustc_target, +- ) +- ) +- ) +- assert_rust_compile(host, rustc_target, rustc) +- return rustc_target ++ return rustc_host + + + @depends( +@@ -495,11 +469,7 @@ def rust_host_triple( + def rust_target_triple( + rustc, target, compiler_info, rust_supported_targets, arm_target + ): +- rustc_target = detect_rustc_target( +- target, compiler_info, arm_target, rust_supported_targets +- ) +- assert_rust_compile(target, rustc_target, rustc) +- return rustc_target ++ return target.alias + + + set_config("RUST_TARGET", rust_target_triple) diff --git a/meta-oe/recipes-extended/mozjs/mozjs/0004-use-asm-sgidefs.h.patch b/meta-oe/recipes-extended/mozjs/mozjs/0004-use-asm-sgidefs.h.patch new file mode 100644 index 0000000000..b56f0b95b5 --- /dev/null +++ b/meta-oe/recipes-extended/mozjs/mozjs/0004-use-asm-sgidefs.h.patch @@ -0,0 +1,35 @@ +From 65acc8800dba7e10da882871d4648241805c47ce Mon Sep 17 00:00:00 2001 +From: Andre McCurdy +Date: Sat, 30 Apr 2016 15:29:06 -0700 +Subject: [PATCH] use + +Build fix for MIPS with musl libc + +The MIPS specific header is provided by glibc and uclibc +but not by musl. Regardless of the libc, the kernel headers provide + which provides the same definitions, so use that +instead. + +Upstream-Status: Pending + +[Vincent: +Taken from: https://sourceware.org/bugzilla/show_bug.cgi?id=21070] + +Signed-off-by: Andre McCurdy +Signed-off-by: Khem Raj +Signed-off-by: Vicente Olivert Riera +--- + gdb/mips-linux-nat.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/mfbt/RandomNum.cpp ++++ b/mfbt/RandomNum.cpp +@@ -52,7 +52,7 @@ extern "C" BOOLEAN NTAPI RtlGenRandom(PV + # 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/meta-oe/recipes-extended/mozjs/mozjs/fix-musl-build.patch b/meta-oe/recipes-extended/mozjs/mozjs/fix-musl-build.patch new file mode 100644 index 0000000000..c0834af589 --- /dev/null +++ b/meta-oe/recipes-extended/mozjs/mozjs/fix-musl-build.patch @@ -0,0 +1,15 @@ +Upstream: No +Reason: mozjs60 miscompiles on musl if built with HAVE_THREAD_TLS_KEYWORD: +https://github.com/void-linux/void-packages/issues/2598 +--- a/js/src/old-configure.in ++++ b/js/src/old-configure.in +@@ -1072,6 +1072,9 @@ if test "$ac_cv_thread_keyword" = yes; t + *-android*|*-linuxandroid*) + : + ;; ++ *-musl*) ++ : ++ ;; + *) + AC_DEFINE(HAVE_THREAD_TLS_KEYWORD) + ;; diff --git a/meta-oe/recipes-extended/mozjs/mozjs/nojit-32bit-arch-fix.patch b/meta-oe/recipes-extended/mozjs/mozjs/nojit-32bit-arch-fix.patch new file mode 100644 index 0000000000..f308b4863f --- /dev/null +++ b/meta-oe/recipes-extended/mozjs/mozjs/nojit-32bit-arch-fix.patch @@ -0,0 +1,21 @@ +Fix build when JIT is disabled on 32bit systems + +This fixes a compile time assert +js/src/wasm/WasmFrame.cpp:57:3: error: static_assert failed due to requirement '(__builtin_offsetof(js::wasm::DebugFrame, frame_) + sizeof(js::wasm::Frame)) % Alignment == 0' "Aligned after pushing DebugFrame" + static_assert((offsetof(DebugFrame, frame_) + sizeof(Frame)) % Alignment == 0, + ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Upstream-Status: Pending +Signed-off-by: Khem Raj + +--- a/js/src/wasm/WasmFrame.h ++++ b/js/src/wasm/WasmFrame.h +@@ -230,6 +230,8 @@ class DebugFrame { + // Avoid -Wunused-private-field warnings. + protected: + #if defined(JS_CODEGEN_MIPS32) || defined(JS_CODEGEN_ARM) || \ ++ (defined(JS_CODEGEN_NONE) && \ ++ (defined(__riscv) && __riscv_xlen == 32) || defined(__mips__)) || \ + defined(JS_CODEGEN_X86) || defined(__wasi__) + // See alignmentStaticAsserts(). For MIPS32, ARM32 and X86 DebugFrame is only + // 4-byte aligned, so we add another word to get up to 8-byte diff --git a/meta-oe/recipes-extended/mozjs/mozjs/riscv32.patch b/meta-oe/recipes-extended/mozjs/mozjs/riscv32.patch new file mode 100644 index 0000000000..fe9c332a00 --- /dev/null +++ b/meta-oe/recipes-extended/mozjs/mozjs/riscv32.patch @@ -0,0 +1,45 @@ +Add RISCV32 support + +Upstream-Status: Pending +Signed-off-by: Khem Raj + +--- a/build/moz.configure/init.configure ++++ b/build/moz.configure/init.configure +@@ -765,6 +765,9 @@ def split_triplet(triplet, allow_msvc=Fa + elif cpu.startswith("aarch64"): + canonical_cpu = "aarch64" + endianness = "little" ++ elif cpu in ("riscv32", "riscv32gc"): ++ canonical_cpu = "riscv32" ++ endianness = "little" + elif cpu in ("riscv64", "riscv64gc"): + canonical_cpu = "riscv64" + endianness = "little" +--- a/python/mozbuild/mozbuild/configure/constants.py ++++ b/python/mozbuild/mozbuild/configure/constants.py +@@ -52,6 +52,7 @@ CPU_bitness = { + "mips64": 64, + "ppc": 32, + "ppc64": 64, ++ 'riscv32': 32, + "riscv64": 64, + "s390": 32, + "s390x": 64, +@@ -94,6 +95,7 @@ CPU_preprocessor_checks = OrderedDict( + ("m68k", "__m68k__"), + ("mips64", "__mips64"), + ("mips32", "__mips__"), ++ ("riscv32", "__riscv && __riscv_xlen == 32"), + ("riscv64", "__riscv && __riscv_xlen == 64"), + ("sh4", "__sh__"), + ("wasm32", "__wasm32__"), +--- a/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py ++++ b/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py +@@ -1186,6 +1186,7 @@ class LinuxCrossCompileToolchainTest(Bas + "m68k-unknown-linux-gnu": big_endian + {"__m68k__": 1}, + "mips64-unknown-linux-gnuabi64": big_endian + {"__mips64": 1, "__mips__": 1}, + "mips-unknown-linux-gnu": big_endian + {"__mips__": 1}, ++ "riscv32-unknown-linux-gnu": little_endian + {"__riscv": 1, "__riscv_xlen": 32}, + "riscv64-unknown-linux-gnu": little_endian + {"__riscv": 1, "__riscv_xlen": 64}, + "sh4-unknown-linux-gnu": little_endian + {"__sh__": 1}, + } diff --git a/meta-oe/recipes-extended/mozjs/mozjs_91.2.0.bb b/meta-oe/recipes-extended/mozjs/mozjs_91.2.0.bb new file mode 100644 index 0000000000..a1a5ddc3b0 --- /dev/null +++ b/meta-oe/recipes-extended/mozjs/mozjs_91.2.0.bb @@ -0,0 +1,71 @@ +SUMMARY = "SpiderMonkey is Mozilla's JavaScript engine written in C/C++" +HOMEPAGE = "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey" +LICENSE = "MPL-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=dc9b6ecd19a14a54a628edaaf23733bf" + +SRC_URI = "https://archive.mozilla.org/pub/firefox/releases/${PV}esr/source/firefox-${PV}esr.source.tar.xz \ + file://0001-Cargo.toml-do-not-abort-on-panic.patch \ + file://0002-moz.configure-do-not-look-for-llvm-objdump.patch \ + file://0003-rust.configure-do-not-try-to-find-a-suitable-upstrea.patch \ + file://0004-use-asm-sgidefs.h.patch \ + file://fix-musl-build.patch \ + file://0001-build-do-not-use-autoconf-s-config.sub-to-canonicali.patch \ + file://riscv32.patch \ + file://nojit-32bit-arch-fix.patch \ + " +SRC_URI[sha256sum] = "3ef3cfd321d0c2c80ee1b41b8baf7a1ea4daf93c29e1377274933440ff5e42c3" + +S = "${WORKDIR}/firefox-${@d.getVar("PV").replace("esr", "")}" + +inherit pkgconfig perlnative python3native rust + +DEPENDS += "zlib cargo-native python3" + +B = "${WORKDIR}/build" + +export PYTHONPATH = "${S}/build:${S}/third_party/python/PyYAML/lib3:${S}/testing/mozbase/mozfile:${S}/python/mozboot:${S}/third_party/python/distro:${S}/testing/mozbase/mozinfo:${S}/config:${S}/testing/mozbase/manifestparser:${S}/third_party/python/pytoml:${S}/testing/mozbase/mozprocess:${S}/third_party/python/six:${S}/python/mozbuild:${S}/python/mozbuild/mozbuild:${S}/python/mach:${S}/third_party/python/jsmin:${S}/python/mozversioncontrol" + +export HOST_CC = "${BUILD_CC}" +export HOST_CXX = "${BUILD_CXX}" +export HOST_CFLAGS = "${BUILD_CFLAGS}" +export HOST_CPPFLAGS = "${BUILD_CPPFLAGS}" +export HOST_CXXFLAGS = "${BUILD_CXXFLAGS}" + +export AS = "${CC}" + +export RUSTFLAGS + +JIT ?= "" + +JIT:mipsarch = "--disable-jit" + +do_configure() { + cd ${B} + python3 ${S}/configure.py \ + --enable-project=js \ + --target=${HOST_SYS} \ + --host=${BUILD_SYS} \ + --prefix=${prefix} \ + --libdir=${libdir} \ + --disable-jemalloc \ + ${JIT} + +} + +do_install() { + oe_runmake 'DESTDIR=${D}' install +} + +inherit multilib_script multilib_header + +MULTILIB_SCRIPTS += " ${PN}-dev:${bindir}/js91-config" + +do_install:append() { + oe_multilib_header mozjs-91/js-config.h + sed -e 's@${STAGING_DIR_HOST}@@g' \ + -i ${D}${bindir}/js91-config +} + +PACKAGES =+ "lib${BPN}-staticdev lib${BPN}" +FILES:lib${BPN}-staticdev += "${libdir}/libjs_static.ajs" +FILES:lib${BPN} += "${libdir}/lib*" -- cgit v1.2.3-54-g00ecf