summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2020-09-24 10:15:53 -0700
committerGitHub <noreply@github.com>2020-09-24 10:15:53 -0700
commit7886f784967b60f656fcbcd831fbafb1777e8bcd (patch)
treec04c64716a6e6c0c1dff8bea7603c695886ad13d
parente9e1b2ff00aeb05aaeb57af3811add267dc25323 (diff)
downloadbinaryen-7886f784967b60f656fcbcd831fbafb1777e8bcd.tar.gz
binaryen-7886f784967b60f656fcbcd831fbafb1777e8bcd.tar.bz2
binaryen-7886f784967b60f656fcbcd831fbafb1777e8bcd.zip
Fix emcc lto flags (#3166)
-rw-r--r--CMakeLists.txt15
1 files changed, 4 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 42f234c28..2b6a198c3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -250,15 +250,8 @@ if(EMSCRIPTEN)
add_link_flag("-s DISABLE_EXCEPTION_CATCHING=0")
# make the tools immediately usable on Node.js
add_link_flag("-s NODERAWFS")
- # this can be moved into the fastcomp section once upstream ignores this flag,
- # https://github.com/emscripten-core/emscripten/pull/9897
- add_compile_flag("-Wno-almost-asm")
- # check for fastcomp by the clang version, which is stuck in fastcomp way
- # back in the past
- if(NOT ${CMAKE_CXX_COMPILER_VERSION} STREQUAL "6.0.1")
- # in opt builds, LTO helps so much (>20%) it's worth slow compile times
- add_nondebug_compile_flag("-s WASM_OBJECT_FILES=0")
- endif()
+ # in opt builds, LTO helps so much (>20%) it's worth slow compile times
+ add_nondebug_compile_flag("-flto")
endif()
# clang doesn't print colored diagnostics when invoked from Ninja
@@ -364,7 +357,7 @@ if(EMSCRIPTEN)
target_link_libraries(binaryen_wasm "--extern-post-js ${CMAKE_CURRENT_SOURCE_DIR}/src/js/binaryen.js-extern-post.js")
target_link_libraries(binaryen_wasm optimized "--closure 0")
target_link_libraries(binaryen_wasm optimized "--closure-args \"--language_in=ECMASCRIPT6 --language_out=ECMASCRIPT6\"")
- target_link_libraries(binaryen_wasm optimized "--llvm-lto 1")
+ target_link_libraries(binaryen_wasm optimized "-flto")
# TODO: put profiling only on debug, and restore closure. in binaryen_js too.
target_link_libraries(binaryen_wasm "--profiling")
set_property(TARGET binaryen_wasm PROPERTY CXX_STANDARD ${CXX_STANDARD})
@@ -389,7 +382,7 @@ if(EMSCRIPTEN)
target_link_libraries(binaryen_js "--extern-post-js ${CMAKE_CURRENT_SOURCE_DIR}/src/js/binaryen.js-extern-post.js")
target_link_libraries(binaryen_js optimized "--closure 0")
target_link_libraries(binaryen_js optimized "--closure-args \"--language_in=ECMASCRIPT6 --language_out=ECMASCRIPT6\"")
- target_link_libraries(binaryen_js optimized "--llvm-lto 1")
+ target_link_libraries(binaryen_js optimized "-flto")
target_link_libraries(binaryen_js "--profiling")
target_link_libraries(binaryen_js debug "-s ASSERTIONS")
set_property(TARGET binaryen_js PROPERTY CXX_STANDARD ${CXX_STANDARD})