From 32356d28ac996a38efd2adb523ba47921a131af7 Mon Sep 17 00:00:00 2001 From: Kudo Chien Date: Mon, 10 Feb 2020 16:47:55 +0800 Subject: [PATCH] Upgrade V8 to V8.0.426.16 (#11) * Upgrade v8 to v8 * Try to fix Android build break Summary: 1. Fix libatomic.so.1 not found issue. mksnapshot for arm is based on i386 libatomic.so.1 We should add libatomic1-i386-cross for Ubuntu 64. Since the installed files is at /usr/i686-linux-gnu/lib that is not default location, we should add the location explicitly. 2. install-build-deps-android.sh will not install jdk now, install explicitly. * Fix iOS build break Summary: 1. Suppress deprecated-copy and final-dtor-non-final-class errors which Xcode clang will complain. 2. Disable pointer compression that will cause build break for arm64. --- .circleci/config.yml | 12 ++++++++---- package.json | 4 ++-- patches/v8_shared_library.patch | 2 +- patches/v8_shared_library_ios.patch | 19 ++++++++++++++++--- scripts/build.sh | 3 +-- 5 files changed, 28 insertions(+), 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2a65e74..d59b717 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,7 +17,7 @@ jobs: sudo ln -fs /usr/share/zoneinfo/UTC /etc/localtime sudo apt-get update sudo apt-get upgrade -y - sudo apt-get install -y apt-utils sudo lsb-core git python nodejs npm wget + sudo apt-get install -y apt-utils sudo lsb-core git python nodejs npm wget openjdk-8-jre openjdk-8-jdk - checkout @@ -30,6 +30,7 @@ jobs: name: Setup V8 build environment command: | scripts/setup.sh -r ${V8_VERSION} android + sudo apt-get install -y libatomic1-i386-cross && sudo sh -c 'echo "/usr/i686-linux-gnu/lib" >> /etc/ld.so.conf.d/i386-linux-gnu.conf' && sudo ldconfig - run: name: Patch V8 @@ -66,7 +67,7 @@ jobs: sudo ln -fs /usr/share/zoneinfo/UTC /etc/localtime sudo apt-get update sudo apt-get upgrade -y - sudo apt-get install -y apt-utils sudo lsb-core git python nodejs npm wget + sudo apt-get install -y apt-utils sudo lsb-core git python nodejs npm wget openjdk-8-jre openjdk-8-jdk - checkout @@ -79,6 +80,7 @@ jobs: name: Setup V8 build environment command: | scripts/setup.sh -r ${V8_VERSION} android + sudo apt-get install -y libatomic1-i386-cross && sudo sh -c 'echo "/usr/i686-linux-gnu/lib" >> /etc/ld.so.conf.d/i386-linux-gnu.conf' && sudo ldconfig - run: name: Patch V8 @@ -115,7 +117,7 @@ jobs: sudo ln -fs /usr/share/zoneinfo/UTC /etc/localtime sudo apt-get update sudo apt-get upgrade -y - sudo apt-get install -y apt-utils sudo lsb-core git python nodejs npm wget + sudo apt-get install -y apt-utils sudo lsb-core git python nodejs npm wget openjdk-8-jre openjdk-8-jdk - checkout @@ -128,6 +130,7 @@ jobs: name: Setup V8 build environment command: | scripts/setup.sh -r ${V8_VERSION} android + sudo apt-get install -y libatomic1-i386-cross && sudo sh -c 'echo "/usr/i686-linux-gnu/lib" >> /etc/ld.so.conf.d/i386-linux-gnu.conf' && sudo ldconfig - run: name: Patch V8 @@ -164,7 +167,7 @@ jobs: sudo ln -fs /usr/share/zoneinfo/UTC /etc/localtime sudo apt-get update sudo apt-get upgrade -y - sudo apt-get install -y apt-utils sudo lsb-core git python nodejs npm wget + sudo apt-get install -y apt-utils sudo lsb-core git python nodejs npm wget openjdk-8-jre openjdk-8-jdk - checkout @@ -177,6 +180,7 @@ jobs: name: Setup V8 build environment command: | scripts/setup.sh -r ${V8_VERSION} android + sudo apt-get install -y libatomic1-i386-cross && sudo sh -c 'echo "/usr/i686-linux-gnu/lib" >> /etc/ld.so.conf.d/i386-linux-gnu.conf' && sudo ldconfig - run: name: Patch V8 diff --git a/package.json b/package.json index ec900ed..fa371e8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "private": true, - "version": "7.8.2", + "version": "8.80.0", "workspaces": [ "packages/*" ], @@ -15,6 +15,6 @@ "start_ios": "bash -c '. ./scripts/export_npm_env.sh && ./scripts/start.sh ios'" }, "config": { - "V8": "7.8.279.23" + "V8": "8.0.426.16" } } diff --git a/patches/v8_shared_library.patch b/patches/v8_shared_library.patch index c5d758f..a196400 100644 --- a/patches/v8_shared_library.patch +++ b/patches/v8_shared_library.patch @@ -70,7 +70,7 @@ index c486f1a..6aeb762 100644 + ":v8", + ":v8_libbase", + ":v8_libplatform", -+ ":v8_maybe_snapshot", ++ ":v8_snapshot", + ] + + configs = [ ":internal_config" ] diff --git a/patches/v8_shared_library_ios.patch b/patches/v8_shared_library_ios.patch index 0848258..de17f01 100644 --- a/patches/v8_shared_library_ios.patch +++ b/patches/v8_shared_library_ios.patch @@ -70,7 +70,7 @@ index c486f1a..6aeb762 100644 + ":v8", + ":v8_libbase", + ":v8_libplatform", -+ ":v8_maybe_snapshot", ++ ":v8_snapshot", + ] + + configs = [ ":internal_config" ] @@ -97,10 +97,10 @@ index e55c4cf..a97111b 100644 + } +} diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn -index 66c2c43a6..bc01c3e14 100644 +index cba0602f8..1e4ae504f 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn -@@ -1493,6 +1493,13 @@ config("default_warnings") { +@@ -1513,6 +1513,13 @@ config("default_warnings") { cflags += [ "-Wno-nonportable-include-path" ] } @@ -114,3 +114,16 @@ index 66c2c43a6..bc01c3e14 100644 if (current_toolchain == host_toolchain || !use_xcode_clang) { # Flags NaCl (Clang 3.7) and Xcode 9.2 (Clang clang-900.0.39.2) do not # recognize. +@@ -1557,6 +1564,12 @@ config("default_warnings") { + } + } + } ++ if (use_xcode_clang) { ++ cflags_cc += [ ++ "-Wno-deprecated-copy", ++ "-Wno-final-dtor-non-final-class", ++ ] ++ } + } + + # chromium_code --------------------------------------------------------------- diff --git a/scripts/build.sh b/scripts/build.sh index 3c84cfb..49f67bb 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -8,13 +8,12 @@ GN_ARGS_BASE=" is_component_build=false use_debug_fission=false use_custom_libcxx=false - v8_use_snapshot=true v8_use_external_startup_data=false icu_use_data_file=false " if [[ ${PLATFORM} = "ios" ]]; then - GN_ARGS_BASE="${GN_ARGS_BASE} enable_ios_bitcode=false use_xcode_clang=true ios_enable_code_signing=false ios_deployment_target=${IOS_DEPLOYMENT_TARGET}" + GN_ARGS_BASE="${GN_ARGS_BASE} enable_ios_bitcode=false use_xcode_clang=true ios_enable_code_signing=false v8_enable_pointer_compression=false ios_deployment_target=${IOS_DEPLOYMENT_TARGET}" fi if [[ ${NO_INTL} = "1" ]]; then