Open Stuonts opened 2 years ago
I think this would happen with gcc and clang too if you used -fvisibility=hidden
wouldn't it?
We have a large project on Mac (built with clang) with the same codebase and some bugs occur on Emscripten while the same code (using dynamic_cast) works on Mac
Also, we checked basically the same small example on Mac and dynamic_cast works across modules
CClass *c = dynamic_cast<CClass *>(i);
if (c)
std::cout << "success" << std::endl;
else
std::cout << "fail" << std::endl;
this dynamic_cast from lib2.cpp works on Mac (built on clang) while fails on Emscripten
Version of emscripten/emsdk: 3.1.15
This issue causes problems in a large project when it is ported to WASM + dynamic linking causing unexpected failures requiring debugging. It can be fixed if attribute ((visibility("default"))) is added to IInterface and CClass.
Tried --export-dynamic and it doesn't help.
dynamic_cast_issue.zip sources are attached in archive build.bat contains commands to build