Skip to content

Linking entire libstdc++ to a SIDE_MODULE #1607

@tdrz

Description

@tdrz

I'm looking into building PostGIS for PGlite (PostgreSQL in WASM) - more here. 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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions