Skip to content

cpu/atmega_common: Provide C++ support (without libstdc++)#14598

Merged
benpicco merged 4 commits intoRIOT-OS:masterfrom
maribu:avr-cpp
Jul 27, 2020
Merged

cpu/atmega_common: Provide C++ support (without libstdc++)#14598
benpicco merged 4 commits intoRIOT-OS:masterfrom
maribu:avr-cpp

Conversation

@maribu
Copy link
Copy Markdown
Member

@maribu maribu commented Jul 23, 2020

Contribution description

This PR adds basic C++ support, including support for initializing statically allocated class instances in a thread-safe manner. (The implementation of the later is not AVR specific, so it was moved as module to sys/. Other architectures might just use that as well.)

Testing procedure

All of the C++ tests in tests/ should work, except those requiring libstdc++ support. (But those should complain about a missing feature, instead of surprising compilation bugs.)

Issues/PRs references

None

For thread-safe calling of C++ constructs of statically allocated class
instances some platform support code is needed. This commit ads one
implementation compatible with g++.
@maribu maribu added Area: C++ Area: C++ wrapper Platform: AVR Platform: This PR/issue effects AVR-based platforms Type: new feature The issue requests / The PR implemements a new feature for RIOT labels Jul 23, 2020
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Jul 24, 2020
@benpicco
Copy link
Copy Markdown
Contributor

Murdock isn't happy yet.

@maribu maribu removed the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Jul 24, 2020
@maribu
Copy link
Copy Markdown
Member Author

maribu commented Jul 24, 2020

Murdock isn't happy yet.

Thanks for pointing this out. I think I fixed the culprit. May I squash before Murdock takes a second look?

@benpicco
Copy link
Copy Markdown
Contributor

Sure, squash!

maribu added 2 commits July 24, 2020 15:22
The C++ header cstdio is used, but only provided by libstdc++
@maribu maribu added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Jul 24, 2020
@miri64 miri64 added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Jul 24, 2020
@miri64
Copy link
Copy Markdown
Member

miri64 commented Jul 24, 2020

Requeueing to get the release out ASAP.

@benpicco
Copy link
Copy Markdown
Contributor

Looks like utensor also requires libstdcpp

Copy link
Copy Markdown
Contributor

@benpicco benpicco left a comment

Choose a reason for hiding this comment

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

Code looks good and tests/cpp_ctors is working on AVR.

@maribu maribu added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Jul 27, 2020
@benpicco benpicco merged commit 22e9ba1 into RIOT-OS:master Jul 27, 2020
@maribu
Copy link
Copy Markdown
Member Author

maribu commented Jul 27, 2020

Thanks for the review!

@maribu maribu deleted the avr-cpp branch July 27, 2020 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: C++ Area: C++ wrapper CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: AVR Platform: This PR/issue effects AVR-based platforms Type: new feature The issue requests / The PR implemements a new feature for RIOT

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants