Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

Add x86_64 support #19

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .buckconfig
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
[buildfile]
includes = //BUILD_DEFS
[ndk]
ndk_version = r10c
ndk_version = r10e
cpu_abis = armv7, arm64, x86, x86_64
gcc_version = 4.9
app_platform = android-21
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be 16 to support Android 4.1?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried different platforms, it looks like only android-21 can work, but i can figure out the reason.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK thanks, the JSC AAR file needs to work with API 16 since React Native supports API 16.

Copy link

@LegNeato LegNeato Oct 15, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably because android-21 was the first platform that contained the x86_64 and arm64 ndk ABI.

cppflags = \
-std=gnu11 \
-Wall \
Expand Down Expand Up @@ -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 = \
Expand Down
18 changes: 3 additions & 15 deletions jsc/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import os

SUPPORTED_PLATFORMS = '^android-(armv7|x86)$'
SUPPORTED_PLATFORMS = '^android-(armv7|arm64|x86|x86_64)$'

def unpack_rule(source, from_rule):
genrule(
Expand All @@ -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,
Expand Down Expand Up @@ -165,6 +152,7 @@ cxx_library(
supported_platforms_regex = SUPPORTED_PLATFORMS,
header_namespace = '',
headers = subdir_glob([
('WTF', '*.h'),
('WTF/wtf', '*.h'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

encounter an error, missing "config.h"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jsc/WTF/wtf/unicode/CollatorDefault.cpp:29:20: fatal error: config.h: No such file or directory
 #include "config.h"
                    ^
compilation terminated.

jsc/WTF/wtf/unicode/CollatorDefault.cpp:29:20: fatal error: config.h: No such file or directory
 #include "config.h"
                    ^
compilation terminated.

jsc/WTF/wtf/unicode/CollatorDefault.cpp:29:20: fatal error: config.h: No such file or directory
 #include "config.h"
                    ^
compilation terminated.

jsc/WTF/wtf/unicode/CollatorDefault.cpp:29:20: fatal error: config.h: No such file or directory
 #include "config.h"
                    ^
compilation terminated.

BUILD FAILED: //jsc:wtfcollation#android-x86,compile-pic-CollatorDefault.cpp.oe467649f failed with exit code 1:
c++ piped_preprocess_and_compile

('', 'extra_headers/*.h'),
]),
Expand Down Expand Up @@ -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-arm64', 'android-x86', 'android-x86_64'):
source = 'LLIntAssembly.{0}.h'.format(platform)
genrule(
name = source,
Expand Down
4 changes: 4 additions & 0 deletions jsc/extra_headers/LLIntAssembly.h
Original file line number Diff line number Diff line change
Expand Up @@ -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