emscripten-core / emscripten-core/emsdk

Linking entire libstdc++ to a SIDE_MODULE

Open
#1,607 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
3.7k
Forks
821
Avg merge
1h 25m
Merged PRs (30d)
3

Description

I'm looking into building [PostGIS](https://postgis.net) for [PGlite](https://pglite.dev) (PostgreSQL in WASM) - more [here](https://github.com/electric-sql/pglite/issues/803). This is a C++ extension, the first of the kind that PGlite would support.

I want to know if it is possible to statically link `libstdc++` to it such that we wouldn't have to link `libstdc++` to PGlite itself. This is in order to save space for everyone who's not interested in this extension. Something like `-Wl,--whole-archive -lstdc++ -Wl,--no-whole-archive`?

I have tried it (with emsdk `v3.1.74`) but at runtime I was getting crashes related to missing symbols (I manually added some of them to EXPORTED_FUNCTIONS in the MAIN_MODULE to see if that makes it run further, which it did).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.