Commit 99744bb8 authored by Samuel Huang's avatar Samuel Huang Committed by Commit Bot

[SuperSize] Update wasmbuild.patch for Caspian.

The instructions to build caspian_web is failing due to wasmbuild.patch
apply failure. This CL updates updates the patch to get things working
again.

Bug: 1040645
Change-Id: I2e204e622a29309915ca1086a89d42e9c146132a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2272615
Commit-Queue: Samuel Huang <huangs@chromium.org>
Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#784825}
parent 7c3f2315
diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn
index f89e7e831b79..ebfb4ba88b35 100644 index 4cc6bfc45e64..02fb53d01d0a 100644
--- a/build/config/BUILDCONFIG.gn --- a/build/config/BUILDCONFIG.gn
+++ b/build/config/BUILDCONFIG.gn +++ b/build/config/BUILDCONFIG.gn
@@ -291,9 +291,10 @@ is_ios = current_os == "ios" @@ -291,9 +291,10 @@ is_ios = current_os == "ios"
...@@ -15,10 +15,10 @@ index f89e7e831b79..ebfb4ba88b35 100644 ...@@ -15,10 +15,10 @@ index f89e7e831b79..ebfb4ba88b35 100644
# ============================================================================= # =============================================================================
# SOURCES FILTERS # SOURCES FILTERS
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index 912906e15e76..e00bf81e6b20 100644 index d483562f6b0b..6b00d5d2ab2b 100644
--- a/build/config/compiler/BUILD.gn --- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn
@@ -564,6 +564,19 @@ config("compiler") { @@ -575,6 +575,19 @@ config("compiler") {
ldflags += [ "-stdlib=libc++" ] ldflags += [ "-stdlib=libc++" ]
} }
...@@ -38,7 +38,7 @@ index 912906e15e76..e00bf81e6b20 100644 ...@@ -38,7 +38,7 @@ index 912906e15e76..e00bf81e6b20 100644
# Add flags for link-time optimization. These flags enable # Add flags for link-time optimization. These flags enable
# optimizations/transformations that require whole-program visibility at link # optimizations/transformations that require whole-program visibility at link
# time, so they need to be applied to all translation units, and we may end up # time, so they need to be applied to all translation units, and we may end up
@@ -1507,7 +1520,8 @@ config("default_warnings") { @@ -1492,7 +1505,8 @@ config("default_warnings") {
cflags += [ "-Wno-nonportable-include-path" ] cflags += [ "-Wno-nonportable-include-path" ]
} }
...@@ -48,9 +48,9 @@ index 912906e15e76..e00bf81e6b20 100644 ...@@ -48,9 +48,9 @@ index 912906e15e76..e00bf81e6b20 100644
# Flags NaCl (Clang 3.7) and Xcode 9.2 (Clang clang-900.0.39.2) do not # Flags NaCl (Clang 3.7) and Xcode 9.2 (Clang clang-900.0.39.2) do not
# recognize. # recognize.
cflags += [ cflags += [
@@ -2303,6 +2317,9 @@ config("symbols") { @@ -2248,6 +2262,9 @@ config("symbols") {
cflags += [ "-fno-standalone-debug" ] "-debug-info-kind=constructor",
} ]
} }
+ } else if (is_wasm) { + } else if (is_wasm) {
+ cflags = [ "-g4" ] + cflags = [ "-g4" ]
...@@ -59,10 +59,10 @@ index 912906e15e76..e00bf81e6b20 100644 ...@@ -59,10 +59,10 @@ index 912906e15e76..e00bf81e6b20 100644
cflags = [] cflags = []
if (is_mac && enable_dsyms) { if (is_mac && enable_dsyms) {
diff --git a/build/toolchain/toolchain.gni b/build/toolchain/toolchain.gni diff --git a/build/toolchain/toolchain.gni b/build/toolchain/toolchain.gni
index 2b6f05231c63..134e9ee77107 100644 index 80c2e7b5e4a2..1976fab7b86e 100644
--- a/build/toolchain/toolchain.gni --- a/build/toolchain/toolchain.gni
+++ b/build/toolchain/toolchain.gni +++ b/build/toolchain/toolchain.gni
@@ -58,6 +58,9 @@ if (is_mac || is_ios) { @@ -59,6 +59,9 @@ if (is_mac || is_ios) {
shlib_extension = ".so" shlib_extension = ".so"
} else if (is_win) { } else if (is_win) {
shlib_extension = ".dll" shlib_extension = ".dll"
...@@ -72,98 +72,40 @@ index 2b6f05231c63..134e9ee77107 100644 ...@@ -72,98 +72,40 @@ index 2b6f05231c63..134e9ee77107 100644
} else { } else {
assert(false, "Platform not supported") assert(false, "Platform not supported")
} }
diff --git a/tools/binary_size/libsupersize/caspian/wasmbuild.patch b/tools/binary_size/libsupersize/caspian/wasmbuild.patch diff --git a/build/toolchain/wasm/BUILD.gn b/build/toolchain/wasm/BUILD.gn
index 065bb27f795a..e69de29bb2d1 100644 new file mode 100644
--- a/tools/binary_size/libsupersize/caspian/wasmbuild.patch index 000000000000..15bc7a4ea258
+++ b/tools/binary_size/libsupersize/caspian/wasmbuild.patch --- /dev/null
@@ -1,90 +0,0 @@ +++ b/build/toolchain/wasm/BUILD.gn
-diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn @@ -0,0 +1,31 @@
-index f89e7e831b79..ebfb4ba88b35 100644 +# Copyright 2019 The Chromium Authors. All rights reserved.
---- a/build/config/BUILDCONFIG.gn +# Use of this source code is governed by a BSD-style license that can be
-+++ b/build/config/BUILDCONFIG.gn +# found in the LICENSE file.
-@@ -291,9 +291,10 @@ is_ios = current_os == "ios" +
- is_linux = current_os == "chromeos" || current_os == "linux" +import("//build/toolchain/gcc_toolchain.gni")
- is_mac = current_os == "mac" +
- is_nacl = current_os == "nacl" +gcc_toolchain("wasm") {
-+is_wasm = current_os == "wasm" + cc = "emcc"
- is_win = current_os == "win" || current_os == "winuwp" + cxx = "em++"
- + nm = "emcc"
--is_posix = !is_win && !is_fuchsia + ar = "emar"
-+is_posix = !is_win && !is_fuchsia && !is_wasm + ld = cxx
- +
- # ============================================================================= + toolchain_args = {
- # SOURCES FILTERS + current_cpu = "wasm"
-diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn + current_os = "wasm"
-index 0f91977e1352..acd5ab11f111 100644 +
---- a/build/config/compiler/BUILD.gn + is_clang = true
-+++ b/build/config/compiler/BUILD.gn + use_goma = false
-@@ -1508,7 +1508,7 @@ config("default_warnings") { + use_debug_fission = false
- cflags += [ "-Wno-nonportable-include-path" ] + clang_use_chrome_plugins = false
- } + use_allocator_shim = false
- + is_component_build = false
-- if (current_toolchain == host_toolchain || !use_xcode_clang) { + }
-+ if ((current_toolchain == host_toolchain || !use_xcode_clang) && !is_wasm) { + extra_ldflags = "-s BINARYEN_METHOD='native-wasm'"
- # Flags NaCl (Clang 3.7) and Xcode 9.2 (Clang clang-900.0.39.2) do not + executable_extension = ".js"
- # recognize. + link_outputs = [
- cflags += [ + "{{output_dir}}/{{target_output_name}}.wasm",
-@@ -2296,6 +2296,9 @@ config("symbols") { + "{{output_dir}}/{{target_output_name}}.wasm.map",
- cflags += [ "-fno-standalone-debug" ] + ]
- } +}
- }
-+ } else if (is_wasm) {
-+ cflags = [ "-g4" ]
-+ ldflags = [ "-g4" ]
- } else {
- cflags = []
- if (is_mac && enable_dsyms) {
-diff --git a/build/toolchain/toolchain.gni b/build/toolchain/toolchain.gni
-index 3edc9762907d..ab483e44a11c 100644
---- a/build/toolchain/toolchain.gni
-+++ b/build/toolchain/toolchain.gni
-@@ -58,6 +58,9 @@ if (is_mac || is_ios) {
- shlib_extension = ".so"
- } else if (is_win) {
- shlib_extension = ".dll"
-+} else if (is_wasm) {
-+ # WebAssembly does not stably support shared libraries. (as of Oct 2019)
-+ shlib_extension = ".wasm"
- } else {
- assert(false, "Platform not supported")
- }
-diff --git a/build/toolchain/wasm/BUILD.gn b/build/toolchain/wasm/BUILD.gn
-new file mode 100644
-index 000000000000..15bc7a4ea258
---- /dev/null
-+++ b/build/toolchain/wasm/BUILD.gn
-@@ -0,0 +1,31 @@
-+# Copyright 2019 The Chromium Authors. All rights reserved.
-+# Use of this source code is governed by a BSD-style license that can be
-+# found in the LICENSE file.
-+
-+import("//build/toolchain/gcc_toolchain.gni")
-+
-+gcc_toolchain("wasm") {
-+ cc = "emcc"
-+ cxx = "em++"
-+ nm = "emcc"
-+ ar = "emar"
-+ ld = cxx
-+
-+ toolchain_args = {
-+ current_cpu = "wasm"
-+ current_os = "wasm"
-+
-+ is_clang = true
-+ use_goma = false
-+ use_debug_fission = false
-+ clang_use_chrome_plugins = false
-+ use_allocator_shim = false
-+ is_component_build = false
-+ }
-+ extra_ldflags = "-s BINARYEN_METHOD='native-wasm'"
-+ executable_extension = ".js"
-+ link_outputs = [
-+ "{{output_dir}}/{{target_output_name}}.wasm",
-+ "{{output_dir}}/{{target_output_name}}.wasm.map",
-+ ]
-+}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment