Skip to content
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

[c++] Move ABI implementation to own module, add option to use exceptions and RTTI #343

Merged
merged 5 commits into from
Mar 12, 2020

Conversation

salkinium
Copy link
Member

@salkinium salkinium commented Mar 11, 2020

This moves the __cxa* function implementations from the :platform:core modules to the :stdc++ module. These functions were always out-of-place in :platform:core modules as implementing C++ ABI isn't that dependent on the underlying hardware, and much more on the compiler and library supports.

For Cortex-M targets options to enable C++ exceptions and RTTI is added, should this be desired. Some minor changes to the linkerscript and the compile flags was necessary, however nothing particularly interesting here, except watching the code size explode, yay.

cc @se-bi @chris-durand

@se-bi
Copy link
Contributor

se-bi commented Mar 11, 2020

Work's for me, work's for my project. ☺️
I'm happy with that, thanks!

👍

@salkinium
Copy link
Member Author

I've added moving the target and language specific compile flags out of the :build module and into the modules that are responsible for these flags, ie. :stdc++ for CXXFLAGS and :platform:core for ARCHFLAGS etc. This ties the code implementations closer to the compiler flags (like using -Wl,-wrap,_malloc_r to implement malloc) as well as removes some duplicate checks in :build.

However, this makes it harder to port to another compiler that isn't GCC compatible, however, since this involved likely a lot more than just adapting compile flags, it's probably not a relevant disadvantage.

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

Successfully merging this pull request may close these issues.

2 participants