Skip to content

Only link C++ libraries by default when run via em++ or when compiling a C++ file. #11121

Closed

Description

@sbc100

if you try to link C++ object files with clang or gcc (as opposed to clang++ or g++) the result is undefined C++ symbols.

We should behave the same. Up until #10998
this was a non-issue since we were doing "on-demand" linking for all libraries.

This risks breaking certain users, so it might not be worth it.

The main upside would be that it would reduce the size of C programs build with MAIN_MODULE=1 .. (and be more consistent with existing toolchains).

Activity

  1. self-assigned this
    on May 9, 2020
  2. stale commented on Jun 2, 2021

    @stale

    This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant.

  3. sbc100 commented on Jun 2, 2021

    @sbc100
    CollaboratorAuthor

    Still working on this

  4. added 8 commits that reference this issue on Jul 31, 2026
    5e7653f
    9f54b3f
    da88c65
    73cc12a
    a1d49a3
    c2a19cd
    d05c129
    6ec69f5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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