From ee6e7e321c06e28b8b7d6f1b1378c4d2a5985add Mon Sep 17 00:00:00 2001 From: leeight Date: Fri, 7 Oct 2016 09:33:18 +0800 Subject: [PATCH 1/2] Add x86_64 support --- .buckconfig | 17 ++++++++++++++++- jsc/BUCK | 18 +++--------------- jsc/extra_headers/LLIntAssembly.h | 4 ++++ 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/.buckconfig b/.buckconfig index cf83d21..5506231 100644 --- a/.buckconfig +++ b/.buckconfig @@ -1,7 +1,10 @@ [buildfile] includes = //BUILD_DEFS [ndk] - ndk_version = r10c + ndk_version = r10e + cpu_abis = armv7, x86, x86_64 + gcc_version = 4.9 + app_platform = android-21 cppflags = \ -std=gnu11 \ -Wall \ @@ -88,6 +91,18 @@ -mfloat-abi=softfp \ -mthumb \ -Os + x86_64_cppflags = \ + -O2 + x86_64_cflags = \ + -funswitch-loops \ + -finline-limit=300 \ + -O2 + x86_64_cxxppflags = \ + -O2 + x86_64_cxxflags = \ + -funswitch-loops \ + -finline-limit=300 \ + -O2 x86_cppflags = \ -O2 x86_cflags = \ diff --git a/jsc/BUCK b/jsc/BUCK index f033522..a6bd46a 100644 --- a/jsc/BUCK +++ b/jsc/BUCK @@ -2,7 +2,7 @@ import os -SUPPORTED_PLATFORMS = '^android-(armv7|x86)$' +SUPPORTED_PLATFORMS = '^android-(armv7|x86|x86_64)$' def unpack_rule(source, from_rule): genrule( @@ -26,19 +26,6 @@ WTF_EXPORTED_PREPROCESSOR_FLAGS = [ '-DENABLE_GLOBAL_FASTMALLOC_NEW=0', ] -# Dirty hack, StdLibExtras.h assumes incorrectly that is_trivially_destructible -# have been added in 4.8.1 version while it was added in 4.8.0. We emulate PATCH -# version to be 1 so that StdLibExtra.h doesn't try to declare -# is_trivially_destructible -# Except from this single place JSC code doesn't check for 4.8.1 anywhere else -WTF_EXPORTED_PREPROCESSOR_FLAGS.extend([ - '-U__GNUC_PATCHLEVEL__', - '-D__GNUC_PATCHLEVEL__=1', - '-DPTHREAD_KEYS_MAX=1024', - '-DINTPTR_MAX=LONG_MAX', - '-Dlog2(x)=(log(x)/log(2.0))', -]) - cxx_library( name = 'wtfassertions', force_static = True, @@ -165,6 +152,7 @@ cxx_library( supported_platforms_regex = SUPPORTED_PLATFORMS, header_namespace = '', headers = subdir_glob([ + ('WTF', '*.h'), ('WTF/wtf', '*.h'), ('', 'extra_headers/*.h'), ]), @@ -936,7 +924,7 @@ SOURCES = glob([ 'JavaScriptCore/*.asm', ]) SOURCES.append(':InitBytecodes.asm') -for platform in ('android-armv7', 'android-x86'): +for platform in ('android-armv7', 'android-x86', 'android-x86_64'): source = 'LLIntAssembly.{0}.h'.format(platform) genrule( name = source, diff --git a/jsc/extra_headers/LLIntAssembly.h b/jsc/extra_headers/LLIntAssembly.h index 4673d9e..ec2f4c4 100644 --- a/jsc/extra_headers/LLIntAssembly.h +++ b/jsc/extra_headers/LLIntAssembly.h @@ -4,6 +4,10 @@ #include "LLIntAssembly.android-armv7.h" #elif defined(__ANDROID__) && defined(__i386__) #include "LLIntAssembly.android-x86.h" +#elif defined(__ANDROID__) && defined(__x86_64__) +#include "LLIntAssembly.android-x86_64.h" +#elif defined(__ANDROID__) && defined(__aarch64__) +#include "LLIntAssembly.android-arm64.h" #else #error "Platform not supported" #endif From 336b3a4cd8d1f1b2adfe9c45e950c1debcbbfdc2 Mon Sep 17 00:00:00 2001 From: leeight Date: Mon, 10 Oct 2016 15:54:39 +0800 Subject: [PATCH 2/2] Add arm64 --- .buckconfig | 2 +- jsc/BUCK | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.buckconfig b/.buckconfig index 5506231..6f6fb99 100644 --- a/.buckconfig +++ b/.buckconfig @@ -2,7 +2,7 @@ includes = //BUILD_DEFS [ndk] ndk_version = r10e - cpu_abis = armv7, x86, x86_64 + cpu_abis = armv7, arm64, x86, x86_64 gcc_version = 4.9 app_platform = android-21 cppflags = \ diff --git a/jsc/BUCK b/jsc/BUCK index a6bd46a..40b3259 100644 --- a/jsc/BUCK +++ b/jsc/BUCK @@ -2,7 +2,7 @@ import os -SUPPORTED_PLATFORMS = '^android-(armv7|x86|x86_64)$' +SUPPORTED_PLATFORMS = '^android-(armv7|arm64|x86|x86_64)$' def unpack_rule(source, from_rule): genrule( @@ -924,7 +924,7 @@ SOURCES = glob([ 'JavaScriptCore/*.asm', ]) SOURCES.append(':InitBytecodes.asm') -for platform in ('android-armv7', 'android-x86', 'android-x86_64'): +for platform in ('android-armv7', 'android-arm64', 'android-x86', 'android-x86_64'): source = 'LLIntAssembly.{0}.h'.format(platform) genrule( name = source,