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

Tarfind isn't portable due to assuming struct layout #186

Open
widlarizer opened this issue Nov 7, 2023 · 3 comments
Open

Tarfind isn't portable due to assuming struct layout #186

widlarizer opened this issue Nov 7, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@widlarizer
Copy link

/* 8995 = sizeof(tar_header_t) * ARCHIVE_FILES */ followed by a hard-coded 8995 demonstrates that the source assumes the amount of padding an ABI will do. For Infineon TriCore, this does not hold. EABI v1.3 says: "To facilitate copy operations, any structure larger than 1 Byte must have a minimum 2 Byte alignment, even if its only members are byte elements.".

@PaoloS02
Copy link
Contributor

PaoloS02 commented Mar 4, 2024

Thanks for this. I'll mark this as a bug until we are able to verify it, but it seems that what you are describing is indeed a limitation to portability.

@PaoloS02 PaoloS02 self-assigned this Mar 4, 2024
@PaoloS02 PaoloS02 added the bug Something isn't working label Mar 4, 2024
@jeremybennett
Copy link
Collaborator

Add @I-mikan-I since this may be relevant to Embench IoT 2.0

@I-mikan-I
Copy link
Contributor

Seems to be the case, 8bec9db fixes this by simply calculating the size in a macro, and also using c11 alignment specifiers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants