-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- add patches to fix cross-compile for mac - Get travis semi-working - Update build and publish scripts
- Loading branch information
1 parent
9b49f68
commit af4931b
Showing
12 changed files
with
440 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
solutions = [ | ||
{ | ||
"managed": False, | ||
"name": "v8", | ||
"url": "https://chromium.googlesource.com/v8/v8.git", | ||
"custom_deps": {}, | ||
"deps_file": "DEPS", | ||
"safesync_url": "", | ||
}, | ||
] | ||
target_os = ['android'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
entries = { | ||
'v8': 'https://chromium.googlesource.com/v8/v8.git', | ||
'v8/build/gyp': 'https://chromium.googlesource.com/external/gyp.git@3f21260b43401553c37bb28090b65a75577d5b4e', | ||
'v8/buildtools': 'https://chromium.googlesource.com/chromium/buildtools.git@ef7f1f539cff0441c4401d8c052e54cfd01bff07', | ||
'v8/test/benchmarks/data': 'https://chromium.googlesource.com/v8/deps/third_party/benchmarks.git@05d7188267b4560491ff9155c5ee13e207ecd65f', | ||
'v8/test/mozilla/data': 'https://chromium.googlesource.com/v8/deps/third_party/mozilla-tests.git@f6c578a10ea707b1a8ab0b88943fe5115ce2b9be', | ||
'v8/test/simdjs/data': 'https://chromium.googlesource.com/external/github.com/tc39/ecmascript_simd.git@c8ef63c728283debc25891123eb00482fee4b8cd', | ||
'v8/test/test262/data': 'https://chromium.googlesource.com/external/github.com/tc39/test262.git@26e6fd7c1779a63913cc7720cbc6c87b3b7b3285', | ||
'v8/testing/gmock': 'https://chromium.googlesource.com/external/googlemock.git@0421b6f358139f02e102c9c332ce19a33faf75be', | ||
'v8/testing/gtest': 'https://chromium.googlesource.com/external/github.com/google/googletest.git@6f8a66431cb592dad629028a50b3dd418a408c87', | ||
'v8/third_party/icu': 'https://chromium.googlesource.com/chromium/deps/icu.git@94e4b770ce2f6065d4261d29c32683a6099b9d93', | ||
'v8/tools/clang': 'https://chromium.googlesource.com/chromium/src/tools/clang.git@a56c9063d582660d29b32f967ce20875c589fc3e', | ||
'v8/tools/swarming_client': 'https://chromium.googlesource.com/external/swarming.client.git@8fce79620b04bbe5415ace1103db27505bdc4c06', | ||
'v8/buildtools/clang_format/script': 'https://chromium.googlesource.com/chromium/llvm-project/cfe/tools/clang-format.git@81edd558fea5dd7855d67a1dc61db34ae8c1fd63', | ||
'v8/buildtools/third_party/libc++/trunk': 'https://chromium.googlesource.com/chromium/llvm-project/libcxx.git@48198f9110397fff47fe7c37cbfa296be7d44d3d', | ||
'v8/buildtools/third_party/libc++abi/trunk': 'https://chromium.googlesource.com/chromium/llvm-project/libcxxabi.git@4ad1009ab3a59fa7a6896d74d5e4de5885697f95', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
build | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,38 @@ | ||
language: c++ | ||
language: cpp | ||
|
||
env: | ||
global: | ||
addons: | ||
apt: | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
packages: | ||
- gcc-4.8 | ||
- g++-4.8 | ||
|
||
compiler: gcc-4.8 | ||
|
||
before_install: | ||
- sudo apt-get install -qq g++-4.8-multilib | ||
- sudo apt-get install -qq gcc-4.8-multilib | ||
|
||
install: | ||
- sudo apt-get -y install gcc-multilib g++-multilib | ||
- wget http://dl.google.com/android/ndk/android-ndk-r8c-linux-x86.tar.bz2 | ||
- tar jxf android-ndk-r8c-linux-x86.tar.bz2 | ||
- export ANDROID_NDK=${PWD}/android-ndk-r8c | ||
- export CC_host=gcc-4.8 | ||
- export CXX_host=g++-4.8 | ||
- unset CXX | ||
- unset CC | ||
- git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git | ||
- export PATH=`pwd`/depot_tools:"$PATH" | ||
- git apply 0000-hack-gclient-for-travis.patch | ||
- cd v8 | ||
- gclient sync | ||
- cd .. | ||
- git apply 0001-Fix-cross-compilation-for-Android-from-a-Mac.patch | ||
- git apply 0002-Create-standalone-static-libs.patch | ||
- wget http://dl.google.com/android/ndk/android-ndk-r10e-linux-x86_64.bin | ||
- chmod a+x android-ndk-r10e-linux-x86_64.bin | ||
- ./android-ndk-r10e-linux-x86_64.bin -y | grep -v Extracting | ||
- export ANDROID_NDK=${PWD}/android-ndk-r10e | ||
|
||
script: | ||
- ./build_v8.sh | ||
- ./build_v8.sh -j4 | ||
|
||
after_success: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
From 6b96be3c9d18a1691c2d8ec1e28833ffdf643b67 Mon Sep 17 00:00:00 2001 | ||
From: sgtcoolguy <[email protected]> | ||
Date: Tue, 27 Oct 2015 13:18:09 -0400 | ||
Subject: [PATCH 1/1] blah | ||
|
||
--- | ||
.gclient | 1 - | ||
1 file changed, 1 deletion(-) | ||
|
||
diff --git a/.gclient b/.gclient | ||
index aac18a7..97f6529 100644 | ||
--- a/.gclient | ||
+++ b/.gclient | ||
@@ -8,4 +8,3 @@ solutions = [ | ||
"safesync_url": "", | ||
}, | ||
] | ||
-target_os = ['android'] | ||
-- | ||
2.6.2 | ||
|
207 changes: 207 additions & 0 deletions
207
0001-Fix-cross-compilation-for-Android-from-a-Mac.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,207 @@ | ||
From 7c9847d2cb542dc7d5402914ecdd9ccaaed0eda8 Mon Sep 17 00:00:00 2001 | ||
From: sgtcoolguy <[email protected]> | ||
Date: Fri, 23 Oct 2015 10:14:46 -0400 | ||
Subject: [PATCH 1/2] Fix cross-compilation for Android from a Mac | ||
|
||
--- | ||
AUTHORS | 1 + | ||
Makefile.android | 10 ++++++++++ | ||
build/standalone.gypi | 26 ++++++++++++++++++++------ | ||
tools/gyp/v8.gyp | 6 ++++++ | ||
4 files changed, 37 insertions(+), 6 deletions(-) | ||
|
||
diff --git a/v8/AUTHORS b/v8/AUTHORS | ||
index b588084..d8c711c 100644 | ||
--- a/v8/AUTHORS | ||
+++ b/v8/AUTHORS | ||
@@ -46,6 +46,7 @@ Caitlin Potter <[email protected]> | ||
Craig Schlenter <[email protected]> | ||
Chris Nardi <[email protected]> | ||
Christopher A. Taylor <[email protected]> | ||
+Christopher Williams <[email protected]> | ||
Daniel Andersson <[email protected]> | ||
Daniel James <[email protected]> | ||
Douglas Crosher <[email protected]> | ||
diff --git a/v8/Makefile.android b/v8/Makefile.android | ||
index c49cb85..51e4570 100644 | ||
--- a/v8/Makefile.android | ||
+++ b/v8/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/v8/build/standalone.gypi b/v8/build/standalone.gypi | ||
index 4006944..55a7f0c 100644 | ||
--- a/v8/build/standalone.gypi | ||
+++ b/v8/build/standalone.gypi | ||
@@ -253,44 +253,50 @@ | ||
'android_ndk_root%': '<(base_dir)/third_party/android_tools/ndk/', | ||
'android_host_arch%': "<!(uname -m | sed -e 's/i[3456]86/x86/')", | ||
'host_os%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')", | ||
+ 'os_folder_name%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/darwin/')", | ||
}, | ||
|
||
# Copy conditionally-set variables out one scope. | ||
'android_ndk_root%': '<(android_ndk_root)', | ||
'host_os%': '<(host_os)', | ||
+ 'os_folder_name%': '<(os_folder_name)', | ||
|
||
'conditions': [ | ||
['target_arch == "ia32"', { | ||
- 'android_toolchain%': '<(android_ndk_root)/toolchains/x86-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin', | ||
+ 'android_toolchain%': '<(android_ndk_root)/toolchains/x86-4.9/prebuilt/<(os_folder_name)-<(android_host_arch)/bin', | ||
'android_target_arch%': 'x86', | ||
'android_target_platform%': '16', | ||
+ 'arm_version%': 'default', | ||
}], | ||
['target_arch == "x64"', { | ||
- 'android_toolchain%': '<(android_ndk_root)/toolchains/x86_64-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin', | ||
+ 'android_toolchain%': '<(android_ndk_root)/toolchains/x86_64-4.9/prebuilt/<(os_folder_name)-<(android_host_arch)/bin', | ||
'android_target_arch%': 'x86_64', | ||
'android_target_platform%': '21', | ||
+ 'arm_version%': 'default', | ||
}], | ||
['target_arch=="arm"', { | ||
- 'android_toolchain%': '<(android_ndk_root)/toolchains/arm-linux-androideabi-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin', | ||
+ 'android_toolchain%': '<(android_ndk_root)/toolchains/arm-linux-androideabi-4.9/prebuilt/<(os_folder_name)-<(android_host_arch)/bin', | ||
'android_target_arch%': 'arm', | ||
'android_target_platform%': '16', | ||
'arm_version%': 7, | ||
}], | ||
['target_arch == "arm64"', { | ||
- 'android_toolchain%': '<(android_ndk_root)/toolchains/aarch64-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin', | ||
+ 'android_toolchain%': '<(android_ndk_root)/toolchains/aarch64-linux-android-4.9/prebuilt/<(os_folder_name)-<(android_host_arch)/bin', | ||
'android_target_arch%': 'arm64', | ||
'android_target_platform%': '21', | ||
'arm_version%': 'default', | ||
}], | ||
['target_arch == "mipsel"', { | ||
- 'android_toolchain%': '<(android_ndk_root)/toolchains/mipsel-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin', | ||
+ 'android_toolchain%': '<(android_ndk_root)/toolchains/mipsel-linux-android-4.9/prebuilt/<(os_folder_name)-<(android_host_arch)/bin', | ||
'android_target_arch%': 'mips', | ||
'android_target_platform%': '16', | ||
+ 'arm_version%': 'default', | ||
}], | ||
['target_arch == "mips64el"', { | ||
- 'android_toolchain%': '<(android_ndk_root)/toolchains/mips64el-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin', | ||
+ 'android_toolchain%': '<(android_ndk_root)/toolchains/mips64el-linux-android-4.9/prebuilt/<(os_folder_name)-<(android_host_arch)/bin', | ||
'android_target_arch%': 'mips64', | ||
'android_target_platform%': '21', | ||
+ 'arm_version%': 'default', | ||
}], | ||
], | ||
}, | ||
@@ -338,9 +344,13 @@ | ||
'android_stlport_library': 'stlport_static', | ||
}], # OS=="android" | ||
['host_clang==1', { | ||
+ 'host_ld': '<!(which ld)', | ||
+ 'host_ranlib': '<!(which ranlib)', | ||
'host_cc': '<(clang_dir)/bin/clang', | ||
'host_cxx': '<(clang_dir)/bin/clang++', | ||
}, { | ||
+ 'host_ld': '<!(which ld)', | ||
+ 'host_ranlib': '<!(which ranlib)', | ||
'host_cc': '<!(which gcc)', | ||
'host_cxx': '<!(which g++)', | ||
}], | ||
@@ -1142,8 +1152,12 @@ | ||
# Hardcode the compiler names in the Makefile so that | ||
# it won't depend on the environment at make time. | ||
'make_global_settings': [ | ||
+ ['LD', '<!(/bin/echo -n <(android_toolchain)/../*/bin/ld)'], | ||
+ ['RANLIB', '<!(/bin/echo -n <(android_toolchain)/../*/bin/ranlib)'], | ||
['CC', '<!(/bin/echo -n <(android_toolchain)/*-gcc)'], | ||
['CXX', '<!(/bin/echo -n <(android_toolchain)/*-g++)'], | ||
+ ['LD.host', '<(host_ld)'], | ||
+ ['RANLIB.host', '<(host_ranlib)'], | ||
['CC.host', '<(host_cc)'], | ||
['CXX.host', '<(host_cxx)'], | ||
], | ||
diff --git a/v8/tools/gyp/v8.gyp b/v8/tools/gyp/v8.gyp | ||
index 3937737..e001684 100644 | ||
--- a/v8/tools/gyp/v8.gyp | ||
+++ b/v8/tools/gyp/v8.gyp | ||
@@ -146,6 +146,7 @@ | ||
{ | ||
'target_name': 'v8_snapshot', | ||
'type': 'static_library', | ||
+ 'standalone_static_library': 1, | ||
'conditions': [ | ||
['want_separate_host_toolset==1', { | ||
'toolsets': ['host', 'target'], | ||
@@ -223,6 +224,7 @@ | ||
{ | ||
'target_name': 'v8_nosnapshot', | ||
'type': 'static_library', | ||
+ 'standalone_static_library': 1, | ||
'dependencies': [ | ||
'v8_base', | ||
], | ||
@@ -256,6 +258,7 @@ | ||
{ | ||
'target_name': 'v8_external_snapshot', | ||
'type': 'static_library', | ||
+ 'standalone_static_library': 1, | ||
'conditions': [ | ||
[ 'v8_use_external_startup_data==1', { | ||
'conditions': [ | ||
@@ -361,6 +364,7 @@ | ||
{ | ||
'target_name': 'v8_base', | ||
'type': 'static_library', | ||
+ 'standalone_static_library': 1, | ||
'dependencies': [ | ||
'v8_libbase', | ||
], | ||
@@ -1448,6 +1452,7 @@ | ||
{ | ||
'target_name': 'v8_libbase', | ||
'type': 'static_library', | ||
+ 'standalone_static_library': 1, | ||
'variables': { | ||
'optimize': 'max', | ||
}, | ||
@@ -1712,6 +1717,7 @@ | ||
{ | ||
'target_name': 'v8_libplatform', | ||
'type': 'static_library', | ||
+ 'standalone_static_library': 1, | ||
'variables': { | ||
'optimize': 'max', | ||
}, | ||
-- | ||
2.6.2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
From ebf43f2621cd22f1bb24d61c5da425dcfc53424a Mon Sep 17 00:00:00 2001 | ||
From: sgtcoolguy <[email protected]> | ||
Date: Fri, 23 Oct 2015 23:44:16 -0400 | ||
Subject: [PATCH] Create standalone static libs | ||
|
||
--- | ||
icu.gyp | 11 +++++++++++ | ||
1 file changed, 11 insertions(+) | ||
|
||
diff --git a/v8/third_party/icu/icu.gyp b/v8/third_party/icu/icu.gyp | ||
index ee206fe..6231e82 100644 | ||
--- a/v8/third_party/icu/icu.gyp | ||
+++ b/v8/third_party/icu/icu.gyp | ||
@@ -103,6 +103,7 @@ | ||
{ | ||
'target_name': 'icudata', | ||
'type': 'static_library', | ||
+ 'standalone_static_library': 1, | ||
'defines': [ | ||
'U_HIDE_DATA_SYMBOL', | ||
], | ||
@@ -176,6 +177,11 @@ | ||
{ | ||
'target_name': 'icui18n', | ||
'type': '<(component)', | ||
+ 'conditions': [ | ||
+ [ 'componen!="shared_library"', { | ||
+ 'standalone_static_library': 1, | ||
+ }], | ||
+ ], | ||
'sources': [ | ||
'<@(icui18n_sources)', | ||
], | ||
@@ -257,6 +263,11 @@ | ||
{ | ||
'target_name': 'icuuc', | ||
'type': '<(component)', | ||
+ 'conditions': [ | ||
+ [ 'component!="shared_library"', { | ||
+ 'standalone_static_library': 1, | ||
+ }], | ||
+ ], | ||
'sources': [ | ||
'<@(icuuc_sources)', | ||
], | ||
-- | ||
2.6.2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.