Closed rickomax closed 5 years ago
I don't see a false
value there - it's just mentioned in the validator message in the sense of "assertion failed, this was false but should not have been false"? Unless I'm missing something.
Seems like the called function, __ZNKSt3__28ios_base6getlocEv
, has a single parameter, a this
pointer, in the LLVM IR, asm.js, and wasm. So that all looks consistent. How is that function declared in all of those?
One possibility is that this is a bug that was fixed since 1.37.33, which is quite old at this point (Feb 2, almost a year). We did have some bugs in that area in the past.
On asm.js (EMSDK 1.37.33):
function __ZNKSt3__28ios_base6getlocEv($0,$1) {
$0 = $0|0;
$1 = $1|0;
var $2 = 0, label = 0, sp = 0;
sp = STACKTOP;
$2 = ((($1)) + 28|0);
__ZNSt3__26localeC2ERKS0_($0,$2);
return;
}
Seems one parameter is being omitted.
I cannot find the "getLoc" method declaration on the LLVM bitcode (libassimp.bc disasm). The only places referencing it which aren't method calls on the LLVM bitcode I found are:
!558578 = distinct !DISubprogram(name: "getloc", linkageName: "_ZNKSt3__215basic_streambufIcNS_11char_traitsIcEEE6getlocEv", scope: !16241, file: !16242, line: 144, type: !558579, isLocal: false, isDefinition: true, scopeLine: 144, flags: DIFlagPrototyped, isOptimized: true, unit: !354313, declaration: !558581, variables: !558582)
; Function Attrs: optsize
declare %"class.std::__2::locale::__imp"* @_ZNKSt3__28ios_base6getlocEv(%"class.std::__2::ios_base"*) local_unnamed_addr #8
On an older EMSDK version (1.37.3) which is working, the asm.js function is declared as:
function __ZNKSt3__28ios_base6getlocEv(i1) {
i1 = i1 | 0;
var i2 = 0, i3 = 0;
i2 = STACKTOP;
STACKTOP = STACKTOP + 16 | 0;
if ((STACKTOP | 0) >= (STACK_MAX | 0)) abortStackOverflow(16);
i3 = i2;
__ZNSt3__26localeC2ERKS0_(i3, i1 + 28 | 0);
STACKTOP = i2;
return HEAP32[i3 >> 2] | 0;
}
Since I'm using the code on Unity, I have to use the bundled EMSDK of the specific Unity version, so I'm afraid I won't be able to fix that if that requires updating EMSDK/Binaryen.
Thanks for the extra info. I think that's what we fixed in https://github.com/WebAssembly/binaryen/pull/1439 , which indeed landed after 1.37.33.
There might be some way to work around this in the source code, but updating binaryen is the best thing. If it's hard to update the entire emsdk+binaryen, all you need is to build binaryen master from the time of that PR landing, and replace the asm2wasm
and wasm-opt
binaries.
Any way to skip the asm2wasm validation process?
Not really. You can tell asm2wasm not to validate with --no-validation
, but that won't help - the wasm VM will throw a validation error on loading the wasm file.
Building on a newer EMSDK version (1.38.11) doesn't give the above errors, but give some errors regarding missing symbols:
warning: unexpected number of arguments 2 in call to '_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13get_allocatorEv', should be 1
warning: unexpected number of arguments 2 in call to '_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13get_allocatorEv', should be 1
warning: unexpected number of arguments 2 in call to '_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13get_allocatorEv', should be 1
warning: unexpected number of arguments 2 in call to '_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13get_allocatorEv', should be 1
warning: unexpected number of arguments 1 in call to '_ZNKSt3__215basic_streambufIcNS_11char_traitsIcEEE6getlocEv', should be 2
warning: unexpected return type %"class.std::__2::locale::__imp"* in call to '_ZNKSt3__215basic_streambufIcNS_11char_traitsIcEEE6getlocEv', should be void
warning: unexpected number of arguments 1 in call to '_ZNKSt3__215basic_streambufIcNS_11char_traitsIcEEE6getlocEv', should be 2
warning: unexpected return type %"class.std::__2::locale::__imp"* in call to '_ZNKSt3__215basic_streambufIcNS_11char_traitsIcEEE6getlocEv', should be void
warning: unexpected number of arguments 2 in call to '_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13get_allocatorEv', should be 1
warning: unexpected number of arguments 2 in call to '_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13get_allocatorEv', should be 1
warning: unexpected number of arguments 1 in call to '_ZNKSt3__28ios_base6getlocEv', should be 2
warning: unexpected return type %"class.std::__2::locale::__imp"* in call to '_ZNKSt3__28ios_base6getlocEv', should be void
warning: unexpected number of arguments 2 in call to '_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13get_allocatorEv', should be 1
warning: unexpected return type i32 in call to 'aiSetImportPropertyInteger', should be void
warning: unexpected return type i32 in call to 'aiSetImportPropertyFloat', should be void
warning: unexpected return type i32 in call to 'aiSetImportPropertyString', should be void
warning: unexpected return type i32 in call to 'aiSetImportPropertyMatrix', should be void
warning: unexpected number of arguments 2 in call to '_ZN6il2cpp6icalls8mscorlib6System6String22RedirectToCreateStringEv', should be 0
warning: unexpected number of arguments 4 in call to '_ZN6il2cpp6icalls8mscorlib6System6String22RedirectToCreateStringEv', should be 0
warning: unexpected number of arguments 5 in call to '_ZN6il2cpp6icalls8mscorlib6System6String22RedirectToCreateStringEv', should be 0
warning: unexpected number of arguments 4 in call to '_ZN6il2cpp6icalls8mscorlib6System6String22RedirectToCreateStringEv', should be 0
warning: unexpected number of arguments 2 in call to '_ZN6il2cpp6icalls8mscorlib6System6String22RedirectToCreateStringEv', should be 0
warning: unexpected number of arguments 3 in call to '_ZN6il2cpp6icalls8mscorlib6System6String22RedirectToCreateStringEv', should be 0
warning: unexpected number of arguments 0 in call to '_ZNSt3__216forward_as_tupleIJEEENS_5tupleIJDpOT_EEES4_', should be 1
warning: unexpected number of arguments 0 in call to '_ZNSt3__216forward_as_tupleIJEEENS_5tupleIJDpOT_EEES4_', should be 1
warning: unexpected number of arguments 0 in call to '_ZNSt3__216forward_as_tupleIJEEENS_5tupleIJDpOT_EEES4_', should be 1
warning: unexpected number of arguments 1 in call to '__cxa_pure_virtual', should be 0
warning: unexpected number of arguments 0 in call to '_ZNSt3__216forward_as_tupleIJEEENS_5tupleIJDpOT_EEES4_', should be 1
error: unresolved symbol: _ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE2atEj
error: unresolved symbol: _ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findEcj
error: unresolved symbol: _ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5rfindEcj
error: unresolved symbol: _ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEjjPKcj
error: unresolved symbol: _ZNSt3__212__next_primeEj
error: unresolved symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5eraseEjj
error: unresolved symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKcj
error: unresolved symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEjPKc
error: unresolved symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEjPKcj
error: unresolved symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEjc
error: unresolved symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEjjPKc
error: unresolved symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEj
error: unresolved symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_jjRKS4_
error: unresolved symbol: _ZNSt3__213basic_istreamIcNS_11char_traitsIcEEE4readEPci
error: unresolved symbol: _ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE6setbufEPci
error: unresolved symbol: _ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE6xsgetnEPci
error: unresolved symbol: _ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE6xsputnEPKci
error: unresolved symbol: _Znaj
error: unresolved symbol: _Znwj
error: unresolved symbol: _ZnwjRKSt9nothrow_t
Hmm, it's possible you need to rebuild system libraries for that version. ./emcc --clear-cache
should make it rebuild them automatically next time.
Oh, also it's possible Unity has some bundled system libraries that need to be linked with the old versions, which is the opposite problem.
The newer bitcode file has been compiled with the same EMSDK version as Unity 2019 (EMSDK 1.38.11) The libcxx versions LLVM is linking (libcxx.a and libcxxabi.bc) don't have any of the missing methods indeed:
DEBUG:root:PYTHON not defined in C:\Program Files\Unity 2019.1.0a12\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\emscripten.config, using "C:\Program Files\Unity 2019.1.0a12\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten_Win\python\2.7.5.3_64bit\python.exe"
DEBUG:root:EMCC_WASM_BACKEND tells us to use asm.js backend
warning:root:invocation: C:\Program Files\Unity 2019.1.0a12\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\emcc.py @C:\Repos\trilib\2019\New Unity Project\Assets\..\Temp\emcc_arguments.resp (in C:\Repos\trilib\2019\New Unity Project\Temp\StagingArea\Data)
warning:root:Read response file C:\Repos\trilib\2019\New Unity Project\Assets\..\Temp\emcc_arguments.resp: ['-O3', '-g2', '-DUNITY_WEBGL=1', '-s', 'PRECISE_F32=2', '-s', 'USE_WEBGL2=1', '-s', 'FULL_ES3=1', '-s', "EXTRA_EXPORTED_RUNTIME_METHODS=['addRunDependency','removeRunDependency','FS_createPath','FS_createDataFile','ccall','cwrap','stackTrace']", '-s', 'DISABLE_EXCEPTION_CATCHING=0', '-s', 'TOTAL_MEMORY=32MB', '-s', 'ASSERTIONS=1', '-s', 'DEMANGLE_SUPPORT=1', '-s', 'ERROR_ON_UNDEFINED_SYMBOLS=1', '-s', 'WASM=1', '-s', "BINARYEN_TRAP_MODE='allow'", '-s', 'ALLOW_MEMORY_GROWTH=1', '-s', 'MODULARIZE=1', '-s', 'EXPORT_NAME=UnityModule', '--memory-init-file', '1', '--emit-symbol-map', '--output_eol', 'linux', '-o', 'C:\\Repos\\trilib\\2019\\New Unity Project\\Temp\\StagingArea\\Data\\linkresult_wasm\\build.js', '--pre-js', 'C:\\Program Files\\Unity 2019.1.0a12\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\prejs\\CachedXMLHttpRequest.js', '--pre-js', 'C:\\Program Files\\Unity 2019.1.0a12\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\prejs\\FileSystem.js', '--pre-js', 'C:\\Program Files\\Unity 2019.1.0a12\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\prejs\\FullScreen.js', '--pre-js', 'C:\\Program Files\\Unity 2019.1.0a12\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\prejs\\LoaderSetup.js', '--pre-js', 'C:\\Program Files\\Unity 2019.1.0a12\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\prejs\\MediaDevices.js', '--pre-js', 'C:\\Program Files\\Unity 2019.1.0a12\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\prejs\\SendMessage.js', '--js-library', 'C:\\Program Files\\Unity 2019.1.0a12\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\lib\\Audio.js', '--js-library', 'C:\\Program Files\\Unity 2019.1.0a12\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\lib\\Cursor.js', '--js-library', 'C:\\Program Files\\Unity 2019.1.0a12\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\lib\\Eval.js', '--js-library', 'C:\\Program Files\\Unity 2019.1.0a12\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\lib\\FileSystem.js', '--js-library', 'C:\\Program Files\\Unity 2019.1.0a12\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\lib\\Logging.js', '--js-library', 'C:\\Program Files\\Unity 2019.1.0a12\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\lib\\Profiler.js', '--js-library', 'C:\\Program Files\\Unity 2019.1.0a12\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\lib\\SystemInfo.js', '--js-library', 'C:\\Program Files\\Unity 2019.1.0a12\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\lib\\UnetWebSocket.js', '--js-library', 'C:\\Program Files\\Unity 2019.1.0a12\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\lib\\Video.js', '--js-library', 'C:\\Program Files\\Unity 2019.1.0a12\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\lib\\WebCam.js', '--js-library', 'C:\\Program Files\\Unity 2019.1.0a12\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\lib\\WebRequest.js', 'C:\\Repos\\trilib\\2019\\New Unity Project\\Assets\\TriLib\\TriLib\\Plugins\\WebGL\\libz.bc', 'C:\\Repos\\trilib\\2019\\New Unity Project\\Assets\\TriLib\\TriLib\\Plugins\\WebGL\\libstb_image.bc', 'C:\\Repos\\trilib\\2019\\New Unity Project\\Assets\\TriLib\\TriLib\\Plugins\\WebGL\\libassimp.bc', 'C:\\Repos\\trilib\\2019\\New Unity Project\\Temp\\StagingArea\\Data\\Native\\build.bc']
DEBUG:root:asm.js opts not forced by user or an option that depends them, and we do not intend to run the asm.js, so disabling and leaving opts to the binaryen optimizer
DEBUG:root:compiling to bitcode
DEBUG:root:emcc step "parse arguments and setup" took 0.01 seconds
DEBUG:root:using bitcode file: C:\Repos\trilib\2019\New Unity Project\Assets\TriLib\TriLib\Plugins\WebGL\libz.bc
DEBUG:root:using bitcode file: C:\Repos\trilib\2019\New Unity Project\Assets\TriLib\TriLib\Plugins\WebGL\libstb_image.bc
DEBUG:root:using bitcode file: C:\Repos\trilib\2019\New Unity Project\Assets\TriLib\TriLib\Plugins\WebGL\libassimp.bc
DEBUG:root:using bitcode file: C:\Repos\trilib\2019\New Unity Project\Temp\StagingArea\Data\Native\build.bc
DEBUG:root:emcc step "bitcodeize inputs" took 0.00 seconds
DEBUG:root:emcc step "process inputs" took 0.00 seconds
DEBUG:root:will generate JavaScript
DEBUG:root:binaryen root already set to C:\Program Files\Unity 2019.1.0a12\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten_FastComp_Win\binaryen
DEBUG:root:forcing stdlibs: set(['libcxxabi'])
DEBUG:root:PYTHON not defined in C:\Program Files\Unity 2019.1.0a12\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\emscripten.config, using "C:\Program Files\Unity 2019.1.0a12\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten_Win\python\2.7.5.3_64bit\python.exe"
DEBUG:root:EMCC_WASM_BACKEND tells us to use asm.js backend
DEBUG:root:PYTHON not defined in C:\Program Files\Unity 2019.1.0a12\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\emscripten.config, using "C:\Program Files\Unity 2019.1.0a12\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten_Win\python\2.7.5.3_64bit\python.exe"
DEBUG:root:EMCC_WASM_BACKEND tells us to use asm.js backend
DEBUG:root:PYTHON not defined in C:\Program Files\Unity 2019.1.0a12\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\emscripten.config, using "C:\Program Files\Unity 2019.1.0a12\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten_Win\python\2.7.5.3_64bit\python.exe"
DEBUG:root:EMCC_WASM_BACKEND tells us to use asm.js backend
DEBUG:root:PYTHON not defined in C:\Program Files\Unity 2019.1.0a12\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\emscripten.config, using "C:\Program Files\Unity 2019.1.0a12\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten_Win\python\2.7.5.3_64bit\python.exe"
DEBUG:root:EMCC_WASM_BACKEND tells us to use asm.js backend
DEBUG:root:including libcxx.a
DEBUG:root:including libcxxabi.bc
DEBUG:root:including dlmalloc.bc
DEBUG:root:including libc.bc
DEBUG:root:including gl.bc
DEBUG:root:including wasm-libc.bc
DEBUG:root:including libc-extras.bc
DEBUG:root:emcc step "calculate system libraries" took 3.73 seconds
DEBUG:root:linking: ['C:\\Repos\\trilib\\2019\\New Unity Project\\Assets\\TriLib\\TriLib\\Plugins\\WebGL\\libz.bc', 'C:\\Repos\\trilib\\2019\\New Unity Project\\Assets\\TriLib\\TriLib\\Plugins\\WebGL\\libstb_image.bc', 'C:\\Repos\\trilib\\2019\\New Unity Project\\Assets\\TriLib\\TriLib\\Plugins\\WebGL\\libassimp.bc', 'C:\\Repos\\trilib\\2019\\New Unity Project\\Temp\\StagingArea\\Data\\Native\\build.bc', 'C:\\Program Files\\Unity 2019.1.0a12\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\Emscripten_FastComp_Win\\cache\\asmjs\\dlmalloc.bc', 'C:\\Program Files\\Unity 2019.1.0a12\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\Emscripten_FastComp_Win\\cache\\asmjs\\libc.bc', 'C:\\Program Files\\Unity 2019.1.0a12\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\Emscripten_FastComp_Win\\cache\\asmjs\\gl.bc', 'C:\\Program Files\\Unity 2019.1.0a12\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\Emscripten_FastComp_Win\\cache\\asmjs\\wasm-libc.bc', 'C:\\Program Files\\Unity 2019.1.0a12\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\Emscripten_FastComp_Win\\cache\\asmjs\\libc-extras.bc', 'C:\\Program Files\\Unity 2019.1.0a12\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\Emscripten_FastComp_Win\\cache\\asmjs\\libcxx.a', 'C:\\Program Files\\Unity 2019.1.0a12\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\Emscripten_FastComp_Win\\cache\\asmjs\\libcxxabi.bc']
DEBUG:root:adding object C:\Repos\trilib\2019\New Unity Project\Assets\TriLib\TriLib\Plugins\WebGL\libz.bc to link
DEBUG:root:adding object C:\Repos\trilib\2019\New Unity Project\Assets\TriLib\TriLib\Plugins\WebGL\libstb_image.bc to link
DEBUG:root:adding object C:\Repos\trilib\2019\New Unity Project\Assets\TriLib\TriLib\Plugins\WebGL\libassimp.bc to link
DEBUG:root:adding object C:\Repos\trilib\2019\New Unity Project\Temp\StagingArea\Data\Native\build.bc to link
DEBUG:root:adding object C:\Program Files\Unity 2019.1.0a12\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten_FastComp_Win\cache\asmjs\dlmalloc.bc to link
DEBUG:root:adding object C:\Program Files\Unity 2019.1.0a12\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten_FastComp_Win\cache\asmjs\libc.bc to link
DEBUG:root:adding object C:\Program Files\Unity 2019.1.0a12\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten_FastComp_Win\cache\asmjs\gl.bc to link
DEBUG:root:adding object C:\Program Files\Unity 2019.1.0a12\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten_FastComp_Win\cache\asmjs\wasm-libc.bc to link
DEBUG:root:adding object C:\Program Files\Unity 2019.1.0a12\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten_FastComp_Win\cache\asmjs\libc-extras.bc to link
DEBUG:root:considering archive C:\Program Files\Unity 2019.1.0a12\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten_FastComp_Win\cache\asmjs\libcxx.a
DEBUG:root:adding object c:\users\ricko\appdata\local\temp\emscripten_temp_zxkcra_archive_contents\algorithm_9e9ed988.cpp.o to link
DEBUG:root:adding object c:\users\ricko\appdata\local\temp\emscripten_temp_zxkcra_archive_contents\chrono_c0cc8b00.cpp.o to link
DEBUG:root:adding object c:\users\ricko\appdata\local\temp\emscripten_temp_zxkcra_archive_contents\condition_variable_8db83e31.cpp.o to link
DEBUG:root:adding object c:\users\ricko\appdata\local\temp\emscripten_temp_zxkcra_archive_contents\ios_087e100a.cpp.o to link
DEBUG:root:adding object c:\users\ricko\appdata\local\temp\emscripten_temp_zxkcra_archive_contents\iostream_989a09ed.cpp.o to link
DEBUG:root:adding object c:\users\ricko\appdata\local\temp\emscripten_temp_zxkcra_archive_contents\locale_f36e0233.cpp.o to link
DEBUG:root:adding object c:\users\ricko\appdata\local\temp\emscripten_temp_zxkcra_archive_contents\memory_226c3f41.cpp.o to link
DEBUG:root:adding object c:\users\ricko\appdata\local\temp\emscripten_temp_zxkcra_archive_contents\mutex_cdd4d261.cpp.o to link
DEBUG:root:adding object c:\users\ricko\appdata\local\temp\emscripten_temp_zxkcra_archive_contents\new_8b186b3f.cpp.o to link
DEBUG:root:adding object c:\users\ricko\appdata\local\temp\emscripten_temp_zxkcra_archive_contents\stdexcept_ca45be18.cpp.o to link
DEBUG:root:adding object c:\users\ricko\appdata\local\temp\emscripten_temp_zxkcra_archive_contents\string_a29b194f.cpp.o to link
DEBUG:root:adding object c:\users\ricko\appdata\local\temp\emscripten_temp_zxkcra_archive_contents\system_error_41fbcb95.cpp.o to link
DEBUG:root:adding object c:\users\ricko\appdata\local\temp\emscripten_temp_zxkcra_archive_contents\thread_f9c2e2ef.cpp.o to link
DEBUG:root:adding object c:\users\ricko\appdata\local\temp\emscripten_temp_zxkcra_archive_contents\vector_472937d5.cpp.o to link
DEBUG:root:adding object c:\users\ricko\appdata\local\temp\emscripten_temp_zxkcra_archive_contents\exception_02e912fc.cpp.o to link
DEBUG:root:adding object c:\users\ricko\appdata\local\temp\emscripten_temp_zxkcra_archive_contents\future_902e36fd.cpp.o to link
DEBUG:root:done running loop of archive C:\Program Files\Unity 2019.1.0a12\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten_FastComp_Win\cache\asmjs\libcxx.a
DEBUG:root:adding object C:\Program Files\Unity 2019.1.0a12\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten_FastComp_Win\cache\asmjs\libcxxabi.bc to link
DEBUG:root:emcc step "link" took 1.36 seconds
DEBUG:root:saving intermediate processing steps to C:\Users\ricko\AppData\Local\Temp\emscripten_temp
DEBUG:root:(not saving intermediate C:\Users\ricko\AppData\Local\Temp\emscripten_temp\emcc-0-basebc.bc because deferring linking)
DEBUG:root:emcc: LLVM opts: -strip-debug -disable-debug-info-type-map -internalize -internalize-public-api-list=main,__cxa_demangle,malloc,free,__errno_location,fflush,malloc,malloc,free,malloc,__cxa_can_catch,__cxa_is_pointer_type,malloc,htonl,htons,ntohs,htonl,htons,ntohs,malloc,free,htonl,htons,ntohs,malloc,_get_tzname,_get_daylight,_get_timezone,memalign,htons,_get_environ,free,free,_get_tzname,_get_daylight,_get_timezone,_get_environ,malloc,malloc,free,_get_environ,malloc,htons,malloc,htons,htonl,htons,ntohs,realloc,malloc,strlen,_get_environ -globaldce -disable-loop-vectorization -disable-slp-vectorization -vectorize-loops=false -vectorize-slp=false [num inputs: 26]
DEBUG:root:emcc step "post-link" took 123.97 seconds
DEBUG:root:LLVM => JSINFO:root:Executing emscripten.py compiler with cmdline "C:\Users\ricko\AppData\Local\Temp\tmpuqmqyp\build.bc -o C:\Users\ricko\AppData\Local\Temp\tmpuqmqyp\build.bc.o.js --libraries C:\Program Files\Unity 2019.1.0a12\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\Audio.js,C:\Program Files\Unity 2019.1.0a12\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\Cursor.js,C:\Program Files\Unity 2019.1.0a12\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\Eval.js,C:\Program Files\Unity 2019.1.0a12\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\FileSystem.js,C:\Program Files\Unity 2019.1.0a12\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\Logging.js,C:\Program Files\Unity 2019.1.0a12\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\Profiler.js,C:\Program Files\Unity 2019.1.0a12\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\SystemInfo.js,C:\Program Files\Unity 2019.1.0a12\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\UnetWebSocket.js,C:\Program Files\Unity 2019.1.0a12\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\Video.js,C:\Program Files\Unity 2019.1.0a12\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\WebCam.js,C:\Program Files\Unity 2019.1.0a12\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\WebRequest.js,C:\Program Files\Unity 2019.1.0a12\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\src\library_pthread_stub.js"
DEBUG:root:TEMP_DIR not defined in C:\Program Files\Unity 2019.1.0a12\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\emscripten.config, using C:\Users\ricko\AppData\Local\Temp
DEBUG:root:emscript: llvm backend: C:\Program Files\Unity 2019.1.0a12\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten_FastComp_Win\llc.exe C:\Users\ricko\AppData\Local\Temp\tmpuqmqyp\build.bc -march=js -filetype=asm -o C:\Users\ricko\AppData\Local\Temp\emscripten_temp\tmpfkwawx.4.js -emscripten-stack-size=5242880 -O3 -emscripten-precise-f32 -emscripten-assertions=1 -emscripten-global-base=1024 -enable-emscripten-cpp-exceptions -emscripten-no-exit-runtime -emscripten-wasm -emscripten-only-wasm
Now I wonder how using the same EMSDK version to build the bitcode library and the final WASM build gives these inconsistencies.
Looks like the "libcxx.a" contains only 64-bits counterparts of the missing symbols:
operator new[](unsigned int) (_Znaj) (missing)
operator new[](unsigned long) (_Znam) (on libcxx.a)
std::__2::__next_prime(unsigned int) (_ZNSt3__212__next_primeEj) (missing)
std::__2::__next_prime(unsigned long) (_ZNSt3__212__next_primeEm) (on libcxx.a)
operator new(unsigned int) (_Znwj) (missing)
operator new(unsigned long) (_Znwm) (on libcxx.a)
operator new(unsigned int, std::nothrow_t const&) (_ZnwjRKSt9nothrow_t) (missing)
operator new(unsigned long, std::nothrow_t const&) (_ZnwmRKSt9nothrow_t) (on libcxx.a)
Emscripten changed the signature of size_t
from int
to long
(or vice versa, I forget), so bitcode needs to be rebuilt with the new types. I think that's the cause of that issue. (They are all 32-bit ints, but get mangled differently.)
Turns out I had the .emscripten file cache pointing to a wrong Clang version. Gonna test the new BC file.
@kripken The issue was caused by the .emscripten cache file indeed, it was pointing to wrong LLVM/Clang versions and generating a broken BC library. Thank you for your support!
Hi!
I'm testing the Assimp library on WebAssembly and getting a weird "Call param number must match" (I don't get that when targeting asm.js):
WASM-validator output:
Disassembled library LLVM code portion:
ASM.JS code portion:
The problematic line:
Original C++ code portion: OpenDDLParser.cpp#L262
I can't find where the disassembled code is passing the
false
value into the method call, but "getLoc" definitely doesn't expect that: http://www.cplusplus.com/reference/ios/ios_base/getloc/I'm using EMSDK version 1.37.33 that comes with Unity 2018.2.12f1.
Something related to the Assimp code itself? Any advice?