gnu: Add kafs-client
[jackhill/guix/guix.git] / gnu / packages / patches / mozjs17-aarch64-support.patch
CommitLineData
a64b7da5
EF
1https://build.opensuse.org/package/view_file/openSUSE:Factory/mozjs17/mozjs-aarch64-support.patch
2
3index c071c33..90764c3 100644
4--- a/js/src/assembler/jit/ExecutableAllocator.h
5+++ b/js/src/assembler/jit/ExecutableAllocator.h
6@@ -382,6 +382,12 @@ public:
7 {
8 reprotectRegion(start, size, Executable);
9 }
10+#elif WTF_CPU_AARCH64 && WTF_PLATFORM_LINUX
11+ static void cacheFlush(void* code, size_t size)
12+ {
13+ intptr_t end = reinterpret_cast<intptr_t>(code) + size;
14+ __builtin___clear_cache(reinterpret_cast<char*>(code), reinterpret_cast<char*>(end));
15+ }
16 #else
17 static void makeWritable(void*, size_t) {}
18 static void makeExecutable(void*, size_t) {}
19diff --git a/js/src/assembler/wtf/Platform.h b/js/src/assembler/wtf/Platform.h
20index 0c84896..e8763a7 100644
21--- a/js/src/assembler/wtf/Platform.h
22+++ b/js/src/assembler/wtf/Platform.h
23@@ -325,6 +325,10 @@
24 #define WTF_THUMB_ARCH_VERSION 0
25 #endif
26
27+/* CPU(AArch64) - 64-bit ARM */
28+#if defined(__aarch64__)
29+#define WTF_CPU_AARCH64 1
30+#endif
31
32 /* WTF_CPU_ARMV5_OR_LOWER - ARM instruction set v5 or earlier */
33 /* On ARMv5 and below the natural alignment is required.
34diff --git a/js/src/configure.in b/js/src/configure.in
35index 15605b2..19fd704 100644
36--- a/js/src/configure.in
37+++ b/js/src/configure.in
38@@ -1121,6 +1121,10 @@ arm*)
39 CPU_ARCH=arm
40 ;;
41
42+aarch64)
43+ CPU_ARCH=aarch64
44+ ;;
45+
46 mips|mipsel)
47 CPU_ARCH=&quot;mips&quot;
48 ;;
49diff --git a/mfbt/double-conversion/utils.h b/mfbt/double-conversion/utils.h
50index 0eec2d9..fe26dab 100644
51--- a/mfbt/double-conversion/utils.h
52+++ b/mfbt/double-conversion/utils.h
53@@ -58,6 +58,7 @@
54 defined(__mips__) || defined(__powerpc__) || \
55 defined(__sparc__) || defined(__sparc) || defined(__s390__) || \
56 defined(__SH4__) || defined(__alpha__) || \
57+ defined(__aarch64__) || \
58 defined(_MIPS_ARCH_MIPS32R2)
59 #define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1
60 #elif defined(_M_IX86) || defined(__i386__) || defined(__i386)