Skip to content

Commit

Permalink
V8 6.6 (#33)
Browse files Browse the repository at this point in the history
* Update v8 to tip of 6.6-lkgr

* Build against 6.6 with ninja and GN

* Try to fix command to grab branch name

* Copy modified gn build file to fix AR executable path on Android

* Fix git branch name in json file. try to avoid copying non-header files to include dir
  • Loading branch information
sgtcoolguy authored Mar 15, 2018
1 parent 7973c42 commit 1ad7c11
Show file tree
Hide file tree
Showing 9 changed files with 271 additions and 110 deletions.
26 changes: 13 additions & 13 deletions .gclient_entries
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
entries = {
'v8': 'https://chromium.googlesource.com/v8/v8.git',
'v8/base/trace_event/common': 'https://chromium.googlesource.com/chromium/src/base/trace_event/common.git@0e9a47d74970bee1bbfc063c47215406f8918699',
'v8/build': 'https://chromium.googlesource.com/chromium/src/build.git@9338ce52d0b9bcef34c38285fbd5023b62739fac',
'v8/buildtools': 'https://chromium.googlesource.com/chromium/buildtools.git@505de88083136eefd056e5ee4ca0f01fe9b33de8',
'v8/build': 'https://chromium.googlesource.com/chromium/src/build.git@b1d6c28b4a64128ad856d9da458afda2861fddab',
'v8/buildtools': 'https://chromium.googlesource.com/chromium/buildtools.git@2888931260f2a32bc583f005bd807a561b2fa6af',
'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/test262/data': 'https://chromium.googlesource.com/external/github.com/tc39/test262.git@5d4c667b271a9b39d0de73aef5ffe6879c6f8811',
'v8/test/test262/data': 'https://chromium.googlesource.com/external/github.com/tc39/test262.git@b59d956b3c268abd0875aeb87d6688f4c7aafc9b',
'v8/test/test262/harness': 'https://chromium.googlesource.com/external/github.com/test262-utils/test262-harness-py.git@0f2acdd882c84cff43b9d60df7574a1901e2cdcd',
'v8/test/wasm-js': 'https://chromium.googlesource.com/external/github.com/WebAssembly/spec.git@a7e226a92e660a3d5413cfea4269824f513259d2',
'v8/test/wasm-js': 'https://chromium.googlesource.com/external/github.com/WebAssembly/spec.git@4653fc002a510b4f207af07f2c7c61b13dba78d9',
'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/catapult': 'https://chromium.googlesource.com/catapult.git@11d7efb857ae77eff1cea4640e3f3d9ac49cba0a',
'v8/third_party/catapult': 'https://chromium.googlesource.com/catapult.git@8a42ad3cb185e340c32b20f657980fd057e3769f',
'v8/third_party/colorama/src': 'https://chromium.googlesource.com/external/colorama.git@799604a1041e9b3bc5d2789ecbd7e8db2e18e6b8',
'v8/third_party/icu': 'https://chromium.googlesource.com/chromium/deps/icu.git@741688ebf328da9adc52505248bf4e2ef868722c',
'v8/third_party/instrumented_libraries': 'https://chromium.googlesource.com/chromium/src/third_party/instrumented_libraries.git@28417458ac4dc79f68915079d0f283f682504cc0',
'v8/third_party/icu': 'https://chromium.googlesource.com/chromium/deps/icu.git@d888fd2a1be890f4d35e43f68d6d79f42519a357',
'v8/third_party/instrumented_libraries': 'https://chromium.googlesource.com/chromium/src/third_party/instrumented_libraries.git@b745ddca2c63719167c0f2008ae19e667c5e9952',
'v8/third_party/jinja2': 'https://chromium.googlesource.com/chromium/src/third_party/jinja2.git@d34383206fa42d52faa10bb9931d6d538f3a57e0',
'v8/third_party/markupsafe': 'https://chromium.googlesource.com/chromium/src/third_party/markupsafe.git@8f45f5cfa0009d2a70589bcda0349b8cb2b72783',
'v8/tools/clang': 'https://chromium.googlesource.com/chromium/src/tools/clang.git@8688d267571de76a56746324dcc249bf4232b85a',
'v8/tools/clang': 'https://chromium.googlesource.com/chromium/src/tools/clang.git@b3d3f5920b161f95f1a8ffe08b75c695e0edf350',
'v8/tools/gyp': 'https://chromium.googlesource.com/external/gyp.git@d61a9397e668fa9843c4aa7da9e79460fe590bfb',
'v8/tools/luci-go': 'https://chromium.googlesource.com/chromium/src/tools/luci-go.git@45a8a51fda92e123619a69e7644d9c64a320b0c1',
'v8/tools/swarming_client': 'https://chromium.googlesource.com/infra/luci/client-py.git@4bd9152f8a975d57c972c071dfb4ddf668e02200',
'v8/tools/luci-go': 'https://chromium.googlesource.com/chromium/src/tools/luci-go.git@ff0709d4283b1f233dcf0c9fec1672c6ecaed2f1',
'v8/tools/swarming_client': 'https://chromium.googlesource.com/infra/luci/client-py.git@88229872dd17e71658fe96763feaa77915d8cbd6',
'v8/buildtools/clang_format/script': 'https://chromium.googlesource.com/chromium/llvm-project/cfe/tools/clang-format.git@0653eee0c81ea04715c635dd0885e8096ff6ba6d',
'v8/buildtools/third_party/libc++/trunk': 'https://chromium.googlesource.com/chromium/llvm-project/libcxx.git@f56f1bba1ade4a408d403ff050d50e837bae47df',
'v8/buildtools/third_party/libc++abi/trunk': 'https://chromium.googlesource.com/chromium/llvm-project/libcxxabi.git@05ba3281482304ae8de31123a594972a495da06d',
'v8/buildtools/third_party/libunwind/trunk': 'https://chromium.googlesource.com/external/llvm.org/libunwind.git@fc0a910c25d5415dd72ba9451b7cba380e3cc1e7',
'v8/buildtools/third_party/libc++/trunk': 'https://chromium.googlesource.com/chromium/llvm-project/libcxx.git@27c341db41bc9df5c6f19cde65f002d6f1c2eb3c',
'v8/buildtools/third_party/libc++abi/trunk': 'https://chromium.googlesource.com/chromium/llvm-project/libcxxabi.git@e1601db2504857d44db88a5d4e2ca50b32bbb7d9',
'v8/buildtools/third_party/libunwind/trunk': 'https://chromium.googlesource.com/external/llvm.org/libunwind.git@86ab23972978242b6f9e27cebc239f3e8428b1af',
}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
build
/build/
depot_tools/
.DS_Store
19 changes: 8 additions & 11 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,17 @@ properties([buildDiscarder(logRotator(numToKeepStr: '10', artifactNumToKeepStr:

def build(arch, mode) {
return {
def expectedLibraries = ['base', 'init', 'initializers', 'libbase', 'libplatform', 'libsampler', 'nosnapshot']
def expectedLibraries = ['monolith']

// FIXME Technically we could build on linux as well!
node('osx && git && android-ndk') {
node('osx && git && android-ndk && android-sdk') {
unstash 'sources'
// clean, but be ok with non-zero exit code
sh returnStatus: true, script: "./build_v8.sh -n ${env.ANDROID_NDK_R16B} -c"
sh returnStatus: true, script: "./build_v8.sh -n ${env.ANDROID_NDK_R16B} -s ${env.ANDROID_SDK} -c"
// Now manually clean since that usually fails trying to clean non-existant tags dir
sh 'rm -rf v8/out/' // clean output dir of v8 gyp-build
sh 'rm -rf v8/out.gn/' // clean output dir of v8 ninja/gn-build
sh 'rm -rf v8/xcodebuild/'
sh 'rm -rf build/' // wipe any previously built libraries
// Now build
sh "./build_v8.sh -n ${env.ANDROID_NDK_R16B} -j8 -l ${arch} -m ${mode}"
sh "./build_v8.sh -n ${env.ANDROID_NDK_R16B} -s ${env.ANDROID_SDK} -j8 -l ${arch} -m ${mode}"
// Now run a sanity check to make sure we built the static libraries we expect
// We want to fail the build overall if we didn't
for (int l = 0; l < expectedLibraries.size(); l++) {
Expand All @@ -40,7 +37,7 @@ 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.4-lkgr'
def gitBranch = '6.6-lkgr'
def timestamp = '' // we generate this later
def v8Version = '' // we calculate this later from the v8 repo
def modes = ['release'] // 'debug'
Expand Down Expand Up @@ -88,16 +85,16 @@ timestamps {
// patch v8 and sync dependencies
withEnv(["PATH+DEPOT_TOOLS=${env.WORKSPACE}/depot_tools"]) {
dir('v8') {
sh 'rm -rf out/'
sh 'git apply ../ndk16b_6.5.patch'
sh 'rm -rf out.gn/'
sh 'git apply ../ndk16b_6.6.patch'
sh '../depot_tools/gclient sync --shallow --no-history --reset --force' // needs python
}
}

// stash everything but depot_tools in 'sources'
// FIXME They *really* don't reccomend stashing > 5Mb, and this is several Gbs. How can we fix this?
stash excludes: 'depot_tools/**', name: 'sources'
stash includes: 'v8/include/**', name: 'include'
stash includes: 'v8/include/**/*.h', name: 'include'
} // stage
} // node

Expand Down
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ This is where we store the patches and revision of the v8 repository that we use

To build V8, you'll need:

- Android NDK r11c
- Android NDK r16b

Build V8 for Android against the NDK:

Expand All @@ -21,13 +21,14 @@ The Whole Shebang
=======
```
# Apply our patches to v8
git apply 0001-Fix-cross-compilation-for-Android-from-a-Mac.patch
git apply 0002-Create-standalone-static-libs.patch
cd v8
git apply ndk16b_6.6.patch
cd ..
# Install Android NDK
wget http://dl.google.com/android/repository/android-ndk-r11c-linux-x86_64.zip
unzip android-ndk-r11c-linux-x86_64.zip
export ANDROID_NDK=${PWD}/android-ndk-r11c
wget http://dl.google.com/android/repository/android-ndk-r16b-darwin-x86_64.zip
unzip android-ndk-r16b-darwin-x86_64.zip
export ANDROID_NDK=${PWD}/android-ndk-r16b
# Download s3cmd
wget http://tcpdiag.dl.sourceforge.net/project/s3tools/s3cmd/1.6.0/s3cmd-1.6.0.tar.gz
Expand All @@ -37,9 +38,10 @@ export PATH=${PWD}/s3cmd-1.6.0
# Configure s3cmd
s3cmd --configure
# build v8 for ARM, and then x86
./build_v8.sh -n /path/to/android-ndk-r11c -j16
./build_v8.sh -n /path/to/android-ndk-r11c -j16 -l ia32
# build v8 for ARM, ARM64, and then x86
./build_v8.sh -n /path/to/android-ndk-r16b -j16 -l arm
./build_v8.sh -n /path/to/android-ndk-r16b -j16 -l arm64
./build_v8.sh -n /path/to/android-ndk-r16b -j16 -l ia32
# Generate a tarball to publish
./build_v8.sh -t
Expand All @@ -58,6 +60,7 @@ This script builds v8 against the Android NDK.
Options:
-h Show this help message and exit
-n <ndk_dir> The path to the Android NDK. Alternatively, you may set the ANDROID_NDK environment variable
-s <sdk_dir> The path to the Android SDK. Alternatively, you may set the ANDROID_SDK environment variable
-j <num-cpus> The number of processors to use in building (passed on to scons)
-m <mode> The v8 build mode (release, debug. default: release)
-t Build a thirdparty tarball for uploading
Expand Down
4 changes: 2 additions & 2 deletions build_mac_v8.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ fi
export PATH=`pwd`/depot_tools:"$PATH"
cd v8
git checkout -- . # "clean" the v8 directory
rm -rf out/
git apply ../ndk16b_6.5.patch
rm -rf out.gn/
git apply ../ndk16b_6.56.patch
echo "Asking gclient to update v8 dependencies"
gclient sync --shallow --no-history
cd ..
Expand Down
Loading

0 comments on commit 1ad7c11

Please sign in to comment.