Skip to content
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

JavaScript + GDNative build fails linking with Emscripten 2.0.20 #48676

Closed
akien-mga opened this issue May 12, 2021 · 1 comment · Fixed by #48831
Closed

JavaScript + GDNative build fails linking with Emscripten 2.0.20 #48676

akien-mga opened this issue May 12, 2021 · 1 comment · Fixed by #48831

Comments

@akien-mga
Copy link
Member

Godot version:
3.x (fcfce4b), but I assume master and 3.3 are affected too.

OS/device including version:
Linux, compiling with Emscripten 2.0.20.
I did not test other versions between 2.0.15 and 2.0.20.

Issue description:
Compiling JavaScript GDNative templates fail linking:

error: undefined symbol: _Z13godot_js_mainiPPc (referenced by top-level compiled C/C++ code)
warning: Link with `-s LLD_REPORT_UNDEFINED` to get more information on undefined symbols
warning: To disable errors for undefined symbols use `-s ERROR_ON_UNDEFINED_SYMBOLS=0`
warning: __Z13godot_js_mainiPPc may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
Compiling ==> thirdparty/bullet/BulletSoftBody/btSoftBodyConcaveCollisionAlgorithm.cpp
Error: Aborting compilation due to previous errors
em++: error: '/home/akien/Projects/godot/emscripten/emsdk/node/14.15.5_64bit/bin/node /home/akien/Projects/godot/emscripten/emsdk/upstream/emscripten/src/compiler.js /tmp/tmppum75bom.txt' failed (1)
scons: *** [bin/godot.javascript.opt.debug.gdnative.js] Error 1
scons: building terminated because of errors.

Happens with 2.0.20 and at least 3.3 build was fine with 2.0.15 a few days ago for 3.3.1 RC 1, so this is likely due to a recent upstream change.

Steps to reproduce:

  • scons p=javascript production=yes target=release_debug tools=no gdnative_enabled=yes
@akien-mga
Copy link
Member Author

akien-mga commented May 12, 2021

I didn't test to confirm but this is likely related to this change in 2.0.19: https://github.com/emscripten-core/emscripten/blob/main/ChangeLog.md#2019-05042021

When building with -s MAIN_MODULE emscripten will now error on undefined symbol by default. This matches the behvious of clang/gcc/msvc. This requires that your side modules be present on the command line. If you do not specify your side modules on the command line (either direcly or via RUNTIME_LINKED_LIBS) you may need to add -s WARN_ON_UNDEFINED_SYMBOLS=0 to avoid errors about symbol that are missing at link time (but present in your side modules provided at runtime). We hope that this case is not common and most users are building with side modules listed on the command line (emscripten-core/emscripten#14060).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants