-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Build libstdc++ as a module #80762
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
base: main
Are you sure you want to change the base?
Build libstdc++ as a module #80762
Conversation
|
The following west manifest projects have changed revision in this Pull Request:
⛔ DNM label due to: 1 added project Note: This message is automatically posted and updated by the Manifest GitHub Action. |
7946381 to
bb26c26
Compare
bb26c26 to
5d48fd2
Compare
5d48fd2 to
9d96613
Compare
8bbc475 to
76a87a3
Compare
|
I tried this module approach and it worked fine, however it doubled the compile time for our sample (which is long by itself): It may have some use cases, but I think having pre-compiled version without exceptions (which probably would be most of the cases) would be nice. Using module would not work for us, as this would significantly increase build times, slow down CI pipeline and local development. By the way, I compared the binaries (module and noexept from this build) with and it looks like module version is slightly bigger. Do you know what might be the difference? bloaty output: bloaty.txt |
690ef0b to
b821051
Compare
I asked about this on Discord.
Will check, thanks! |
aescolar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@keith-packard given that Zephyr is Apache 2, and this new module is new code, I guess it would need to be also Apache2 licensed, and not BSD3.
(by the way, I do not think you can claim copyright in your name on the license file itself :) )
|
@keith-packard I'm not opposed to having something akin to this. But when we started discussing building this library from source a few months ago, my hope was we could build it also for the native_simulator based targets (just like we can with picolibc), which with this current solution we can't. Anyhow, a comment on the approach itself: Downloading ~130MB for each image build is probably not something people will be too happy about and feels a bit extreme. |
It should work with the native simulator with picolibc; libstdc++ has libc-specific code, which is why there are limitations in the config bits. I'm not sure why it isn't working with native_sim, but can check.
Yeah, it would be easy to just dump the gcc source into the module repo. However, that's all GPL licensed, which seemed like it would conflict with Zephyr policy. |
I can easily change the license, but BSD3 is apache2 compatible and there is lots of that in other modules? |
That'd be nice |
Yeah, gcc doesn't like this mode at all -- we're using the native compiler to build things, so it doesn't believe we're cross-compiling. I'm not sure that will be easy to fix, gcc's build system is somewhat arcane. |
Provide a mechanism to build libstdc++ as a module, instead of requiring that it be included in the toolchain. Signed-off-by: Keith Packard <[email protected]>
Add a test case verifying that libstdc++ can be used with picolibc with newlib. Signed-off-by: Keith Packard <[email protected]>
b821051 to
4675791
Compare
|
|
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
|
|
@keith-packard I'm trying to use Picolibc for native_sim with my C++ project and am having some issues - any word on whether this PR will be moving forward? Thanks! |
To make it work with native_sim would involve fixing the build system for the underlying gcc repository; if you're up for a challenge, I'd be happy to review changes, but I don't have any need for this now that the Zephyr SDK will include two versions built with and without exception support. |





Provide a mechanism to build libstdc++ as a module, instead of requiring that it be included in the toolchain.