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

build_system/xfa: change API to fix alignment [backport 2024.10] #21088

Conversation

maribu
Copy link
Member

@maribu maribu commented Dec 15, 2024

Backport of #20960

Contribution description

This changes the API of xfa from

XFA(array_name, prio) type element_name = INITIALIZER;

to

XFA(type, array_name, prio) element_name = INITIALIZER;

this allows forcing natural alignment of the type, fixing failing tests
on native64.

Testing procedure

The tests from #20959 is included here. It should now pass.

Issues/PRs references

Includes #20959

This increases the test coverage for XFA:

- Multiple entries are added from a single file
- Priorities are assigned to enforce a given order
- The size of the `struct` to add is changed to no longer be a power of
  2

(cherry picked from commit 2839224)
This changes the API of xfa from

    XFA(array_name, prio) type element_name = INITIALIZER;

to

    XFA(type, array_name, prio) element_name = INITIALIZER;

this allows forcing natural alignment of the type, fixing failing tests
on `native64`.

(cherry picked from commit 2b6f65a)
@maribu maribu added the Area: core Area: RIOT kernel. Handle PRs marked with this with care! label Dec 15, 2024
@maribu maribu requested a review from miri64 as a code owner December 15, 2024 07:43
@maribu maribu added Area: cpu Area: CPU/MCU ports Area: drivers Area: Device drivers Area: examples Area: Example Applications labels Dec 15, 2024
@maribu maribu added the Area: network Area: Networking label Dec 15, 2024
@maribu maribu requested a review from aabadie as a code owner December 15, 2024 07:43
@maribu maribu added Area: OTA Area: Over-the-air updates Area: sys Area: System labels Dec 15, 2024
@maribu maribu added the Area: tests Area: tests and testing framework label Dec 15, 2024
@maribu maribu requested a review from kaspar030 as a code owner December 15, 2024 07:43
@maribu maribu added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ARM Platform: This PR/issue effects ARM-based platforms labels Dec 15, 2024
@maribu maribu requested a review from bergzand as a code owner December 15, 2024 07:43
@maribu maribu added the Platform: ESP Platform: This PR/issue effects ESP-based platforms label Dec 15, 2024
@maribu maribu requested a review from vincent-d as a code owner December 15, 2024 07:43
@maribu maribu added Process: API change Integration Process: PR contains or issue proposes an API change. Should be handled with care. Process: release backport Integration Process: The PR is a release backport of a change previously provided to master labels Dec 15, 2024
@maribu maribu requested a review from gschorcht as a code owner December 15, 2024 07:43
@maribu maribu added the Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) label Dec 15, 2024
@maribu maribu requested a review from benpicco December 15, 2024 07:43
@maribu
Copy link
Member Author

maribu commented Dec 15, 2024

Backporting an API change would be a first I think. However, I see no other way of fixing the segfault in examples/nanocoap_server on native64 due to misaligned CoAP resources XFA elements.

@riot-ci
Copy link

riot-ci commented Dec 15, 2024

Murdock results

✔️ PASSED

1f957ef build_system/xfa: change API to fix alignment

Success Failures Total Runtime
10215 0 10215 20m:20s

Artifacts

@benpicco benpicco added this pull request to the merge queue Dec 15, 2024
@benpicco
Copy link
Contributor

It's just an internal API and if things work correctly, users shouldn't even notice the change - only when they hit the alignment bug, and this one fixes that.

Merged via the queue into RIOT-OS:2024.10-branch with commit ee012b6 Dec 15, 2024
40 checks passed
@maribu maribu deleted the backport/2024.10/build_system/xfa/fix-alignment branch December 15, 2024 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: core Area: RIOT kernel. Handle PRs marked with this with care! Area: cpu Area: CPU/MCU ports Area: drivers Area: Device drivers Area: examples Area: Example Applications Area: network Area: Networking Area: OTA Area: Over-the-air updates Area: sys Area: System Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ARM Platform: This PR/issue effects ARM-based platforms Platform: ESP Platform: This PR/issue effects ESP-based platforms Process: API change Integration Process: PR contains or issue proposes an API change. Should be handled with care. Process: release backport Integration Process: The PR is a release backport of a change previously provided to master Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants