Skip to content

Proposal: ability to statically link against C++ stdlib #1497

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Vaider7
Copy link

@Vaider7 Vaider7 commented Jul 16, 2025

Hi everyone!

I want to create a little proposal. It's very common situation when you need to statically link C++ stdlib to your binary. Usually it makes your binary a little bit more portable, especially if your app will be distributed to old systems. So this PR introduce an ability to explicitly say that you want to statically link C++ stdlib

Also maybe it will be useful to have a function to set a path where stdlib in .a format can be found, but I'm not sure about this one

Copy link
Collaborator

@NobodyXu NobodyXu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, would you be able to add a test case for it?

Or just test that it works for your local project?

@Vaider7
Copy link
Author

Vaider7 commented Jul 18, 2025

I would be happy to add test case for it, but It will be highly depending on host environment. I mean for environment where this test will be run, we need to be sure that somewhere in the system there's a file libstdc++.a (as example), which is available for linking, otherwise test will fail.

If it's not a problem to set CI to meet this requirement, I'll do that

Also I tested it locally for my project and it works as expected

@NobodyXu
Copy link
Collaborator

Yes you can change our ci to install the libstdc++.a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants