diff --git a/extra/js/PKGBUILD b/extra/js/PKGBUILD deleted file mode 100644 index aa87e3ff8..000000000 --- a/extra/js/PKGBUILD +++ /dev/null @@ -1,58 +0,0 @@ -# $Id$ -# Maintainer: Ionut Biru - -# ALARM: Kevin Mihelich -# - patches for AArch64 from Fedora - -pkgname=js -pkgver=24.2.0 -pkgrel=4 -pkgdesc="JavaScript interpreter and libraries" -arch=(i686 x86_64) -url="https://developer.mozilla.org/En/SpiderMonkey/17" -license=(MPL) -depends=(nspr gcc-libs readline zlib) -makedepends=(python2 zip libffi) -options=(!staticlibs) -source=(http://ftp.mozilla.org/pub/mozilla.org/js/mozjs-$pkgver.tar.bz2 - mozjs24-0001-Add-AArch64-support.patch - mozjs24-48-bit-VA-fix.patch) -md5sums=('5db79c10e049a2dc117a6e6a3bc78a8e' - '06eea5b38cf71b894a079a1c932e421b' - '82e9016bc35b745d56aec6dbea3ed520') - -prepare() { - cd mozjs-$pkgver/js/src - - rm -r editline - rm -r ctypes/libffi - - # Fix incompatibility with Perl 5.22 - sed -i 's/(defined\((@TEMPLATE_FILE)\))/\1/' config/milestone.pl - - cd ../.. - patch -p1 -i ../mozjs24-0001-Add-AArch64-support.patch - patch -p1 -i ../mozjs24-48-bit-VA-fix.patch -} - -build() { - unset CPPFLAGS - CXXFLAGS+=' -fno-delete-null-pointer-checks' - cd mozjs-$pkgver/js/src - ./configure --prefix=/usr --with-system-nspr --enable-system-ffi \ - --enable-readline --enable-threadsafe - make -} - -check() { - cd mozjs-$pkgver/js/src - make check -} - -package() { - cd mozjs-$pkgver/js/src - make DESTDIR="$pkgdir" install - find "$pkgdir"/usr/{lib/pkgconfig,include} -type f -exec chmod -x {} + -} - -# vim:set ts=2 sw=2 et: diff --git a/extra/js/mozjs24-0001-Add-AArch64-support.patch b/extra/js/mozjs24-0001-Add-AArch64-support.patch deleted file mode 100644 index 3895fffc6..000000000 --- a/extra/js/mozjs24-0001-Add-AArch64-support.patch +++ /dev/null @@ -1,51 +0,0 @@ ---- mozjs-24.2.0/js/src/assembler/jit/ExecutableAllocator.h.orig 2013-10-29 20:40:26.000000000 +0000 -+++ mozjs-24.2.0/js/src/assembler/jit/ExecutableAllocator.h 2014-01-22 16:52:53.603726328 +0000 -@@ -391,6 +391,12 @@ - { - reprotectRegion(start, size, Executable); - } -+#elif WTF_CPU_AARCH64 && WTF_PLATFORM_LINUX -+ static void cacheFlush(void* code, size_t size) -+ { -+ intptr_t end = reinterpret_cast(code) + size; -+ __builtin___clear_cache(reinterpret_cast(code), reinterpret_cast(end)); -+ } - #else - static void makeWritable(void*, size_t) {} - static void makeExecutable(void*, size_t) {} ---- mozjs-24.2.0/js/src/assembler/wtf/Platform.h.orig 2013-10-29 20:40:26.000000000 +0000 -+++ mozjs-24.2.0/js/src/assembler/wtf/Platform.h 2014-01-22 16:52:53.604726300 +0000 -@@ -326,6 +326,10 @@ - #define WTF_THUMB_ARCH_VERSION 0 - #endif - -+/* CPU(AArch64) - 64-bit ARM */ -+#if defined(__aarch64__) -+#define WTF_CPU_AARCH64 1 -+#endif - - /* WTF_CPU_ARMV5_OR_LOWER - ARM instruction set v5 or earlier */ - /* On ARMv5 and below the natural alignment is required. ---- mozjs-24.2.0/js/src/configure.in.orig 2013-12-11 22:22:50.000000000 +0000 -+++ mozjs-24.2.0/js/src/configure.in 2014-01-22 16:52:53.604726300 +0000 -@@ -1018,6 +1018,10 @@ - CPU_ARCH=arm - ;; - -+aarch64) -+ CPU_ARCH=aarch64 -+ ;; -+ - mips|mipsel) - CPU_ARCH="mips" - ;; ---- mozjs-24.2.0/mfbt/double-conversion/utils.h.orig 2014-01-22 16:52:42.596045903 +0000 -+++ mozjs-24.2.0/mfbt/double-conversion/utils.h 2014-01-22 16:52:53.605726272 +0000 -@@ -58,6 +58,7 @@ - defined(__mips__) || defined(__powerpc__) || \ - defined(__sparc__) || defined(__sparc) || defined(__s390__) || \ - defined(__SH4__) || defined(__alpha__) || \ -+ defined(__aarch64__) || \ - defined(_MIPS_ARCH_MIPS32R2) - #define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1 - #elif defined(_M_IX86) || defined(__i386__) || defined(__i386) diff --git a/extra/js/mozjs24-48-bit-VA-fix.patch b/extra/js/mozjs24-48-bit-VA-fix.patch deleted file mode 100644 index 3da8ddd7a..000000000 --- a/extra/js/mozjs24-48-bit-VA-fix.patch +++ /dev/null @@ -1,57 +0,0 @@ -From c3ef56fa3239d9133be922059300a6fd2e7c1435 Mon Sep 17 00:00:00 2001 -From: Zheng Xu -Date: Wed, 17 Aug 2016 11:59:15 +0800 -Subject: [PATCH] Bug 1143022 - Manually mmap on arm64 to ensure high 17 bits are clear. r=ehoogeveen - -There might be 48-bit VA on arm64 depending on kernel configuration. -Manually mmap heap memory to align with the assumption made by JS engine. - -Change-Id: Ic5d2b2fe4b758b3c87cc0688348af7e71a991146 ---- - -diff --git a/js/src/gc/Memory.cpp b/js/src/gc/Memory.cpp -index 153ccb4..b2d1311 100644 ---- a/js/src/gc/Memory.cpp -+++ b/js/src/gc/Memory.cpp -@@ -339,6 +339,41 @@ - return MAP_FAILED; - } - return region; -+#elif defined(__aarch64__) -+ /* -+ * There might be similar virtual address issue on arm64 which depends on -+ * hardware and kernel configurations. But the work around is slightly -+ * different due to the different mmap behavior. -+ * -+ * TODO: Merge with the above code block if this implementation works for -+ * ia64 and sparc64. -+ */ -+ const uintptr_t start = (uintptr_t)(0x0000070000000000UL); -+ const uintptr_t end = (uintptr_t)(0x0000800000000000UL); -+ const uintptr_t step = ChunkSize; -+ /* -+ * Optimization options if there are too many retries in practice: -+ * 1. Examine /proc/self/maps to find an available address. This file is -+ * not always available, however. In addition, even if we examine -+ * /proc/self/maps, we may still need to retry several times due to -+ * racing with other threads. -+ * 2. Use a global/static variable with lock to track the addresses we have -+ * allocated or tried. -+ */ -+ uintptr_t hint; -+ void* region = MAP_FAILED; -+ for (hint = start; region == MAP_FAILED && hint + length <= end; hint += step) { -+ region = mmap((void*)hint, length, prot, flags, fd, offset); -+ if (region != MAP_FAILED) { -+ if ((uintptr_t(region) + (length - 1)) & 0xffff800000000000) { -+ if (munmap(region, length)) { -+ MOZ_ASSERT(errno == ENOMEM); -+ } -+ region = MAP_FAILED; -+ } -+ } -+ } -+ return region == MAP_FAILED ? nullptr : region; - #else - return mmap(NULL, length, prot, flags, fd, offset); - #endif