latest-upstream & asm.js

63 views
Skip to first unread message

Александр Гурьянов

unread,
Jul 7, 2019, 11:56:58 PM7/7/19
to emscripte...@googlegroups.com
Hi is it possible to generate asm.js with latest-upstream backend. I
tried with couple projects and always have same error:

emcc:WARNING: emcc: JS support in the upstream LLVM+wasm2js path is
very experimental currently (best to use fastcomp for asm.js for now)
wasm2js: warning: global scope may be colliding with other scope:
Vector__operator__28Vector_20const__29_20const
wasm2js: warning: global scope may be colliding with other scope:
operator__28b2Vec2_20const__2c_20b2Vec2_20const__29
wasm2js: warning: global scope may be colliding with other scope:
b2Vec2__operator___28b2Vec2_20const__29
wasm2js: warning: global scope may be colliding with other scope:
Vector__operator__28Vector_20const__29_20const
wasm2js: warning: global scope may be colliding with other scope:
Vector__operator__28Vector_20const__29_20const_1
wasm2js: warning: global scope may be colliding with other scope:
Vector__operator___28Vector_20const__29_20const
wasm2js: warning: global scope may be colliding with other scope:
RGBAColor__operator__28RGBAColor_20const__29_20const
wasm2js: warning: global scope may be colliding with other scope:
google__protobuf__operator___28google__protobuf__Map_int_2c_20BBProtocol__ServerMessage___const_iterator_20const__2c_20google__protobuf__Map_int_2c_20BBProtocol__ServerMessage___const_iterator_20const__29
wasm2js: warning: global scope may be colliding with other scope:
bool_20gamepix__TimeMs__operator__long__28long_20const__29_20const
wasm2js: warning: global scope may be colliding with other scope:
Skins__Item__operator___28Skins__Item_20const__29_20const
wasm2js: warning: global scope may be colliding with other scope:
RGBAColor__operator__28RGBAColor_20const__29_20const
wasm2js: warning: global scope may be colliding with other scope:
RGBAColor__operator__28RGBAColor_20const__29_20const_1
wasm2js: warning: global scope may be colliding with other scope:
operator__28b2Vec3_20const__2c_20b2Vec3_20const__29
wasm2js: warning: global scope may be colliding with other scope:
ZF__Touch__operator___28ZF__Touch_20const__29
Failed opening 'bin.wasm'
Traceback (most recent call last):
File "/home/caiiiycuk/emscripten/sdk/emsdk/upstream/emscripten/emcc.py",
line 3440, in <module>
sys.exit(run(sys.argv))
File "/home/caiiiycuk/emscripten/sdk/emsdk/upstream/emscripten/emcc.py",
line 2315, in run
optimizer)
File "/home/caiiiycuk/emscripten/sdk/emsdk/upstream/emscripten/emcc.py",
line 2885, in do_binaryen
shared.Building.emit_wasm_symbol_map(wasm_file=wasm_binary_target,
symbols_file=target + '.symbols', debug_info=debug_info)
File "/home/caiiiycuk/emscripten/sdk/emsdk/upstream/emscripten/tools/shared.py",
line 2717, in emit_wasm_symbol_map
output = run_process(cmd, stdout=PIPE).stdout
File "/home/caiiiycuk/emscripten/sdk/emsdk/upstream/emscripten/tools/shared.py",
line 181, in run_process
result.check_returncode()
File "/home/caiiiycuk/emscripten/sdk/emsdk/upstream/emscripten/tools/shared.py",
line 161, in check_returncode
raise Py2CalledProcessError(returncode=self.returncode,
cmd=self.args, output=self.stdout, stderr=self.stderr)
tools.shared.Py2CalledProcessError: Command
'['/home/caiiiycuk/emscripten/sdk/emsdk/upstream/bin/wasm-opt',
'--print-function-map', 'bin.wasm', '-o', 'bin.wasm']' returned
non-zero exit status 1
ninja: build stopped: subcommand failed.


For all projects that I tried, I have this message:
Failed opening 'bin.wasm', I asking to compile bin.js, so look like
wasm didn't emitted.

EMCC_DEBUG log is attached
debug.log

Alon Zakai

unread,
Jul 8, 2019, 12:48:51 PM7/8/19
to emscripte...@googlegroups.com
Both those warnings and that error don't look familiar - do you have a testcase I can debug?

- Alon


--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/CAKOm%3DVGu-VyX5SBVo2eEiS6EOwPPQLDbH4BU7-MEz%3DNjsDMLMw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Александр Гурьянов

unread,
Jul 8, 2019, 10:50:24 PM7/8/19
to emscripte...@googlegroups.com
Yes, I have one.

Build sequence:
```
mkdir emscripten
cd emscripten
emcmake cmake -GNinja ..

ninja -j4 wbin
[2/2] Linking CXX executable wbin.js
/*SUCCESS*/

ninja -j4 bin
[2/2] Linking CXX executable bin.js
FAILED: bin.js
: && /home/caiiiycuk/emscripten/sdk/emsdk/upstream/emscripten/em++
-Oz -w -Werror=return-type -s USE_SDL=1 --std=c++11 -s STB_IMAGE=1
-Oz --emit-symbol-map -s ASSERTIONS=0 -s
SAFE_HEAP=0 -s TOTAL_MEMORY=134217728 -s
WASM_MEM_MAX=134217728 -s INVOKE_RUN=0 -s
EXTRA_EXPORTED_RUNTIME_METHODS="['getMemory', 'addRunDependency',
'removeRunDependency', 'FS_createPath', 'FS_createPreloadedFile',
'FS_createDataFile', 'lengthBytesUTF8', 'stringToUTF8',
'UTF16ToString']" -s NO_EXIT_RUNTIME=1 -s
ERROR_ON_UNDEFINED_SYMBOLS=0 -s WASM=0
CMakeFiles/bin-obj.dir/main.cpp.o -o bin.js && :
emcc:WARNING: emcc: JS support in the upstream LLVM+wasm2js path is
very experimental currently (best to use fastcomp for asm.js for now)
```

P. S. This project is very bad written I just used it for testing.

пн, 8 июл. 2019 г. в 23:48, Alon Zakai <alon...@gmail.com>:
> To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/CAEX4NpRJHuJ%2BEepuyxcmFDB-Nd%2BzdqO5JJACRBv%3DFHivcQrmLA%40mail.gmail.com.
upstream-js.zip

Alon Zakai

unread,
Jul 10, 2019, 6:12:30 PM7/10/19
to emscripte...@googlegroups.com
Thanks caiiiycuk! I see now, this is because wasm2js doesn't support the --emit-symbol-map option. I opened these PRs to fix that:


Reply all
Reply to author
Forward
0 new messages