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

Constructors #324

Merged
merged 6 commits into from
May 22, 2022
Merged

Constructors #324

merged 6 commits into from
May 22, 2022

Conversation

GideonZ
Copy link
Collaborator

@GideonZ GideonZ commented May 21, 2022

As promised, hereby the pull request with the necessary changes to the crt0.s and linker script to support the proper initialization of C++ objects by calling the constructors. A small demo shows that the static objects have been initialized properly.

@stnolting
Copy link
Owner

stnolting commented May 21, 2022

This is amazing!
I did not expect that a c++ setup would work this flawlessly - actually, I did not expect that it would work at all! 😅

Calling the constructor and destructors "manually" from crt0 (and not using call __libc_init_array) seems to be a nice way to avoid library code being pulled in. There shouldn't be any functional difference, right?

I will have a closer look at your code but I think I am absolutely fine with merging this as-is. 👍

edit

Maybe we should merge #323 first to avoid too much merge conflicts here.

@stnolting stnolting self-requested a review May 21, 2022 10:26
@stnolting stnolting added enhancement New feature or request SW software-related labels May 21, 2022
@stnolting stnolting linked an issue May 21, 2022 that may be closed by this pull request
@stnolting
Copy link
Owner

@GideonZ you are OK with the changes?

@GideonZ
Copy link
Collaborator Author

GideonZ commented May 22, 2022

@GideonZ you are OK with the changes?

Absolutely. I saw a few typos in the documentation that you may want to have a look at, but it's just minor. Actually I admire your diligence of updating the documentation with these changes!

@stnolting stnolting merged commit 55e664d into stnolting:main May 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request SW software-related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🧪 support for constructors & destructors
2 participants