summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Stakenvicius <axs@gentoo.org>2017-02-27 21:00:55 -0500
committerIan Stakenvicius <axs@gentoo.org>2017-02-27 21:01:23 -0500
commit03ca1a66484c7b13c55d43c40fbee116d030087a (patch)
tree537fe3ec3759b93fde798f57a8368fb6652a8dfd /dev-lang/spidermonkey
parentapp-editors/gvim: version bump to 8.0.0386 (diff)
downloadgentoo-03ca1a66484c7b13c55d43c40fbee116d030087a.tar.gz
gentoo-03ca1a66484c7b13c55d43c40fbee116d030087a.tar.bz2
gentoo-03ca1a66484c7b13c55d43c40fbee116d030087a.zip
dev-lang/spidermonkey: add release for v45
Package-Manager: portage-2.3.3
Diffstat (limited to 'dev-lang/spidermonkey')
-rw-r--r--dev-lang/spidermonkey/Manifest1
-rw-r--r--dev-lang/spidermonkey/files/ff45/7000_drop-Wl-build-id_v4.patch17
-rw-r--r--dev-lang/spidermonkey/files/ff45/7003_freebsd_jscpucfg.patch22
-rw-r--r--dev-lang/spidermonkey/files/ff45/8001_hppa_js_configure.patch21
-rw-r--r--dev-lang/spidermonkey/files/ff45/8007_nonejit_ppc64_fix_bug1253216.patch46
-rw-r--r--dev-lang/spidermonkey/files/ff45/8008_nonejit_x86_fix_based_on_bug1253216.patch11
-rw-r--r--dev-lang/spidermonkey/files/ff45/8014_ia64_js.patch248
-rw-r--r--dev-lang/spidermonkey/files/mozjs45-1266366.patch29
-rw-r--r--dev-lang/spidermonkey/spidermonkey-45.0.2.ebuild145
9 files changed, 540 insertions, 0 deletions
diff --git a/dev-lang/spidermonkey/Manifest b/dev-lang/spidermonkey/Manifest
index d6a76976d6e4..e6125e93b194 100644
--- a/dev-lang/spidermonkey/Manifest
+++ b/dev-lang/spidermonkey/Manifest
@@ -2,4 +2,5 @@ DIST js-1.7.0.tar.gz 1165607 SHA256 44363f0f3895800ee6010763eae90c0d15ed28e07d78
DIST js185-1.0.0.tar.gz 6164605 SHA256 5d12f7e1f5b4a99436685d97b9b7b75f094d33580227aa998c406bbae6f2a687 SHA512 2af7122a7c7007fd7b6668776fe1222515a810b3e43bbf0f76b8f94e1ef406ffd3fb5ccec393021b00274c05b38a77235bc8d6886994c56762fcaf0aa7cf6718 WHIRLPOOL 58b372713275874d3ae3c6b58c12c56bf8d17d024d591e321538bcdd8e615332e41655954368ce86b90e970209e3fd650c39d931000880f5ec22cb044b5d7a4e
DIST mozjs-24.2.0.tar.bz2 15624530 SHA256 e62f3f331ddd90df1e238c09d61a505c516fe9fd8c5c95336611d191d18437d8 SHA512 49805e256f6fa797505c01b7596d5bb941ed7a2454862c52ed42ad48b5ae4540b777e77ed8da1b98c89f8622ed2c76052187983687008a4ff53594addb328df4 WHIRLPOOL ea74d19c79b1a0fe407e2803900c49c23e8b76444fb4e20995072c3c59427e8df1895df04f2f4de779a1c58cd1166dd97aeaf7564350832011efe89dbcf9583e
DIST mozjs-38.2.1.rc0.tar.bz2 25012381 SHA256 01994c758174bc173bcf4960f05ecb4da21014f09641a63b2952bbf9eeaa8b5c SHA512 60262c7619cc418569aec81775a671105acbc5bf372273828868f2fbbbc4ea33f78380f7455710816bfcdae828fb4115a08234d599cb30d0db859fcba17f019d WHIRLPOOL b1661859dc41a61317a48a8ee34cab53a369f37067c6565db2c890c596411e51981e0e64f81c5f5bd2bc2ff943493d972b00a5984b99de6e07ce16c07f784cb7
+DIST mozjs-45.0.2.tar.bz2 97508152 SHA256 570530b1e551bf4a459d7cae875f33f99d5ef0c29ccc7742a1b6f588e5eadbee SHA512 84a3cf12e2603e00bcfe518a1a5000f53b21758c1c6b32a0410e63ab7db8d4452028195b0ba3e56144054b06e90f8e5195b4db94dba711f7c75d11da99c6c61d WHIRLPOOL dba2f7d4778f47f6476c3dd2e658a5b39ff9e571d4e71fe2508d58910a0989c24f892cbc7cc64aa7c94692cf947eb1a545fd0752bb5d8aace12c2dc96404c114
DIST mozjs17.0.0.tar.gz 6778934 SHA256 321e964fe9386785d3bf80870640f2fa1c683e32fe988eeb201b04471c172fba SHA512 39b68aeb9f712f146778d8b68ee795709a1372c8ab893a222af4eb34882427d6f5cf877e743d6cb2f1b4348c194d8f3774f00cb775b03515b34b49560b748be4 WHIRLPOOL 4df7b51577787194065162b09d2c3dda849c13fa901305f9925d4ca5d38bb7f8e2daa943099e003fb9d11f9264ae2d77ccf04e5eea11e3ddcb624b504b99d52f
diff --git a/dev-lang/spidermonkey/files/ff45/7000_drop-Wl-build-id_v4.patch b/dev-lang/spidermonkey/files/ff45/7000_drop-Wl-build-id_v4.patch
new file mode 100644
index 000000000000..8a1e1dd9988f
--- /dev/null
+++ b/dev-lang/spidermonkey/files/ff45/7000_drop-Wl-build-id_v4.patch
@@ -0,0 +1,17 @@
+--- a/js/src/configure.in 2014-06-05 21:15:27.000000000 -0400
++++ b/js/src/configure.in 2014-06-13 11:01:51.130703283 -0400
+@@ -1156,14 +1156,6 @@
+ AC_MSG_RESULT([no])
+ LDFLAGS=$_SAVE_LDFLAGS)
+
+- AC_MSG_CHECKING([for --build-id option to ld])
+- _SAVE_LDFLAGS=$LDFLAGS
+- LDFLAGS="$LDFLAGS -Wl,--build-id"
+- AC_TRY_LINK(,,AC_MSG_RESULT([yes])
+- [NSPR_LDFLAGS="$NSPR_LDFLAGS -Wl,--build-id"],
+- AC_MSG_RESULT([no])
+- LDFLAGS=$_SAVE_LDFLAGS)
+-
+ # Turn on gcc/clang warnings:
+ # https://gcc.gnu.org/onlinedocs/gcc-4.4.0/gcc/Warning-Options.html
+ #
diff --git a/dev-lang/spidermonkey/files/ff45/7003_freebsd_jscpucfg.patch b/dev-lang/spidermonkey/files/ff45/7003_freebsd_jscpucfg.patch
new file mode 100644
index 000000000000..467bf4441444
--- /dev/null
+++ b/dev-lang/spidermonkey/files/ff45/7003_freebsd_jscpucfg.patch
@@ -0,0 +1,22 @@
+--- a/js/src/jscpucfg.h 2012-01-18 17:38:54.409461514 +0100
++++ b/js/src/jscpucfg.h 2012-01-18 17:38:59.522462164 +0100
+@@ -77,6 +77,19 @@
+ #define IS_BIG_ENDIAN 1
+ #endif
+
++#elif defined(__FreeBSD__)
++#include <sys/endian.h>
++
++#if defined(BYTE_ORDER)
++#if BYTE_ORDER == LITTLE_ENDIAN
++#define IS_LITTLE_ENDIAN 1
++#undef IS_BIG_ENDIAN
++#elif BYTE_ORDER == BIG_ENDIAN
++#undef IS_LITTLE_ENDIAN
++#define IS_BIG_ENDIAN 1
++#endif
++#endif
++
+ #elif defined(JS_HAVE_ENDIAN_H)
+ #include <endian.h>
+
diff --git a/dev-lang/spidermonkey/files/ff45/8001_hppa_js_configure.patch b/dev-lang/spidermonkey/files/ff45/8001_hppa_js_configure.patch
new file mode 100644
index 000000000000..a33ab3cd6143
--- /dev/null
+++ b/dev-lang/spidermonkey/files/ff45/8001_hppa_js_configure.patch
@@ -0,0 +1,21 @@
+--- a/js/src/configure.in
++++ b/js/src/configure.in
+@@ -958,7 +958,7 @@
+ CPU_ARCH=s390x
+ ;;
+
+-hppa* | parisc)
++hppa* | parisc*)
+ CPU_ARCH=hppa
+ ;;
+
+@@ -2009,6 +2009,9 @@
+ AC_DEFINE(JS_CPU_MIPS)
+ AC_DEFINE(JS_NUNBOX32)
+ ;;
++hppa*)
++ AC_DEFINE(JS_NUNBOX32)
++ ;;
+ esac
+
+ MOZ_ARG_DISABLE_BOOL(ion,
diff --git a/dev-lang/spidermonkey/files/ff45/8007_nonejit_ppc64_fix_bug1253216.patch b/dev-lang/spidermonkey/files/ff45/8007_nonejit_ppc64_fix_bug1253216.patch
new file mode 100644
index 000000000000..26e9373dddfc
--- /dev/null
+++ b/dev-lang/spidermonkey/files/ff45/8007_nonejit_ppc64_fix_bug1253216.patch
@@ -0,0 +1,46 @@
+
+# HG changeset patch
+# User Lars T Hansen <lhansen@mozilla.com>
+# Date 1457091735 -3600
+# Node ID 69f237c2cf9131e97372debee01931dbacd064e5
+# Parent 3aa4483740828617001060fe7386051020521e90
+Bug 1253216 - clean up the atomic ops ifdef nest. r=jorendorff
+
+diff --git a/js/src/jit/AtomicOperations.h b/js/src/jit/AtomicOperations.h
+--- a/js/src/jit/AtomicOperations.h
++++ b/js/src/jit/AtomicOperations.h
+@@ -318,21 +318,29 @@ AtomicOperations::isLockfree(int32_t siz
+ } // namespace js
+
+ #if defined(JS_CODEGEN_ARM)
+ # include "jit/arm/AtomicOperations-arm.h"
+ #elif defined(JS_CODEGEN_ARM64)
+ # include "jit/arm64/AtomicOperations-arm64.h"
+ #elif defined(JS_CODEGEN_MIPS32) || defined(JS_CODEGEN_MIPS64)
+ # include "jit/mips-shared/AtomicOperations-mips-shared.h"
+-#elif defined(__ppc64__) || defined(__PPC64_) \
+- || defined(__ppc64le__) || defined(__PPC64LE__) \
+- || defined(__ppc__) || defined(__PPC__)
++#elif defined(__ppc__) || defined(__PPC__)
+ # include "jit/none/AtomicOperations-ppc.h"
+ #elif defined(JS_CODEGEN_NONE)
+-# include "jit/none/AtomicOperations-none.h"
++ // You can disable the JIT with --disable-ion but you must still
++ // provide the atomic operations that will be used by the JS engine.
++ // When the JIT is disabled the operations are simply safe-for-races
++ // C++ realizations of atomics. These operations cannot be written
++ // in portable C++, hence the default here is to crash. See the
++ // top of the file for more guidance.
++# if defined(__ppc64__) || defined(__PPC64__) || defined(__ppc64le__) || defined(__PPC64LE__)
++# include "jit/none/AtomicOperations-ppc.h"
++# else
++# include "jit/none/AtomicOperations-none.h" // These MOZ_CRASH() always
++# endif
+ #elif defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64)
+ # include "jit/x86-shared/AtomicOperations-x86-shared.h"
+ #else
+ # error "Atomic operations must be defined for this platform"
+ #endif
+
+ #endif // jit_AtomicOperations_h
+
diff --git a/dev-lang/spidermonkey/files/ff45/8008_nonejit_x86_fix_based_on_bug1253216.patch b/dev-lang/spidermonkey/files/ff45/8008_nonejit_x86_fix_based_on_bug1253216.patch
new file mode 100644
index 000000000000..86b27130205d
--- /dev/null
+++ b/dev-lang/spidermonkey/files/ff45/8008_nonejit_x86_fix_based_on_bug1253216.patch
@@ -0,0 +1,11 @@
+--- a/js/src/jit/AtomicOperations.h 2016-03-12 13:42:27.914524205 -0500
++++ b/js/src/jit/AtomicOperations.h 2016-03-12 13:42:15.644573630 -0500
+@@ -311,6 +311,8 @@
+ // top of the file for more guidance.
+ # if defined(__ppc64__) || defined(__PPC64__) || defined(__ppc64le__) || defined(__PPC64LE__)
+ # include "jit/none/AtomicOperations-ppc.h"
++# elif defined(__i386__) || defined(__x86_64__)
++# include "jit/x86-shared/AtomicOperations-x86-shared.h"
+ # else
+ # include "jit/none/AtomicOperations-none.h" // These MOZ_CRASH() always
+ # endif
diff --git a/dev-lang/spidermonkey/files/ff45/8014_ia64_js.patch b/dev-lang/spidermonkey/files/ff45/8014_ia64_js.patch
new file mode 100644
index 000000000000..73075919a864
--- /dev/null
+++ b/dev-lang/spidermonkey/files/ff45/8014_ia64_js.patch
@@ -0,0 +1,248 @@
+--- a/js/src/jit/AtomicOperations.h 2016-11-08 21:27:30.000000000 +0100
++++ b/js/src/jit/AtomicOperations.h 2016-11-08 22:17:59.280251831 +0100
+@@ -311,6 +311,8 @@
+ // top of the file for more guidance.
+ # if defined(__ppc64__) || defined(__PPC64__) || defined(__ppc64le__) || defined(__PPC64LE__)
+ # include "jit/none/AtomicOperations-ppc.h"
++# elif defined(__ia64__)
++# include "jit/none/AtomicOperations-ia64.h"
+ # elif defined(__i386__) || defined(__x86_64__)
+ # include "jit/x86-shared/AtomicOperations-x86-shared.h"
+ # else
+--- /dev/null
++++ b/js/src/jit/none/AtomicOperations-ia64.h 2016-11-08 22:09:41.378809457 +0100
+@@ -0,0 +1,234 @@
++/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
++ * vim: set ts=8 sts=4 et sw=4 tw=99:
++ * This Source Code Form is subject to the terms of the Mozilla Public
++ * License, v. 2.0. If a copy of the MPL was not distributed with this
++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
++
++/* For documentation, see jit/AtomicOperations.h */
++
++#ifndef jit_ia64_AtomicOperations_ia64_h
++#define jit_ia64_AtomicOperations_ia64_h
++
++#include "mozilla/Assertions.h"
++#include "mozilla/Types.h"
++
++#if defined(__GNUC__)
++
++// The default implementation tactic for gcc 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.
++//
++// ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS is kept as a backward
++// compatible option for older compilers: enable this to use GCC's old
++// __sync functions instead of the newer __atomic functions. This
++// will be required for GCC 4.6.x and earlier, should we need to use
++// those versions.
++
++//#define ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS
++
++inline bool
++js::jit::AtomicOperations::isLockfree8()
++{
++# ifndef ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS
++ MOZ_ASSERT(__atomic_always_lock_free(sizeof(int8_t), 0));
++ MOZ_ASSERT(__atomic_always_lock_free(sizeof(int16_t), 0));
++ MOZ_ASSERT(__atomic_always_lock_free(sizeof(int32_t), 0));
++ MOZ_ASSERT(__atomic_always_lock_free(sizeof(int64_t), 0));
++ return true;
++# else
++ return false;
++# endif
++}
++
++inline void
++js::jit::AtomicOperations::fenceSeqCst()
++{
++# ifdef ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS
++ __sync_synchronize();
++# else
++ __atomic_thread_fence(__ATOMIC_SEQ_CST);
++# endif
++}
++
++template<typename T>
++inline T
++js::jit::AtomicOperations::loadSeqCst(T* addr)
++{
++ MOZ_ASSERT(sizeof(T) < 8 || isLockfree8());
++# ifdef ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS
++ __sync_synchronize();
++ T v = *addr;
++ __sync_synchronize();
++# else
++ T v;
++ __atomic_load(addr, &v, __ATOMIC_SEQ_CST);
++# endif
++ return v;
++}
++
++template<typename T>
++inline void
++js::jit::AtomicOperations::storeSeqCst(T* addr, T val)
++{
++ MOZ_ASSERT(sizeof(T) < 8 || isLockfree8());
++# ifdef ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS
++ __sync_synchronize();
++ *addr = val;
++ __sync_synchronize();
++# else
++ __atomic_store(addr, &val, __ATOMIC_SEQ_CST);
++# endif
++}
++
++template<typename T>
++inline T
++js::jit::AtomicOperations::compareExchangeSeqCst(T* addr, T oldval, T newval)
++{
++ MOZ_ASSERT(sizeof(T) < 8 || isLockfree8());
++# ifdef ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS
++ return __sync_val_compare_and_swap(addr, oldval, newval);
++# else
++ __atomic_compare_exchange(addr, &oldval, &newval, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
++ return oldval;
++# endif
++}
++
++template<typename T>
++inline T
++js::jit::AtomicOperations::fetchAddSeqCst(T* addr, T val)
++{
++# ifdef ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS
++ return __sync_fetch_and_add(addr, val);
++# else
++ return __atomic_fetch_add(addr, val, __ATOMIC_SEQ_CST);
++# endif
++}
++
++template<typename T>
++inline T
++js::jit::AtomicOperations::fetchSubSeqCst(T* addr, T val)
++{
++# ifdef ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS
++ return __sync_fetch_and_sub(addr, val);
++# else
++ return __atomic_fetch_sub(addr, val, __ATOMIC_SEQ_CST);
++# endif
++}
++
++template<typename T>
++inline T
++js::jit::AtomicOperations::fetchAndSeqCst(T* addr, T val)
++{
++# ifdef ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS
++ return __sync_fetch_and_and(addr, val);
++# else
++ return __atomic_fetch_and(addr, val, __ATOMIC_SEQ_CST);
++# endif
++}
++
++template<typename T>
++inline T
++js::jit::AtomicOperations::fetchOrSeqCst(T* addr, T val)
++{
++# ifdef ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS
++ return __sync_fetch_and_or(addr, val);
++# else
++ return __atomic_fetch_or(addr, val, __ATOMIC_SEQ_CST);
++# endif
++}
++
++template<typename T>
++inline T
++js::jit::AtomicOperations::fetchXorSeqCst(T* addr, T val)
++{
++# ifdef ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS
++ return __sync_fetch_and_xor(addr, val);
++# else
++ return __atomic_fetch_xor(addr, val, __ATOMIC_SEQ_CST);
++# endif
++}
++
++template<typename T>
++inline T
++js::jit::AtomicOperations::exchangeSeqCst(T* addr, T val)
++{
++ MOZ_ASSERT(sizeof(T) < 8 || isLockfree8());
++# ifdef ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS
++ T v;
++ __sync_synchronize();
++ do {
++ v = *addr;
++ } while (__sync_val_compare_and_swap(addr, v, val) != v);
++ return v;
++# else
++ T v;
++ __atomic_exchange(addr, &val, &v, __ATOMIC_SEQ_CST);
++ return v;
++# endif
++}
++
++template<typename T>
++inline T
++js::jit::AtomicOperations::loadSafeWhenRacy(T* addr)
++{
++ return *addr; // FIXME (1208663): not yet safe
++}
++
++template<typename T>
++inline void
++js::jit::AtomicOperations::storeSafeWhenRacy(T* addr, T val)
++{
++ *addr = val; // FIXME (1208663): not yet safe
++}
++
++inline void
++js::jit::AtomicOperations::memcpySafeWhenRacy(void* dest, const void* src, size_t nbytes)
++{
++ ::memcpy(dest, src, nbytes); // FIXME (1208663): not yet safe
++}
++
++inline void
++js::jit::AtomicOperations::memmoveSafeWhenRacy(void* dest, const void* src, size_t nbytes)
++{
++ ::memmove(dest, src, nbytes); // FIXME (1208663): not yet safe
++}
++
++template<size_t nbytes>
++inline void
++js::jit::RegionLock::acquire(void* addr)
++{
++# ifdef ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS
++ while (!__sync_bool_compare_and_swap(&spinlock, 0, 1))
++ ;
++# else
++ uint32_t zero = 0;
++ uint32_t one = 1;
++ while (!__atomic_compare_exchange(&spinlock, &zero, &one, false, __ATOMIC_ACQUIRE, __ATOMIC_ACQUIRE)) {
++ zero = 0;
++ continue;
++ }
++# endif
++}
++
++template<size_t nbytes>
++inline void
++js::jit::RegionLock::release(void* addr)
++{
++ MOZ_ASSERT(AtomicOperations::loadSeqCst(&spinlock) == 1, "releasing unlocked region lock");
++# ifdef ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS
++ __sync_sub_and_fetch(&spinlock, 1);
++# else
++ uint32_t zero = 0;
++ __atomic_store(&spinlock, &zero, __ATOMIC_SEQ_CST);
++# endif
++}
++
++# undef ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS
++
++#elif defined(ENABLE_SHARED_ARRAY_BUFFER)
++
++# error "Either disable JS shared memory, use GCC, or add code here"
++
++#endif
++
++#endif // jit_ia64_AtomicOperations_ia64_h
diff --git a/dev-lang/spidermonkey/files/mozjs45-1266366.patch b/dev-lang/spidermonkey/files/mozjs45-1266366.patch
new file mode 100644
index 000000000000..590f745d14d4
--- /dev/null
+++ b/dev-lang/spidermonkey/files/mozjs45-1266366.patch
@@ -0,0 +1,29 @@
+# HG changeset patch
+# User Nicolas B. Pierron <nicolas.b.pierron@mozilla.com>
+
+Bug 1266366 - Add branch64 functions to the none-backend MacroAssembler. r=
+
+diff --git a/js/src/jit/none/MacroAssembler-none.h b/js/src/jit/none/MacroAssembler-none.h
+index 512ae81..4441d8d 100644
+--- a/js/src/jit/none/MacroAssembler-none.h
++++ b/js/src/jit/none/MacroAssembler-none.h
+@@ -254,16 +254,18 @@ class MacroAssemblerNone : public Assembler
+ template <typename T, typename S> void branchSub32(Condition, T, S, Label*) { MOZ_CRASH(); }
+ template <typename T, typename S> void branchPtr(Condition, T, S, Label*) { MOZ_CRASH(); }
+ template <typename T, typename S> void branchTestPtr(Condition, T, S, Label*) { MOZ_CRASH(); }
+ template <typename T, typename S> void branchDouble(DoubleCondition, T, S, Label*) { MOZ_CRASH(); }
+ template <typename T, typename S> void branchFloat(DoubleCondition, T, S, Label*) { MOZ_CRASH(); }
+ template <typename T, typename S> void branchPrivatePtr(Condition, T, S, Label*) { MOZ_CRASH(); }
+ template <typename T, typename S> void decBranchPtr(Condition, T, S, Label*) { MOZ_CRASH(); }
+ template <typename T, typename S> void branchTest64(Condition, T, T, S, Label*) { MOZ_CRASH(); }
++ template <typename T, typename S> void branch64(Condition, T, S, Label*) { MOZ_CRASH(); }
++ template <typename T, typename S> void branch64(Condition, T, T, S, Label*) { MOZ_CRASH(); }
+ template <typename T, typename S> void mov(T, S) { MOZ_CRASH(); }
+ template <typename T, typename S> void movq(T, S) { MOZ_CRASH(); }
+ template <typename T, typename S> void movePtr(T, S) { MOZ_CRASH(); }
+ template <typename T, typename S> void move32(T, S) { MOZ_CRASH(); }
+ template <typename T, typename S> void moveFloat32(T, S) { MOZ_CRASH(); }
+ template <typename T, typename S> void moveDouble(T, S) { MOZ_CRASH(); }
+ template <typename T, typename S> void move64(T, S) { MOZ_CRASH(); }
+ template <typename T> CodeOffset movWithPatch(T, Register) { MOZ_CRASH(); }
+
diff --git a/dev-lang/spidermonkey/spidermonkey-45.0.2.ebuild b/dev-lang/spidermonkey/spidermonkey-45.0.2.ebuild
new file mode 100644
index 000000000000..faaa6575705a
--- /dev/null
+++ b/dev-lang/spidermonkey/spidermonkey-45.0.2.ebuild
@@ -0,0 +1,145 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+WANT_AUTOCONF="2.1"
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="threads"
+inherit autotools toolchain-funcs multilib python-any-r1 versionator pax-utils mozcoreconf-v4
+
+MY_PN="mozjs"
+MY_P="${MY_PN}-${PV/_/.}"
+DESCRIPTION="Stand-alone JavaScript C library"
+HOMEPAGE="https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey"
+SRC_URI="https://people.mozilla.org/~sfink/${MY_P}.tar.bz2"
+
+LICENSE="NPL-1.1"
+SLOT="45"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
+IUSE="debug +jit minimal static-libs +system-icu test"
+
+RESTRICT="ia64? ( test )"
+
+S="${WORKDIR}/${MY_P%.rc*}"
+#S="${WORKDIR}/mozjs-38.0.0"
+BUILDDIR="${S}/js/src"
+
+RDEPEND=">=dev-libs/nspr-4.10.10
+ virtual/libffi
+ sys-libs/readline:0=
+ >=sys-libs/zlib-1.2.3
+ system-icu? ( >=dev-libs/icu-51.1:= )"
+DEPEND="${RDEPEND}
+ ${PYTHON_DEPS}
+ app-arch/zip
+ virtual/pkgconfig"
+
+pkg_setup(){
+ if [[ ${MERGE_TYPE} != "binary" ]]; then
+ moz_pkgsetup
+ fi
+}
+
+src_prepare() {
+ eapply "${FILESDIR}"/${PN}-38-jsapi-tests.patch
+ eapply "${FILESDIR}"/mozjs45-1266366.patch
+ eapply "${FILESDIR}"/ff45
+
+ eapply_user
+
+ if [[ ${CHOST} == *-freebsd* ]]; then
+ # Don't try to be smart, this does not work in cross-compile anyway
+ ln -sfn "${BUILDDIR}/config/Linux_All.mk" "${S}/config/$(uname -s)$(uname -r).mk" || die
+ fi
+
+ cd "${BUILDDIR}" || die
+ eautoconf
+}
+
+src_configure() {
+ export SHELL=/bin/sh
+ cd "${BUILDDIR}" || die
+
+ econf \
+ --enable-jemalloc \
+ --enable-readline \
+ --enable-threadsafe \
+ --with-system-nspr \
+ --enable-system-ffi \
+ --disable-optimize \
+ --with-intl-api \
+ $(use_with system-icu) \
+ $(use_enable debug) \
+ $(use_enable jit yarr-jit) \
+ $(use_enable jit ion) \
+ $(use_enable static-libs static) \
+ $(use_enable test tests)
+}
+
+cross_make() {
+ emake \
+ CFLAGS="${BUILD_CFLAGS}" \
+ CXXFLAGS="${BUILD_CXXFLAGS}" \
+ AR="${BUILD_AR}" \
+ CC="${BUILD_CC}" \
+ CXX="${BUILD_CXX}" \
+ RANLIB="${BUILD_RANLIB}" \
+ "$@"
+}
+src_compile() {
+ cd "${BUILDDIR}" || die
+ if tc-is-cross-compiler; then
+ tc-export_build_env BUILD_{AR,CC,CXX,RANLIB}
+ cross_make \
+ MOZ_OPTIMIZE_FLAGS="" MOZ_DEBUG_FLAGS="" \
+ HOST_OPTIMIZE_FLAGS="" MODULE_OPTIMIZE_FLAGS="" \
+ MOZ_PGO_OPTIMIZE_FLAGS="" \
+ host_jsoplengen host_jskwgen
+ cross_make \
+ MOZ_OPTIMIZE_FLAGS="" MOZ_DEBUG_FLAGS="" HOST_OPTIMIZE_FLAGS="" \
+ -C config nsinstall
+ mv {,native-}host_jskwgen || die
+ mv {,native-}host_jsoplengen || die
+ mv config/{,native-}nsinstall || die
+ sed -i \
+ -e 's@./host_jskwgen@./native-host_jskwgen@' \
+ -e 's@./host_jsoplengen@./native-host_jsoplengen@' \
+ Makefile || die
+ sed -i -e 's@/nsinstall@/native-nsinstall@' config/config.mk || die
+ rm -f config/host_nsinstall.o \
+ config/host_pathsub.o \
+ host_jskwgen.o \
+ host_jsoplengen.o || die
+ fi
+
+ MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL:-${EPREFIX%/}/bin/bash}" \
+ emake \
+ MOZ_OPTIMIZE_FLAGS="" MOZ_DEBUG_FLAGS="" \
+ HOST_OPTIMIZE_FLAGS="" MODULE_OPTIMIZE_FLAGS="" \
+ MOZ_PGO_OPTIMIZE_FLAGS=""
+}
+
+src_test() {
+ cd "${BUILDDIR}/js/src/jsapi-tests" || die
+ ./jsapi-tests || die
+}
+
+src_install() {
+ cd "${BUILDDIR}" || die
+ emake DESTDIR="${D}" install
+
+ if ! use minimal; then
+ if use jit; then
+ pax-mark m "${ED}/usr/bin/js${SLOT}"
+ fi
+ else
+ rm -f "${ED}/usr/bin/js${SLOT}"
+ fi
+
+ if ! use static-libs; then
+ # We can't actually disable building of static libraries
+ # They're used by the tests and in a few other places
+ find "${D}" -iname '*.a' -delete || die
+ fi
+}