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
Cannot compile after switching to latest emsdk... #14313
Comments
Perhaps a full rebuild of your project (and |
The problem is not cmake cache or old obj / lib related. |
I currently disabled exceptions by providing flag -fno-exceptions and got rid of 2 unresolveds: ___cxa_can_catch and __cxa_is_pointer_type, Not sure why I have this unresolveds with enabled exceptions though. So currently i have only one unresolved: emscripten_is_main_browser_thread. |
It looks like we could be missing some dependencies in deps_info.py. One thing that looks suspicious is the node path in |
Emcc version is correct: I get emscripten_is_main_browser_thread unresolved only when I use fetch API. And btw seems like with new emscripten - fetch is not working anymore. |
Can you share the full example so that we can reproduce? If not then at least make the full output of the link command running with |
I'm having the same undefined error "emscripten_is_main_browser_thread". I'm compiling in both Win and Mac and only Windows shows up the error at compilation. Any suggestions? |
Can you post the full command line that is failing, along with the full error message it produces? |
Here's an example of the command line we are using at linking. The source files are compiled separately. emcc -m32 -s WASM=1 -s EXPORTED_RUNTIME_METHODS=["cwrap","ccall","getValue"] -s FORCE_FILESYSTEM=1 -pthread -s USE_PTHREADS=1 -s PTHREAD_POOL_SIZE=1 -s TOTAL_MEMORY=512MB -s OFFSCREENCANVAS_SUPPORT=1 -s MODULARIZE=1 -s FETCH=1 -s EXPORT_NAME='MyModule' -s CASE_INSENSITIVE_FS=1 -O1 -gsource-map -s PTHREADS_DEBUG=1 *.o -o myFile.js |
Can you also give the full output of that command, including the error message? And what version of emscripten is it failing with? When did is start failing for you? Was it working with version 2.0.13 like it was for the OP? |
Correct, version 2.0.13 is working fine in both platforms. This is the error that shows up when compiling with 2.0.24 only on Windows. error: undefined symbol: emscripten_is_main_browser_thread (referenced by emscripten_start_fetch__deps: ['$Fetch','$fetchXHR','$callUserCallback','emscripten_is_main_browser_thread','$runtimeKeepalivePush','$runtimeKeepalivePop','$fetchCacheData','$fetchLoadCachedData','$fetchDeleteCachedData'], referenced by top-level compiled C/C++ code) |
The function is a little unusual in that is provided by native code in USE_PTHREADS builds but by JS library code in non-threaded builds. In neither case does the JS fetch code depend this symbol. A call to this function exists in `system/lib/fetchemscripten_fetch.cpp` but that should be resolved using normal native->native or native->JS linking which does not require any special handling. See: #14313
The function is a little unusual in that is provided by native code in USE_PTHREADS builds but by JS library code in non-threaded builds. In neither case does the JS fetch code depend this symbol. A call to this function exists in `system/lib/fetchemscripten_fetch.cpp` but that should be resolved using normal native->native or native->JS linking which does not require any special handling. See: #14313
Hi, I am also running into this issue trying to compile from Rust code. For me the only unresolved symbol is |
It would be good to bisect one of these failing cases, that might be the fastest way to find the source of the regression as no other ideas have come up: https://emscripten.org/docs/contributing/developers_guide.html#bisecting |
|
Edit: I'm not sure why setting this to 0 apparently removes the exception code (instead of uhh disabling the exception disabling, whee double negative), but hey I'll take it. |
Hello,
Today I installed latest emsdk and suddenly my project is not compilable anymore (previous emsdk was 2.0.13 and was perfectly working).
It complainst on unresolved symbols: __cxa_is_pointer_type, __cxa_can_catch, emscripten_is_main_browser_thread...
Do I need to link against some system libraries?
Please help, I have quite limited time...
error: undefined symbol: __cxa_is_pointer_type (referenced by $CatchInfo__deps: ['$ExceptionInfo','__cxa_is_pointer_type'], referenced by __cxa_begin_catch__deps: ['$CatchInfo','$exceptionCaught','$exception_addRef','$uncaughtExceptionCount'], referenced by top-level compiled C/C++ code)
warning: Link with
-s LLD_REPORT_UNDEFINED
to get more information on undefined symbolswarning: To disable errors for undefined symbols use
-s ERROR_ON_UNDEFINED_SYMBOLS=0
warning: ___cxa_is_pointer_type may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: __cxa_can_catch (referenced by __cxa_find_matching_catch_2__deps: ['$exceptionLast','$ExceptionInfo','$CatchInfo','__resumeException','__cxa_can_catch'], referenced by top-level compiled C/C++ code)
warning: ___cxa_can_catch may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: emscripten_is_main_browser_thread (referenced by emscripten_start_fetch__deps: ['$Fetch','$fetchXHR','$callUserCallback','emscripten_is_main_browser_thread','$runtimeKeepalivePush','$runtimeKeepalivePop','$fetchCacheData','$fetchLoadCachedData','$fetchDeleteCachedData'], referenced by top-level compiled C/C++ code)
warning: _emscripten_is_main_browser_thread may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
Error: Aborting compilation due to previous errors
em++: error: 'd:/Projects/emsdk/node/12.18.1_64bit/bin/node.exe D:\Projects\emsdk\upstream\emscripten\src\compiler.js C:\Users\Andrey\AppData\Local\Temp\tmpr0zim25y.txt' failed (returned 1)
ninja: build stopped: subcommand failed.
The text was updated successfully, but these errors were encountered: