From 5ad300fe12288b0e2ecbbfca45af2e8e492bf089 Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Wed, 7 Oct 2020 22:40:49 +0200 Subject: [PATCH] - enhanced x32 patch; need to disable JIT-specific assert with JS_CODEGEN_NONE - added x32-rust patch (disable configure vs rustc host validation on x32) --- mozjs78-x32-rust.patch | 19 +++++++++++++++++++ mozjs78.spec | 4 ++++ x32.patch | 16 +++++++++++++++- 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 mozjs78-x32-rust.patch diff --git a/mozjs78-x32-rust.patch b/mozjs78-x32-rust.patch new file mode 100644 index 0000000..b9747de --- /dev/null +++ b/mozjs78-x32-rust.patch @@ -0,0 +1,19 @@ +--- firefox-78.2.0/build/moz.configure/rust.configure.orig 2020-08-17 20:33:34.000000000 +0200 ++++ firefox-78.2.0/build/moz.configure/rust.configure 2020-10-07 18:29:15.458050574 +0200 +@@ -406,16 +406,6 @@ + rust_host_triple = rust_triple_alias(host, host_c_compiler) + + +-@depends(host, rust_host_triple, rustc_info.host) +-def validate_rust_host_triple(host, rust_host, rustc_host): +- if rust_host != rustc_host: +- if host.alias == rust_host: +- configure_host = host.alias +- else: +- configure_host = '{}/{}'.format(host.alias, rust_host) +- die("The rust compiler host ({}) is not suitable for the configure host ({})." +- .format(rustc_host, configure_host)) +- + + set_config('RUST_TARGET', rust_target_triple) + set_config('RUST_HOST_TARGET', rust_host_triple) diff --git a/mozjs78.spec b/mozjs78.spec index 3671b82..e9b4e06 100644 --- a/mozjs78.spec +++ b/mozjs78.spec @@ -16,6 +16,7 @@ Patch0: copy-headers.patch Patch1: system-virtualenv.patch Patch2: include-configure-script.patch Patch3: x32.patch +Patch4: %{name}-x32-rust.patch URL: https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey BuildRequires: autoconf2_13 >= 2.13 BuildRequires: cargo @@ -72,6 +73,9 @@ Pliki nagłówkowe do biblioteki JavaScript. %patch1 -p1 %patch2 -p1 %patch3 -p1 +%ifarch x32 +%patch4 -p1 +%endif %build export PYTHON="%{__python}" diff --git a/x32.patch b/x32.patch index efcf419..6b26ccc 100644 --- a/x32.patch +++ b/x32.patch @@ -40,7 +40,8 @@ diff -ur mozjs-60.1.0/python/mozbuild/mozbuild/configure/constants.py mozjs-60.1 CPU_preprocessor_checks = OrderedDict(( + ('x32', '__x86_64__ && __ILP32__'), ('x86', '__i386__ || _M_IX86'), - ('x86_64', '__x86_64__ || _M_X64'), +- ('x86_64', '__x86_64__ || _M_X64'), ++ ('x86_64', '(__x86_64__ && __ILP64__) || _M_X64'), ('arm', '__arm__ || _M_ARM'), --- firefox-68.7.0/js/src/vm/BigIntType.cpp~ 2020-04-03 21:29:59.000000000 +0200 +++ firefox-68.7.0/js/src/vm/BigIntType.cpp 2020-05-01 11:22:53.296439915 +0200 @@ -53,3 +54,16 @@ diff -ur mozjs-60.1.0/python/mozbuild/mozbuild/configure/constants.py mozjs-60.1 Digit quotient; Digit rem; __asm__("divq %[divisor]" +--- firefox-78.2.0/js/src/gc/GC.cpp.orig 2020-08-17 20:33:37.000000000 +0200 ++++ firefox-78.2.0/js/src/gc/GC.cpp 2020-10-07 21:30:17.245896073 +0200 +@@ -291,8 +291,10 @@ + "CellFlagBitsReservedForGC should support LifoAlloc"); + static_assert(CellAlignBytes >= MinFirstWordAlignment, + "CellFlagBitsReservedForGC should support gc::Cell"); ++#ifndef JS_CODEGEN_NONE + static_assert(js::jit::CodeAlignment >= MinFirstWordAlignment, + "CellFlagBitsReservedForGC should support JIT code"); ++#endif + static_assert(js::gc::JSClassAlignBytes >= MinFirstWordAlignment, + "CellFlagBitsReservedForGC should support JSClass pointers"); + -- 2.43.0