Closed goldwaving closed 2 months ago
Any update on this issue? If I hack sharedRegisterType
to ignore duplicate registrations, everything seems to work normally.
Can you share the full link flags you are using when building your main module and your side module(s)?
The embind_init_builtin
code is coming from bind.cpp
and is in a static constructor. See https://github.com/emscripten-core/emscripten/blob/95e2146355f3e152ca0f42be4fec2f8c7cb637b3/system/lib/embind/bind.cpp#L122.
This static constructor should only exist in the main module and not in the side module. I wonder if somehow bind.cpp
(which lives in libembind.a
is somehow being linked into your side module? Can you shared the output of your side module linking when you add -v
? My guess is that -lembind
is being added to the link line when it shouldn't.
That was the problem. After ensuring -lembind
was removed from all side modules and rebuilding, everything worked. Thanks for the help!
I do wonder if we should fix this somehow, since others might run into the same thing.
I also wonder why this seems to not be a problem with older versions of emscripten?
When using dynamically linking, we are now getting a runtime error
BindingError: Cannot register type 'void' twice
. This occurs in theloadDyLibs
function, which callssharedRegisterType
at some point. The error does not occur when using 3.1.56.