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

Change libphoenix initialization #313

Merged
merged 1 commit into from
Jan 27, 2024
Merged

Change libphoenix initialization #313

merged 1 commit into from
Jan 27, 2024

Conversation

badochov
Copy link
Contributor

This change prepares libphoenix to be used in dynamic loader, where crt0 is not included.

Moved constructor and destrutor calling into crt0. Wrapped libphoenix initialization into a single function to reduce crt0 and libphoenix intertwine.

JIRA: RTOS-694

Description

[RTOS-694] #done

Motivation and Context

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

How Has This Been Tested?

  • Already covered by automatic testing.
  • New test added: (add PR link here).
  • Tested by hand on: (list targets here).

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing linter checks and tests passed.
  • My changes generate no new compilation warnings for any of the targets.

Special treatment

  • This PR needs additional PRs to work (list the PRs, preferably in merge-order).
  • I will merge this PR by myself when appropriate.

misc/init.c Outdated Show resolved Hide resolved
@badochov badochov force-pushed the badochov/init branch 2 times, most recently from 8265311 to 8381f1f Compare November 29, 2023 13:14
Copy link

github-actions bot commented Nov 29, 2023

Unit Test Results

6 410 tests  +1 211   5 776 ✅ +1 123   32m 33s ⏱️ + 4m 34s
  354 suites +   56     634 💤 +   89 
    1 files   ±    0       0 ❌  -     1 

Results for commit a103773. ± Comparison against base commit 9d138b9.

♻️ This comment has been updated with latest results.

misc/init.c Outdated Show resolved Hide resolved
@badochov badochov force-pushed the badochov/init branch 2 times, most recently from 7c71601 to bdcf9c3 Compare November 29, 2023 13:59
Copy link
Member

@agkaminski agkaminski left a comment

Choose a reason for hiding this comment

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

LGTM, but add yourself to authors list

_startc.c Outdated Show resolved Hide resolved
agkaminski
agkaminski previously approved these changes Dec 15, 2023
Copy link
Member

@agkaminski agkaminski left a comment

Choose a reason for hiding this comment

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

LGTM

@badochov
Copy link
Contributor Author

badochov commented Dec 15, 2023

@agkaminski Is the CI failling on imx1060 a known issue or sth new created by this pr?

@agkaminski
Copy link
Member

agkaminski commented Dec 15, 2023

@agkaminski Is the CI failling on imx1060 a known issue or sth new creted by this pr?

I don't think I've seen it, looks like a user stack overflow. Might be caused by this PR I guess - maybe _libc_init was inlined along with function(s) it's calling? Perhaps __attribute__((noinline)) on _libc_init would solve this. But it would be best to inspect build artifacts first to see if it indeed happened.

@badochov
Copy link
Contributor Author

@agkaminski Is the CI failling on imx1060 a known issue or sth new creted by this pr?

I don't think I've seen it, looks like a user stack overflow. Might be caused by this PR I guess - maybe _libc_init was inlined along with function(s) it's calling? Perhaps __attribute__((noinline)) on _libc_init would solve this. But it would be best to inspect build artifacts first to see if it indeed happened.

Locally it doesn't inline _libc_init, also seems to be too undeterministic for that to be the case

This change prepares libphoenix to be used in dynamic loader, where crt0
is not included.

Moved constructor and destrutor calling into crt0.
Wrapped libphoenix initialization into a single function to reduce crt0
and libphoenix intertwine.

JIRA: RTOS-694
@badochov
Copy link
Contributor Author

badochov commented Jan 8, 2024

@agkaminski I added noinlien to _init_array as it got inlined after rewrite and increased stack size of _startc.
I rerun test 3 times and the issue on imx1060 haven't reoccured

@badochov
Copy link
Contributor Author

badochov commented Jan 9, 2024

@agkaminski I added noinlien to _init_array as it got inlined after rewrite and increased stack size of _startc. I rerun test 3 times and the issue on imx1060 haven't reoccured

Through the night I run the CI 2 more times still no errors

@badochov badochov merged commit 86334a3 into master Jan 27, 2024
30 checks passed
@badochov badochov deleted the badochov/init branch January 27, 2024 14:38
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.

3 participants