Skip to content

Remove asmjs validation #11551

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmake/Modules/Platform/Emscripten.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ set(CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL "-Os" CACHE STRING "Emscripten-overridd
set(CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO "-O2 -g" CACHE STRING "Emscripten-overridden CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO")

function(em_validate_asmjs_after_build target)
add_custom_command(TARGET ${target} POST_BUILD COMMAND ${CMAKE_COMMAND} -E echo Validating build output for asm.js... COMMAND "python" ARGS "${EMSCRIPTEN_ROOT_PATH}/tools/validate_asmjs.py" "$<TARGET_FILE:${target}>")
message(WARNING "em_validate_asmjs_after_build no longer exists")
endfunction()

# A global counter to guarantee unique names for js library files.
Expand Down
5 changes: 0 additions & 5 deletions tests/cmake/target_html/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,3 @@ endif()
add_executable(hello_world_gles ${sourceFiles})
target_link_libraries(hello_world_gles cpp_lib)
set_target_properties(hello_world_gles PROPERTIES LINK_FLAGS "${linkFlags}")

# Validating asm.js requires SpiderMonkey JS VM - detect its presence via the SPIDERMONKEY environment variable.
if (DEFINED ENV{SPIDERMONKEY} AND CMAKE_BUILD_TYPE STREQUAL Release)
em_validate_asmjs_after_build(hello_world_gles)
endif()
12 changes: 0 additions & 12 deletions tests/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -747,16 +747,6 @@ def build(self, src, dirname, filename, main_file=None,
# side memory init file, or an empty one in the js
assert ('/* memory initializer */' not in src) or ('/* memory initializer */ allocate([]' in src)

def validate_asmjs(self, err):
# check for asm.js validation
if 'uccessfully compiled asm.js code' in err and 'asm.js link error' not in err:
print("[was asm.js'ified]", file=sys.stderr)
# check for an asm.js validation error, if we expect one
elif 'asm.js' in err and not self.is_wasm() and self.get_setting('ASM_JS') == 1:
self.fail("did NOT asm.js'ify: " + err)
err = '\n'.join([line for line in err.split('\n') if 'uccessfully compiled asm.js code' not in line])
return err

def get_func(self, src, name):
start = src.index('function ' + name + '(')
t = start
Expand Down Expand Up @@ -825,8 +815,6 @@ def run_js(self, filename, engine=None, args=[], output_nicerizer=None, assert_r

out = open(stdout, 'r').read()
err = open(stderr, 'r').read()
if engine == SPIDERMONKEY_ENGINE and self.get_setting('ASM_JS') == 1:
err = self.validate_asmjs(err)
if output_nicerizer:
ret = output_nicerizer(out, err)
else:
Expand Down
9 changes: 0 additions & 9 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2907,11 +2907,6 @@ def test_dlfcn_qsort(self):
self.do_run(src, 'Sort with main comparison: 5 4 3 2 1 *Sort with lib comparison: 1 2 3 4 5 *',
output_nicerizer=lambda x, err: x.replace('\n', '*'))

if self.get_setting('ASM_JS') and SPIDERMONKEY_ENGINE and os.path.exists(SPIDERMONKEY_ENGINE[0]) and not self.is_wasm():
out = self.run_js('liblib.so', engine=SPIDERMONKEY_ENGINE)
if 'asm' in out:
self.validate_asmjs(out)

@needs_dlfcn
def test_dlfcn_data_and_fptr(self):
# Failing under v8 since: https://chromium-review.googlesource.com/712595
Expand Down Expand Up @@ -3701,10 +3696,6 @@ def dylink_test(self, main, side, expected=None, header=None, main_emcc_args=[],
self.build(side, self.get_dir(), base, js_outfile=(side_suffix == 'js'))
if force_c:
shutil.move(base + '.o.' + side_suffix, 'liblib.cpp.o.' + side_suffix)
if SPIDERMONKEY_ENGINE and os.path.exists(SPIDERMONKEY_ENGINE[0]) and not self.is_wasm():
out = self.run_js('liblib.cpp.o.js', engine=SPIDERMONKEY_ENGINE)
if 'asm' in out:
self.validate_asmjs(out)
shutil.move('liblib.cpp.o.' + side_suffix, 'liblib.so')

# main settings
Expand Down
4 changes: 1 addition & 3 deletions tests/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from tools.shared import try_delete
from tools.shared import EMCC, EMXX, EMAR, EMRANLIB, PYTHON, FILE_PACKAGER, WINDOWS, LLVM_ROOT, EM_BUILD_VERBOSE
from tools.shared import CLANG_CC, CLANG_CXX, LLVM_AR, LLVM_DWARFDUMP
from tools.shared import NODE_JS, SPIDERMONKEY_ENGINE, JS_ENGINES, WASM_ENGINES, V8_ENGINE
from tools.shared import NODE_JS, JS_ENGINES, WASM_ENGINES, V8_ENGINE
from runner import RunnerCore, path_from_root, no_wasm_backend, no_fastcomp, is_slow_test, ensure_dir
from runner import needs_dlfcn, env_modify, no_windows, requires_native_clang, chdir, with_env_modify, create_test_file, parameterized
from runner import js_engines_modify, NON_ZERO
Expand Down Expand Up @@ -535,8 +535,6 @@ def test_emcc_asm_v_wasm(self):
print(' engine', engine)
out = self.run_js('a.out.js', engine=engine)
self.assertContained('hello, world!', out)
if not wasm and engine == SPIDERMONKEY_ENGINE:
self.validate_asmjs(out)
if not wasm and not self.is_wasm_backend():
src = open('a.out.js').read()
if opts == []:
Expand Down
103 changes: 0 additions & 103 deletions tools/validate_asmjs.py

This file was deleted.