emscripten-core / emscripten-core/emscripten

dynamic_cast return 0 across modules (dynamic linking) when -fvisibility=hidden is used

Open
#17,698 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

**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](https://github.com/emscripten-core/emscripten/files/9396657/dynamic_cast_issue.zip)
sources are attached in archive
build.bat contains commands to build

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.