Commit cac6380f authored by Andrew Grieve's avatar Andrew Grieve Committed by Commit Bot

Revert "SuperSize: Update to newer emscripten version"

This reverts commit be818705.

Reason for revert: Patch was corrupt.

Original change's description:
> SuperSize: Update to newer emscripten version
> 
> * Fixes an issue with an unrecognized compiler flag.
> * Could not get -flto to work and no good error message from the
>   failure. Left a TODO to re-enable it.
> 
> Bug: None
> Change-Id: I683119e43e767ff5b228706bc6b6f68c2282f7a7
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2418993
> Reviewed-by: Samuel Huang <huangs@chromium.org>
> Commit-Queue: Andrew Grieve <agrieve@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#808898}

TBR=huangs@chromium.org,agrieve@chromium.org

Change-Id: I8cf548eb57ed34b4fd9722ba2843f645c36c3b46
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: None
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2421871Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#808944}
parent 01d4e133
......@@ -73,12 +73,16 @@ if (is_wasm) {
configs += [ "//build/config/compiler:optimize_speed" ]
}
ldflags = [
"-s",
"TOTAL_MEMORY=536870912",
"-s",
"ALLOW_MEMORY_GROWTH=1",
"-s",
"EXPORTED_FUNCTIONS=['_LoadSizeFile','_LoadBeforeSizeFile','_BuildTree','_Open','_QueryProperty','_malloc','_free']",
"-s",
"EXTRA_EXPORTED_RUNTIME_METHODS=['ccall','cwrap','UTF8ToString']",
]
if (is_official_build) {
if (!is_debug) {
ldflags += [ "-O3" ]
}
}
......
......@@ -9,11 +9,6 @@ Caspian is the name for the WebAssembly portion of the SuperSize Tiger Viewer.
Install emscripten from:
https://emscripten.org/docs/getting_started/downloads.html
```sh
# Known working version:
./emsdk install 2.0.3 && ./emsdk activate 2.0.3 && source ./emsdk_env.sh
```
```sh
git apply -3 tools/binary_size/libsupersize/caspian/wasmbuild.patch
gn gen out/caspian --args='is_official_build=true treat_warnings_as_errors=false fatal_linker_warnings=false'
......
diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn
index bb656fa19ff3..7fbf650f7b0e 100644
index e011502180b5..9e55fcd6c74f 100644
--- a/build/config/BUILDCONFIG.gn
+++ b/build/config/BUILDCONFIG.gn
@@ -291,10 +291,11 @@ is_ios = current_os == "ios"
......@@ -16,32 +16,31 @@ index bb656fa19ff3..7fbf650f7b0e 100644
# =============================================================================
# SOURCES FILTERS
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index c9ef45a1495e..f4361a234db7 100644
index 0b5de5cd7173..ff761c9b46b3 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -603,6 +603,21 @@ config("compiler") {
@@ -581,6 +581,19 @@ config("compiler") {
ldflags += [ "-stdlib=libc++" ]
}
+ if (is_wasm) {
+ _emscripten_flags = [
+ if (is_wasm && is_official_build) {
+ cflags_c += [
+ "-s",
+ "ALLOW_MEMORY_GROWTH=1",
+ "WASM_OBJECT_FILES=0",
+ ]
+ ldflags += [
+ "-s",
+ "WASM_OBJECT_FILES=0",
+ "--llvm-lto",
+ "1",
+ ]
+
+ # TODO(agrieve): Figure out why this causes link to fail.
+ #if (is_official_build) {
+ # _emscripten_flags += ["-flto=full"]
+ #}
+ cflags += _emscripten_flags
+ ldflags += _emscripten_flags
+ }
+
# Add flags for link-time optimization. These flags enable
# 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
@@ -726,7 +741,7 @@ config("compiler") {
if (use_lld && !enable_call_graph_profile_sort) {
@@ -704,7 +717,7 @@ config("compiler") {
if (use_lld) {
if (is_win) {
ldflags += [ "/call-graph-profile-sort:no" ]
- } else {
......@@ -49,7 +48,7 @@ index c9ef45a1495e..f4361a234db7 100644
ldflags += [ "-Wl,--no-call-graph-profile-sort" ]
}
}
@@ -1532,7 +1547,8 @@ config("default_warnings") {
@@ -1510,7 +1523,8 @@ config("default_warnings") {
cflags += [ "-Wno-nonportable-include-path" ]
}
......@@ -59,7 +58,7 @@ index c9ef45a1495e..f4361a234db7 100644
# Flags NaCl (Clang 3.7) and Xcode 9.2 (Clang clang-900.0.39.2) do not
# recognize.
cflags += [
@@ -2294,6 +2310,9 @@ config("symbols") {
@@ -2275,6 +2289,9 @@ config("symbols") {
"-debug-info-kind=constructor",
]
}
......@@ -85,10 +84,10 @@ index d556b0e0927e..f4597ab04037 100644
}
diff --git a/build/toolchain/wasm/BUILD.gn b/build/toolchain/wasm/BUILD.gn
new file mode 100644
index 000000000000..fdc5120981de
index 000000000000..15bc7a4ea258
--- /dev/null
+++ b/build/toolchain/wasm/BUILD.gn
@@ -0,0 +1,30 @@
@@ -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.
......@@ -113,6 +112,7 @@ index 000000000000..fdc5120981de
+ 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",
......
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