Skip to content

Commit

Permalink
Merge pull request #30 from garymathews/TIMOB-25441
Browse files Browse the repository at this point in the history
[TIMOB-25441] Build ARM64 libraries
  • Loading branch information
garymathews committed Oct 26, 2017
2 parents 4bf3350 + bfaf3cc commit 6919c2a
Show file tree
Hide file tree
Showing 4 changed files with 199 additions and 6 deletions.
8 changes: 4 additions & 4 deletions Jenkinsfile
Expand Up @@ -40,11 +40,11 @@ def build(arch, mode) {
timestamps {
def gitRevision = '' // we calculate this later for the v8 repo
// FIXME How do we get the current branch in a detached state?
def gitBranch = '6.1-lkgr'
def gitBranch = '6.2-lkgr'
def timestamp = '' // we generate this later
def v8Version = '' // we calculate this later from the v8 repo
def modes = ['release', 'debug']
def arches = ['arm', 'ia32']
def modes = ['release'] // 'debug'
def arches = ['arm', 'arm64', 'ia32']

node('osx && git && android-ndk && python') {
stage('Checkout') {
Expand Down Expand Up @@ -88,7 +88,7 @@ timestamps {
withEnv(["PATH+DEPOT_TOOLS=${env.WORKSPACE}/depot_tools"]) {
dir('v8') {
sh 'rm -rf out/'
sh 'git apply ../ndk11c_6.1.patch'
sh 'git apply ../ndk11c_6.2.patch'
sh '../depot_tools/gclient sync --shallow --no-history --reset --force' // needs python
}
}
Expand Down
2 changes: 1 addition & 1 deletion build_v8.sh
Expand Up @@ -32,7 +32,7 @@ LIB_VERSION=arm
THIRDPARTY=0
CLEAN=0
USE_V8_SNAPSHOT=0
PLATFORM_VERSION=android-9
PLATFORM_VERSION=android-23

while getopts "htscn:j:m:l:p:" OPTION; do
case $OPTION in
Expand Down
193 changes: 193 additions & 0 deletions ndk11c_6.2.patch
@@ -0,0 +1,193 @@
diff --git a/DEPS b/DEPS
index 4b64895ced..f48c7e2fcc 100644
--- a/DEPS
+++ b/DEPS
@@ -45,8 +45,6 @@ deps = {

deps_os = {
"android": {
- "v8/third_party/android_tools":
- Var("chromium_url") + "/android_tools.git" + "@" + "e9d4018e149d50172ed462a7c21137aa915940ec",
"v8/third_party/catapult":
Var('chromium_url') + "/external/github.com/catapult-project/catapult.git" + "@" + "7149cbfdfd26a5dd8e5d96cbb1da9356e2813a5d",
},
@@ -54,7 +52,6 @@ deps_os = {

recursedeps = [
"v8/buildtools",
- "v8/third_party/android_tools",
]

include_rules = [
diff --git a/Makefile b/Makefile
index eb146ac244..2ca1cc709f 100644
--- a/Makefile
+++ b/Makefile
@@ -47,6 +47,13 @@ endif
ifeq ($(disassembler), on)
GYPFLAGS += -Dv8_enable_disassembler=1
endif
+# inspector=on/off
+ifeq ($(inspector), on)
+ GYPFLAGS += -Dv8_enable_inspector=1
+endif
+ifeq ($(inspector), off)
+ GYPFLAGS += -Dv8_enable_inspector=0
+endif
# objectprint=on
ifeq ($(objectprint), on)
GYPFLAGS += -Dv8_object_print=1
diff --git a/Makefile.android b/Makefile.android
index 417152177d..e129be63e3 100644
--- a/Makefile.android
+++ b/Makefile.android
@@ -35,18 +35,27 @@ MODES = release debug
ANDROID_BUILDS = $(foreach mode,$(MODES), \
$(addsuffix .$(mode),$(ANDROID_ARCHES)))

+HOST_OS = $(shell uname -s | sed -e 's/Linux/linux/;s/Darwin/darwin/')
+HOST_ARCH = $(shell uname -m | sed -e 's/i[3456]86/x86/')
+
ifeq ($(ARCH), android_arm)
DEFINES = target_arch=arm v8_target_arch=arm
+ ANDROID_TOOLCHAIN = $(ANDROID_NDK_ROOT)/toolchains/arm-linux-androideabi-4.9/prebuilt/$(HOST_OS)-$(HOST_ARCH)/arm-linux-androideabi/bin
else ifeq ($(ARCH), android_arm64)
DEFINES = target_arch=arm64 v8_target_arch=arm64
+ ANDROID_TOOLCHAIN = $(ANDROID_NDK_ROOT)/toolchains/aarch64-linux-android-4.9/prebuilt/$(HOST_OS)-$(HOST_ARCH)/aarch64-linux-android/bin
else ifeq ($(ARCH), android_mipsel)
DEFINES = target_arch=mipsel v8_target_arch=mipsel
+ ANDROID_TOOLCHAIN = $(ANDROID_NDK_ROOT)/toolchains/mipsel-linux-android-4.9/prebuilt/$(HOST_OS)-$(HOST_ARCH)/mipsel-linux-android/bin
else ifeq ($(ARCH), android_ia32)
DEFINES = target_arch=ia32 v8_target_arch=ia32
+ ANDROID_TOOLCHAIN = $(ANDROID_NDK_ROOT)/toolchains/x86-4.9/prebuilt/$(HOST_OS)-$(HOST_ARCH)/i686-linux-android/bin
else ifeq ($(ARCH), android_x64)
DEFINES = target_arch=x64 v8_target_arch=x64
+ ANDROID_TOOLCHAIN = $(ANDROID_NDK_ROOT)/toolchains/x86_64-4.9/prebuilt/$(HOST_OS)-$(HOST_ARCH)/x86_64-linux-android/bin
else ifeq ($(ARCH), android_x87)
DEFINES = target_arch=ia32 v8_target_arch=x87
+ ANDROID_TOOLCHAIN = $(ANDROID_NDK_ROOT)/toolchains/x86-4.9/prebuilt/$(HOST_OS)-$(HOST_ARCH)/i686-linux-android/bin
else
$(error Target architecture "${ARCH}" is not supported)
endif
@@ -57,6 +66,7 @@ DEFINES += OS=android
.SECONDEXPANSION:
$(ANDROID_BUILDS): $(OUTDIR)/Makefile.$$@
@$(MAKE) -C "$(OUTDIR)" -f Makefile.$@ \
+ AR="$(ANDROID_TOOLCHAIN)/ar" \
BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \
python -c "print raw_input().capitalize()") \
builddir="$(shell pwd)/$(OUTDIR)/$@"
diff --git a/gypfiles/standalone.gypi b/gypfiles/standalone.gypi
index 63930d8aef..0419da0097 100644
--- a/gypfiles/standalone.gypi
+++ b/gypfiles/standalone.gypi
@@ -1116,7 +1116,7 @@
'configurations': {
'Release': {
'cflags': [
- '-fomit-frame-pointer',
+ '-fomit-frame-pointer', '-O2'
],
}, # Release
}, # configurations
@@ -1234,10 +1234,7 @@
}],
['(target_arch=="arm" or target_arch=="arm64" or target_arch=="x64" or target_arch=="ia32") and component!="shared_library"', {
'cflags': [
- '-fPIE',
- ],
- 'ldflags': [
- '-pie',
+ '-fPIC',
],
}],
],
diff --git a/src/v8.gyp b/src/v8.gyp
index ea0f8780d7..2de604b38e 100644
--- a/src/v8.gyp
+++ b/src/v8.gyp
@@ -42,7 +42,7 @@
{
'target_name': 'v8',
'dependencies_traverse': 1,
- 'dependencies': ['v8_maybe_snapshot', 'v8_dump_build_config'],
+ 'dependencies': ['v8_maybe_snapshot'],
'conditions': [
['want_separate_host_toolset==1', {
'toolsets': ['host', 'target'],
@@ -135,6 +135,7 @@
{
'target_name': 'v8_builtins_setup',
'type': 'static_library',
+ 'standalone_static_library': 1,
'dependencies': [
'v8_builtins_generators',
],
@@ -159,6 +160,7 @@
{
'target_name': 'v8_builtins_generators',
'type': 'static_library',
+ 'standalone_static_library': 1,
'dependencies': [
'v8_base',
],
@@ -291,6 +293,7 @@
{
'target_name': 'v8_snapshot',
'type': 'static_library',
+ 'standalone_static_library': 1,
'conditions': [
['want_separate_host_toolset==1', {
'toolsets': ['host', 'target'],
@@ -375,6 +378,7 @@
{
'target_name': 'v8_nosnapshot',
'type': 'static_library',
+ 'standalone_static_library': 1,
'dependencies': [
'v8_base',
],
@@ -406,6 +410,7 @@
{
'target_name': 'v8_external_snapshot',
'type': 'static_library',
+ 'standalone_static_library': 1,
'conditions': [
[ 'v8_use_external_startup_data==1', {
'conditions': [
@@ -524,6 +529,7 @@
{
'target_name': 'v8_base',
'type': 'static_library',
+ 'standalone_static_library': 1,
'dependencies': [
'v8_libbase',
'v8_libsampler',
@@ -1827,7 +1833,8 @@
},
{
'target_name': 'v8_libbase',
- 'type': '<(component)',
+ 'type': 'static_library',
+ 'standalone_static_library': 1,
'variables': {
'optimize': 'max',
},
@@ -2157,7 +2164,8 @@
},
{
'target_name': 'v8_libplatform',
- 'type': '<(component)',
+ 'type': 'static_library',
+ 'standalone_static_library': 1,
'variables': {
'optimize': 'max',
},
@@ -2209,6 +2217,7 @@
{
'target_name': 'v8_libsampler',
'type': 'static_library',
+ 'standalone_static_library': 1,
'variables': {
'optimize': 'max',
},
2 changes: 1 addition & 1 deletion v8
Submodule v8 updated 1541 files

0 comments on commit 6919c2a

Please sign in to comment.