[mozjs24] Add patch to fix FTBFS on aarch64

Peter Robinson pbrobinson at fedoraproject.org
Wed Jan 22 21:23:26 UTC 2014


commit e81ba11b01de54b3d8b8d10054eb5029557d8641
Author: Peter Robinson <pbrobinson at gmail.com>
Date:   Wed Jan 22 21:23:31 2014 +0000

    Add patch to fix FTBFS on aarch64

 .gitignore                             |    2 +-
 mozjs24-0001-Add-AArch64-support.patch |   51 ++++++++++++++++++++++++++++++++
 mozjs24.spec                           |    7 ++++-
 3 files changed, 58 insertions(+), 2 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index fea8516..016f8da 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1 @@
-/mozjs-24.2.0.tar.bz2
+/mozjs-24.*.tar.bz2
diff --git a/mozjs24-0001-Add-AArch64-support.patch b/mozjs24-0001-Add-AArch64-support.patch
new file mode 100644
index 0000000..3895fff
--- /dev/null
+++ b/mozjs24-0001-Add-AArch64-support.patch
@@ -0,0 +1,51 @@
+--- 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<intptr_t>(code) + size;
++        __builtin___clear_cache(reinterpret_cast<char*>(code), reinterpret_cast<char*>(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/mozjs24.spec b/mozjs24.spec
index 42c0ab7..8c89589 100644
--- a/mozjs24.spec
+++ b/mozjs24.spec
@@ -1,7 +1,7 @@
 Summary:	JavaScript interpreter and libraries
 Name:		mozjs24
 Version:	24.2.0
-Release:	2%{?dist}
+Release:	3%{?dist}
 License:	MPLv2.0
 Group:		Development/Languages
 URL:		http://www.mozilla.org/js/
@@ -12,6 +12,7 @@ BuildRequires:	/usr/bin/zip
 BuildRequires:	/usr/bin/python
 
 Patch0:		js17-build-fixes.patch
+Patch1:		mozjs24-0001-Add-AArch64-support.patch
 
 %description
 JavaScript is the Netscape-developed object scripting language used in millions
@@ -35,6 +36,7 @@ you will need to install %{name}-devel.
 rm js/src/editline -rf
 rm js/src/ctypes/libffi -rf
 %patch0 -p1
+%patch1 -p1
 chmod a+x configure
 
 %build
@@ -74,6 +76,9 @@ rm -f %{buildroot}%{_bindir}/js24-config
 %{_includedir}/mozjs-24
 
 %changelog
+* Wed Jan 22 2014 Peter Robinson <pbrobinson at fedoraproject.org> 24.2.0-3
+- Add patch to fix FTBFS on aarch64
+
 * Fri Jan 10 2014 Debarshi Ray <rishi at fedoraproject.org> 24.2.0-2
 - Fix a spelling mistake
 


More information about the scm-commits mailing list