godotengine / godot

Godot Engine ā€“ Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.4k stars 21.26k forks source link

duplicate symbol error when i use platform=javascript module_mono_enabled=yes #59543

Open YHIsMyLove opened 2 years ago

YHIsMyLove commented 2 years ago

Godot version

3.4.2-my-custom-double,3.x

System information

Windows11,GLES3,NVIDIA GeForce RTX 2060

Issue description

hello i'm trying to build my custom 3.x godot to double and camera relative rending ,now running on pc is ok but wasm is fail I don't know if I did the right thing

Steps to reproduce

Minimal reproduction project

No response

akien-mga commented 2 years ago
  • emscripten:1.39.9
  • mono: 6.12.0.147
    • build script use:godot-mono-builds
    • ./wasm.py configure --target=runtime
    • ./wasm.py make --target=runtime
    • ./bcl.py make --product=wasm

I think you might be missing the ./patch_emscripten.py step in godot-mono-builds.

See how the official build container is made here: https://github.com/godotengine/build-containers/blob/main/Dockerfile.javascript

For official builds we're also using mono 6.12.0.158 currently, though 6.12.0.147 was used in the past and worked fine too (6.12.0.158 is needed for macOS ARM64 support so not relevant for Emscripten).

YHIsMyLove commented 2 years ago

3q akien-mga i use ./patch_emscripten.py but got same error šŸ˜‚ IMG_20220326_213617 mmexport1648301898694

akien-mga commented 2 years ago

Are you able to compile the upstream Godot code (i.e. without your fork's changes)?

SysError99 commented 2 years ago

I faced exact same problem, but I didn't compile godot-mono-builds and just use release builds.

scons: Reading SConscript files ...
This Mono runtime comes with zlib bundled. Disabling 'builtin_zlib'...
Checking for `thread_local` support... supported
Found Mono root directory: /home/nate/Godot.Mono.Releases/wasm-runtime-release
Checking for C header file mntent.h... (cached) yes
scons: done reading SConscript files.
scons: Building targets ...
[ 79%] Linking Program        ==> bin/godot.javascript.opt.mono.js
wasm-ld: error: duplicate symbol: getpwnam_r
>>> defined in /home/nate/Godot.Mono.Releases/wasm-runtime-release/lib/libmonosgen-2.0.a(libmini_la-mini-wasm.o)
>>> defined in /home/nate/EmscriptenSDK/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/lto/libstubs.a(emscripten_libc_stubs.o)

wasm-ld: error: duplicate symbol: getpwuid_r
>>> defined in /home/nate/Godot.Mono.Releases/wasm-runtime-release/lib/libmonosgen-2.0.a(libmini_la-mini-wasm.o)
>>> defined in /home/nate/EmscriptenSDK/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/lto/libstubs.a(emscripten_libc_stubs.o)

wasm-ld: error: duplicate symbol: getgrnam
>>> defined in /home/nate/Godot.Mono.Releases/wasm-runtime-release/lib/libmonosgen-2.0.a(libmini_la-mini-wasm.o)
>>> defined in /home/nate/EmscriptenSDK/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/lto/libstubs.a(emscripten_libc_stubs.o)

wasm-ld: error: duplicate symbol: getgrgid
>>> defined in /home/nate/Godot.Mono.Releases/wasm-runtime-release/lib/libmonosgen-2.0.a(libmini_la-mini-wasm.o)
>>> defined in /home/nate/EmscriptenSDK/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/lto/libstubs.a(emscripten_libc_stubs.o)

wasm-ld: error: duplicate symbol: pthread_sigmask
>>> defined in /home/nate/Godot.Mono.Releases/wasm-runtime-release/lib/libmonosgen-2.0.a(libmini_la-mini-wasm.o)
>>> defined in /home/nate/EmscriptenSDK/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/lto/libc.a(pthread_sigmask.o)
em++: error: '/home/nate/EmscriptenSDK/upstream/bin/wasm-ld -o bin/godot.javascript.opt.mono.wasm -whole-archive /home/nate/Godot.Mono.Releases/wasm-runtime-release/lib/libmonosgen-2.0.a -no-whole-archive platform/javascript/audio_driver_javascript.javascript.opt.bc platform/javascript/godot_webgl2.javascript.opt.bc platform/javascript/http_client_javascript.javascript.opt.bc platform/javascript/javascript_singleton.javascript.opt.bc platform/javascript/javascript_main.javascript.opt.bc platform/javascript/os_javascript.javascript.opt.bc platform/javascript/api/javascript_tools_editor_plugin.javascript.opt.bc platform/javascript/javascript_runtime.javascript.opt.bc -L/home/nate/Godot.Mono.Releases/wasm-runtime-release/lib main/libmain.javascript.opt.a modules/libmodules.javascript.opt.a platform/libplatform.javascript.opt.a drivers/libdrivers.javascript.opt.a scene/libscene.javascript.opt.a servers/libservers.javascript.opt.a core/libcore.javascript.opt.a modules/freetype/libfreetype_builtin.javascript.opt.a /home/nate/Godot.Mono.Releases/wasm-runtime-release/lib/libmono-icall-table.a /home/nate/Godot.Mono.Releases/wasm-runtime-release/lib/libmono-native.a /home/nate/Godot.Mono.Releases/wasm-runtime-release/lib/libmono-ilgen.a /home/nate/Godot.Mono.Releases/wasm-runtime-release/lib/libmono-ee-interp.a -L/home/nate/EmscriptenSDK/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/lto -lGL-webgl2-ofb -lal -lhtml5 -lstubs -lc -ldlmalloc -lcompiler_rt -lc++-noexcept -lc++abi-noexcept -lsockets -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr --import-undefined --strip-debug --export-if-defined=main --export-if-defined=__start_em_asm --export-if-defined=__stop_em_asm --export-if-defined=__stdio_exit --export=stackSave --export=stackRestore --export=stackAlloc --export=__wasm_call_ctors --export=__errno_location --export=__funcs_on_exit --export=malloc --export=setThrew --export=free --export=ntohs --export=htons --export=__dl_seterr --export=htonl --export=__cxa_is_pointer_type --export=__cxa_can_catch --export=emscripten_builtin_memalign --export=saveSetjmp --export-table -z stack-size=5242880 --initial-memory=33554432 --no-entry --max-memory=2147483648 --global-base=1024' failed (returned 1)
scons: *** [bin/godot.javascript.opt.mono.js] Error 1
scons: building terminated because of errors.
[Time elapsed: 00:00:06.619]