diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2021-05-07 01:56:04 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2021-05-07 01:56:04 +0100 |
commit | 854735ef34c730eec54571f1d694a68c10e21c81 (patch) | |
tree | c2b0e2fef394452b1e1fb8a371dfbb948b2fca6c /dev-lang/spidermonkey/files | |
parent | 533feecd029facba89f4a4a6c754ccfd5baec747 (diff) |
dev-lang/spidermonkey : import from gentoo, compile with clang-12
Diffstat (limited to 'dev-lang/spidermonkey/files')
7 files changed, 243 insertions, 0 deletions
diff --git a/dev-lang/spidermonkey/files/moz38-dont-hardcode-libc-soname.patch b/dev-lang/spidermonkey/files/moz38-dont-hardcode-libc-soname.patch new file mode 100644 index 00000000..708c7496 --- /dev/null +++ b/dev-lang/spidermonkey/files/moz38-dont-hardcode-libc-soname.patch @@ -0,0 +1,15 @@ +--- a/testing/mozbase/mozinfo/mozinfo/mozinfo.py 2018-01-12 12:21:16.764318254 -0500 ++++ b/testing/mozbase/mozinfo/mozinfo/mozinfo.py 2018-01-12 12:22:23.392069398 -0500 +@@ -93,10 +93,11 @@ + + if info['os'] == 'linux': + import ctypes ++ import ctypes.util + import errno + PR_SET_SECCOMP = 22 + SECCOMP_MODE_FILTER = 2 +- ctypes.CDLL("libc.so.6", use_errno=True).prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, 0) ++ ctypes.CDLL(ctypes.util.find_library('c'), use_errno=True).prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, 0) + info['has_sandbox'] = ctypes.get_errno() == errno.EFAULT + else: + info['has_sandbox'] = True diff --git a/dev-lang/spidermonkey/files/spidermonkey-1.8.5-LTO.patch b/dev-lang/spidermonkey/files/spidermonkey-1.8.5-LTO.patch new file mode 100644 index 00000000..7c36b552 --- /dev/null +++ b/dev-lang/spidermonkey/files/spidermonkey-1.8.5-LTO.patch @@ -0,0 +1,58 @@ +From 6ff7ad09daf98e5b804cf73c066c382a76e74e8c Mon Sep 17 00:00:00 2001 +From: Alexander Miller <alex.miller@gmx.de> +Date: Wed, 12 Jun 2019 00:29:23 -0500 +Subject: [PATCH] Fix breakage with lto builds + +<artificial>:(.text+0x7a): undefined reference to `PopActiveVMFrame' +collect2: error: ld returned 1 exit status + +Signed-off-by: Alexander Miller <alex.miller@gmx.de> +--- + js/src/methodjit/InvokeHelpers.cpp | 2 +- + js/src/methodjit/MethodJIT.cpp | 6 +++--- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/js/src/methodjit/InvokeHelpers.cpp b/js/src/methodjit/InvokeHelpers.cpp +index d017c2a..abde396 100644 +--- a/js/src/methodjit/InvokeHelpers.cpp ++++ b/js/src/methodjit/InvokeHelpers.cpp +@@ -500,7 +500,7 @@ stubs::PutActivationObjects(VMFrame &f) + js::PutActivationObjects(f.cx, f.fp()); + } + +-extern "C" void * ++extern "C" void * __attribute__((used)) + js_InternalThrow(VMFrame &f) + { + JSContext *cx = f.cx; +diff --git a/js/src/methodjit/MethodJIT.cpp b/js/src/methodjit/MethodJIT.cpp +index 4feefbc..66099e6 100644 +--- a/js/src/methodjit/MethodJIT.cpp ++++ b/js/src/methodjit/MethodJIT.cpp +@@ -120,20 +120,20 @@ static uint32 StubCallsForOp[STUB_CALLS_FOR_OP_COUNT]; + + extern "C" void JaegerTrampolineReturn(); + +-extern "C" void JS_FASTCALL ++extern "C" void JS_FASTCALL __attribute__((used)) + PushActiveVMFrame(VMFrame &f) + { + f.entryfp->script()->compartment->jaegerCompartment->pushActiveFrame(&f); + f.regs.fp->setNativeReturnAddress(JS_FUNC_TO_DATA_PTR(void*, JaegerTrampolineReturn)); + } + +-extern "C" void JS_FASTCALL ++extern "C" void JS_FASTCALL __attribute__((used)) + PopActiveVMFrame(VMFrame &f) + { + f.entryfp->script()->compartment->jaegerCompartment->popActiveFrame(); + } + +-extern "C" void JS_FASTCALL ++extern "C" void JS_FASTCALL __attribute__((used)) + SetVMFrameRegs(VMFrame &f) + { + f.cx->setCurrentRegs(&f.regs); +-- +2.22.0 + diff --git a/dev-lang/spidermonkey/files/spidermonkey-52.0-fix-alpha-bitness.patch b/dev-lang/spidermonkey/files/spidermonkey-52.0-fix-alpha-bitness.patch new file mode 100644 index 00000000..b0f87296 --- /dev/null +++ b/dev-lang/spidermonkey/files/spidermonkey-52.0-fix-alpha-bitness.patch @@ -0,0 +1,32 @@ + +# HG changeset patch +# User John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> +# Date 1482966103 -3600 +# Node ID 1f4d99d8dff27bcc25eff21dc6a16dae63f48595 +# Parent ce9e9f0dc752896ac7ba00bb0610b3f731e948b0 +Bug 1326496 - mozbuild: Fix bitness from 32 to 64 bits on alpha. r=glandium + + +diff --git a/python/mozbuild/mozbuild/configure/constants.py b/python/mozbuild/mozbuild/configure/constants.py +--- a/python/mozbuild/mozbuild/configure/constants.py ++++ b/python/mozbuild/mozbuild/configure/constants.py +@@ -35,17 +35,17 @@ Kernel = EnumString.subclass( + 'Linux', + 'NetBSD', + 'OpenBSD', + 'WINNT', + ) + + CPU_bitness = { + 'aarch64': 64, +- 'Alpha': 32, ++ 'Alpha': 64, + 'arm': 32, + 'hppa': 32, + 'ia64': 64, + 'mips32': 32, + 'mips64': 64, + 'ppc': 32, + 'ppc64': 64, + 's390': 32, + diff --git a/dev-lang/spidermonkey/files/spidermonkey-52.0-gcc9-overflow.patch b/dev-lang/spidermonkey/files/spidermonkey-52.0-gcc9-overflow.patch new file mode 100644 index 00000000..c7eb0f62 --- /dev/null +++ b/dev-lang/spidermonkey/files/spidermonkey-52.0-gcc9-overflow.patch @@ -0,0 +1,24 @@ +From 311fc467219ab6ee9eed60759b58a8066c4bf36d Mon Sep 17 00:00:00 2001 +From: +Date: Thu, 25 Jul 2019 10:00:33 -0500 +Subject: [PATCH] gcc-9 overflow fix + +--- + js/src/jsapi-tests/testPrintf.cpp | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/js/src/jsapi-tests/testPrintf.cpp b/js/src/jsapi-tests/testPrintf.cpp +index 51486856..03cc118d 100644 +--- a/js/src/jsapi-tests/testPrintf.cpp ++++ b/js/src/jsapi-tests/testPrintf.cpp +@@ -55,7 +55,6 @@ BEGIN_TEST(testPrintf) + CHECK(print_one("27270", "%zu", (size_t) 27270)); + CHECK(print_one("27270", "%" PRIuSIZE, (size_t) 27270)); + CHECK(print_one("hello", "he%so", "ll")); +- CHECK(print_one("(null)", "%s", zero())); + CHECK(print_one("0", "%p", (char *) 0)); + CHECK(print_one("h", "%c", 'h')); + CHECK(print_one("1.500000", "%f", 1.5f)); +-- +2.22.0 + diff --git a/dev-lang/spidermonkey/files/spidermonkey-60.5.2-ia64-fix-virtual-address-length.patch b/dev-lang/spidermonkey/files/spidermonkey-60.5.2-ia64-fix-virtual-address-length.patch new file mode 100644 index 00000000..8b2245f1 --- /dev/null +++ b/dev-lang/spidermonkey/files/spidermonkey-60.5.2-ia64-fix-virtual-address-length.patch @@ -0,0 +1,59 @@ +From 8099213b51180254b322332ecd573239da4212c4 Mon Sep 17 00:00:00 2001 +From: Sergei Trofimovich <slyfox@gentoo.org> +Date: Thu, 23 Jan 2020 22:57:53 +0000 +Subject: [PATCH] ProcessExecutableMemory.cpp: fix virtual address length on + ia64 + +ia64's usable virtual address space is page dependent. For 16K +pages with 3 levels of page tables de can address only 44 bits +of virtual memory, not default 47. + +The change makes page size detection dynamic and adapts to +addressable bits. On ia64 it is '4 * log2(page_size/8)'. + +Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> +--- + js/src/jit/ProcessExecutableMemory.cpp | 25 +++++++++++++++++++++++++ + 1 file changed, 25 insertions(+) + +diff --git a/js/src/jit/ProcessExecutableMemory.cpp b/js/src/jit/ProcessExecutableMemory.cpp +index 9e55c262..8581c150 100644 +--- a/js/src/jit/ProcessExecutableMemory.cpp ++++ b/js/src/jit/ProcessExecutableMemory.cpp + +@@ -248,7 +248,32 @@ static void* ComputeRandomAllocationAddress() { + // x64 CPUs have a 48-bit address space and on some platforms the OS will + // give us access to 47 bits, so to be safe we right shift by 18 to leave + // 46 bits. ++# ifdef __ia64__ ++ // On ia64 virtual address space looks like one of: ++ // virt_addr_64 = [ <63..61> | <unimplemented> | L3 | L2 | L1 | offset ] ++ // virt_addr_64 = [ <63..61> | <unimplemented> | L4 | L3 | L2 | L1 | offset ] ++ // where L{1..L4} are page tables. Each page table (except top-level L3 or L4) ++ // is itself a page-size entry and can store PageSize / 8 entries. Top-level ++ // entry is 1/8 of of L1/L2 (as 3 upper bits are part of <63..61> address part). ++ // Note: that makes addressable size directly depend on page size. ++ // ++ // We conservatively assume 3 levels of page tables here. This makes the ++ // following formula: ++ // L3 = log2(PAGE / 8 / 8) = log2(PAGE / 8) - 3 ++ // L2 = log2(PAGE / 8) ++ // L1 = log2(PAGE / 8) ++ // offset = log2(PAGE) = log2(PAGE / 8) + 3 ++ // thus ++ // L3 + L2 + L1 + offset = 4 * log2(PAGE / 8) ++ // For more details see http://www.ia64-linux.org/doc/IA64linuxkernel.PDF ++ // (slide 19: "user regions"). ++ static uint64_t ia64_virt_bits = std::min<uint64_t>( ++ 4 * (mozilla::FloorLog2(gc::SystemPageSize() / 8)), ++ 46); ++ rand >>= (64 - ia64_virt_bits); ++# else + rand >>= 18; ++# endif + #else + // On 32-bit, right shift by 34 to leave 30 bits, range [0, 1GiB). Then add + // 512MiB to get range [512MiB, 1.5GiB), or [0x20000000, 0x60000000). This +-- +2.25.0 + diff --git a/dev-lang/spidermonkey/files/spidermonkey-60.5.2-ia64-support.patch b/dev-lang/spidermonkey/files/spidermonkey-60.5.2-ia64-support.patch new file mode 100644 index 00000000..90c8a4c9 --- /dev/null +++ b/dev-lang/spidermonkey/files/spidermonkey-60.5.2-ia64-support.patch @@ -0,0 +1,44 @@ +From 35d787c782a075c0a01e29605d254950fd1e81a6 Mon Sep 17 00:00:00 2001 +From: Sergei Trofimovich <slyfox@gentoo.org> +Date: Thu, 25 Jul 2019 10:17:39 -0500 +Subject: [PATCH] Add support for ia64 atomic-ops + +Signed-off-by: Jory Pratt <anarchy@gentoo.org> +--- + js/src/jit/AtomicOperations.h | 2 ++ + js/src/jit/none/AtomicOperations-feeling-lucky.h | 6 ++++++ + 2 files changed, 8 insertions(+) + +diff --git a/js/src/jit/AtomicOperations.h b/js/src/jit/AtomicOperations.h +index 3501e65b..44c3f358 100644 +--- a/js/src/jit/AtomicOperations.h ++++ b/js/src/jit/AtomicOperations.h +@@ -393,6 +393,8 @@ inline bool AtomicOperations::isLockfreeJS(int32_t size) { + #include "jit/none/AtomicOperations-feeling-lucky.h" + #elif defined(__s390__) || defined(__s390x__) + #include "jit/none/AtomicOperations-feeling-lucky.h" ++#elif defined(__ia64__) ++#include "jit/none/AtomicOperations-feeling-lucky.h" + #else + #error "No AtomicOperations support provided for this platform" + #endif +diff --git a/js/src/jit/none/AtomicOperations-feeling-lucky.h b/js/src/jit/none/AtomicOperations-feeling-lucky.h +index c0b43699..a3f4497e 100644 +--- a/js/src/jit/none/AtomicOperations-feeling-lucky.h ++++ b/js/src/jit/none/AtomicOperations-feeling-lucky.h +@@ -80,6 +80,12 @@ + #define GNUC_COMPATIBLE + #endif + ++#ifdef __ia64__ ++#define HAS_64BIT_ATOMICS ++#define HAS_64BIT_LOCKFREE ++#define GNUC_COMPATIBLE ++#endif ++ + // The default implementation tactic for gcc/clang is to use the newer + // __atomic intrinsics added for use in C++11 <atomic>. Where that + // isn't available, we use GCC's older __sync functions instead. +-- +2.22.0 + diff --git a/dev-lang/spidermonkey/files/spidermonkey-perl-defined-array-check.patch b/dev-lang/spidermonkey/files/spidermonkey-perl-defined-array-check.patch new file mode 100644 index 00000000..c3996ae8 --- /dev/null +++ b/dev-lang/spidermonkey/files/spidermonkey-perl-defined-array-check.patch @@ -0,0 +1,11 @@ +--- a/js/src/config/milestone.pl 2013-02-11 17:33:22.000000000 -0500 ++++ b/js/src/config/milestone.pl 2015-07-15 10:44:31.676153600 -0400 +@@ -55,7 +55,7 @@ + # + my $milestone = Moz::Milestone::getOfficialMilestone($MILESTONE_FILE); + +-if (defined(@TEMPLATE_FILE)) { ++if (@TEMPLATE_FILE) { + my $TFILE; + + foreach $TFILE (@TEMPLATE_FILE) { |