1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-27 10:03:20 +00:00

Add ARM build fixes for JavaScript engine

PR:		197058
Differential Revision:	https://reviews.freebsd.org/D1683
Submitted by:	sbruno (earlier version)
Approved by:	bapt (mentor)
This commit is contained in:
Jan Beich 2015-01-26 20:30:05 +00:00
parent fe8ddba94c
commit 5e03fc411f
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=377953
10 changed files with 133 additions and 0 deletions

View File

@ -0,0 +1,14 @@
--- mozilla/js/src/assembler/jit/ExecutableAllocator.h~
+++ mozilla/js/src/assembler/jit/ExecutableAllocator.h
@@ -454,6 +454,11 @@ public:
{
User::IMB_Range(code, static_cast<char*>(code) + size);
}
+#elif WTF_CPU_ARM_TRADITIONAL && (WTF_OS_FREEBSD || WTF_OS_NETBSD)
+ static void cacheFlush(void* code, size_t size)
+ {
+ __clear_cache(code, reinterpret_cast<char*>(code) + size);
+ }
#elif WTF_CPU_ARM_TRADITIONAL && WTF_OS_LINUX && WTF_COMPILER_RVCT
static __asm void cacheFlush(void* code, size_t size);
#elif WTF_CPU_ARM_TRADITIONAL && (WTF_OS_LINUX || WTF_OS_ANDROID) && WTF_COMPILER_GCC

View File

@ -0,0 +1,11 @@
--- mozilla/js/src/jit/arm/Architecture-arm.cpp~
+++ mozilla/js/src/jit/arm/Architecture-arm.cpp
@@ -17,7 +17,7 @@
#define HWCAP_USE_HARDFP_ABI (1 << 28)
-#if !(defined(ANDROID) || defined(MOZ_B2G)) && !defined(JS_ARM_SIMULATOR)
+#if defined(__linux__) && !defined(ANDROID) && !defined(MOZ_B2G) && !defined(JS_ARM_SIMULATOR)
#define HWCAP_ARMv7 (1 << 29)
#include <asm/hwcap.h>
#else

View File

@ -0,0 +1,14 @@
--- js/src/assembler/jit/ExecutableAllocator.h~
+++ js/src/assembler/jit/ExecutableAllocator.h
@@ -454,6 +454,11 @@ public:
{
User::IMB_Range(code, static_cast<char*>(code) + size);
}
+#elif WTF_CPU_ARM_TRADITIONAL && (WTF_OS_FREEBSD || WTF_OS_NETBSD)
+ static void cacheFlush(void* code, size_t size)
+ {
+ __clear_cache(code, reinterpret_cast<char*>(code) + size);
+ }
#elif WTF_CPU_ARM_TRADITIONAL && WTF_OS_LINUX && WTF_COMPILER_RVCT
static __asm void cacheFlush(void* code, size_t size);
#elif WTF_CPU_ARM_TRADITIONAL && (WTF_OS_LINUX || WTF_OS_ANDROID) && WTF_COMPILER_GCC

View File

@ -0,0 +1,11 @@
--- js/src/jit/arm/Architecture-arm.cpp~
+++ js/src/jit/arm/Architecture-arm.cpp
@@ -17,7 +17,7 @@
#define HWCAP_USE_HARDFP_ABI (1 << 28)
-#if !(defined(ANDROID) || defined(MOZ_B2G)) && !defined(JS_ARM_SIMULATOR)
+#if defined(__linux__) && !defined(ANDROID) && !defined(MOZ_B2G) && !defined(JS_ARM_SIMULATOR)
#define HWCAP_ARMv7 (1 << 29)
#include <asm/hwcap.h>
#else

View File

@ -0,0 +1,16 @@
diff --git js/src/jit/ExecutableAllocator.h js/src/jit/ExecutableAllocator.h
index d55c8ed..ab6188f 100644
--- js/src/jit/ExecutableAllocator.h
+++ js/src/jit/ExecutableAllocator.h
@@ -405,6 +405,11 @@ public:
_flush_cache(reinterpret_cast<char*>(code), size, BCACHE);
#endif
}
+#elif defined(JS_CODEGEN_ARM) && (defined(__FreeBSD__) || defined(__NetBSD__))
+ static void cacheFlush(void* code, size_t size)
+ {
+ __clear_cache(code, reinterpret_cast<char*>(code) + size);
+ }
#elif defined(JS_CODEGEN_ARM) && (defined(__linux__) || defined(ANDROID)) && defined(__GNUC__)
static void cacheFlush(void* code, size_t size)
{

View File

@ -0,0 +1,13 @@
diff --git js/src/jit/arm/Architecture-arm.cpp js/src/jit/arm/Architecture-arm.cpp
index fe1373b..76641aa 100644
--- js/src/jit/arm/Architecture-arm.cpp
+++ js/src/jit/arm/Architecture-arm.cpp
@@ -16,7 +16,7 @@
#include "jit/arm/Assembler-arm.h"
#include "jit/RegisterSets.h"
-#if defined(ANDROID) || defined(JS_ARM_SIMULATOR)
+#if !defined(__linux__) || defined(ANDROID) || defined(JS_ARM_SIMULATOR)
// The Android NDK and B2G do not include the hwcap.h kernel header, and it is not
// defined when building the simulator, so inline the header defines we need.
# define HWCAP_VFP (1 << 6)

View File

@ -0,0 +1,14 @@
--- js/src/assembler/jit/ExecutableAllocator.h~
+++ js/src/assembler/jit/ExecutableAllocator.h
@@ -454,6 +454,11 @@ public:
{
User::IMB_Range(code, static_cast<char*>(code) + size);
}
+#elif WTF_CPU_ARM_TRADITIONAL && (WTF_OS_FREEBSD || WTF_OS_NETBSD)
+ static void cacheFlush(void* code, size_t size)
+ {
+ __clear_cache(code, reinterpret_cast<char*>(code) + size);
+ }
#elif WTF_CPU_ARM_TRADITIONAL && WTF_OS_LINUX && WTF_COMPILER_RVCT
static __asm void cacheFlush(void* code, size_t size);
#elif WTF_CPU_ARM_TRADITIONAL && (WTF_OS_LINUX || WTF_OS_ANDROID) && WTF_COMPILER_GCC

View File

@ -0,0 +1,11 @@
--- js/src/jit/arm/Architecture-arm.cpp~
+++ js/src/jit/arm/Architecture-arm.cpp
@@ -17,7 +17,7 @@
#define HWCAP_USE_HARDFP_ABI (1 << 28)
-#if !(defined(ANDROID) || defined(MOZ_B2G)) && !defined(JS_ARM_SIMULATOR)
+#if defined(__linux__) && !defined(ANDROID) && !defined(MOZ_B2G) && !defined(JS_ARM_SIMULATOR)
#define HWCAP_ARMv7 (1 << 29)
#include <asm/hwcap.h>
#else

View File

@ -0,0 +1,16 @@
diff --git js/src/jit/ExecutableAllocator.h js/src/jit/ExecutableAllocator.h
index d55c8ed..ab6188f 100644
--- mozilla/js/src/jit/ExecutableAllocator.h
+++ mozilla/js/src/jit/ExecutableAllocator.h
@@ -405,6 +405,11 @@ public:
_flush_cache(reinterpret_cast<char*>(code), size, BCACHE);
#endif
}
+#elif defined(JS_CODEGEN_ARM) && (defined(__FreeBSD__) || defined(__NetBSD__))
+ static void cacheFlush(void* code, size_t size)
+ {
+ __clear_cache(code, reinterpret_cast<char*>(code) + size);
+ }
#elif defined(JS_CODEGEN_ARM) && (defined(__linux__) || defined(ANDROID)) && defined(__GNUC__)
static void cacheFlush(void* code, size_t size)
{

View File

@ -0,0 +1,13 @@
diff --git js/src/jit/arm/Architecture-arm.cpp js/src/jit/arm/Architecture-arm.cpp
index fe1373b..76641aa 100644
--- mozilla/js/src/jit/arm/Architecture-arm.cpp
+++ mozilla/js/src/jit/arm/Architecture-arm.cpp
@@ -16,7 +16,7 @@
#include "jit/arm/Assembler-arm.h"
#include "jit/RegisterSets.h"
-#if defined(ANDROID) || defined(JS_ARM_SIMULATOR)
+#if !defined(__linux__) || defined(ANDROID) || defined(JS_ARM_SIMULATOR)
// The Android NDK and B2G do not include the hwcap.h kernel header, and it is not
// defined when building the simulator, so inline the header defines we need.
# define HWCAP_VFP (1 << 6)