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

Add code to verify struct offsets and sizes used in .asm files #7226

Open
egrimley-arm opened this issue Jan 27, 2025 · 1 comment
Open

Add code to verify struct offsets and sizes used in .asm files #7226

egrimley-arm opened this issue Jan 27, 2025 · 1 comment

Comments

@egrimley-arm
Copy link
Contributor

egrimley-arm commented Jan 27, 2025

This was done for Arm architectures by #7202. The same should be done for other architectures.

egrimley-arm added a commit that referenced this issue Jan 27, 2025
The macros are defined in asm_offsetsx.h and the values are checked at
compile time by asm_offsets.c.

A few other changes were needed to make this work:

+ Some declarations are moved from mangle.c into a new file
mangle_aarch64.h.

+ A declaration is moved from module_elf.c to module_private.h.

Issue: #7226
@derekbruening
Copy link
Contributor

The arch.c code that checks some of these presumably would be removed after x86 support is added, right?

jackgallagher-arm added a commit that referenced this issue Jan 30, 2025
Fixes a compile error for Android64 introduced by #7202
(commit 2f2614b):
```
core/arch/aarch64/asm_offsetsx.h:85:1: error: offsetof of incomplete type 'struct tlsdesc_t'
   85 | OFFSET(struct tlsdesc_t, arg, 8)
      | ^      ~~~~~~
```

`tlsdesc_t` is not defined on Android.

Issues: #2154, #7226
jackgallagher-arm added a commit that referenced this issue Jan 31, 2025
Fixes a compile error for Android64 introduced by #7202 (commit
2f2614b):
```
core/arch/aarch64/asm_offsetsx.h:85:1: error: offsetof of incomplete type 'struct tlsdesc_t'
   85 | OFFSET(struct tlsdesc_t, arg, 8)
      | ^      ~~~~~~
```

`tlsdesc_t` is not defined on Android.

Issues: #2154, #7226
derekbruening added a commit that referenced this issue Feb 11, 2025
Solves a missing header issue that results in a build error on Mac M1
with the new asm offset files from PR #7202: module.h has to be
included before module_private.h so we explicitly include the former
in the latter.

Issue: #7226
derekbruening added a commit that referenced this issue Feb 11, 2025
Solves a missing header issue that results in a build error on Mac M1
with the new asm offset files from PR #7202: module.h has to be included
before module_private.h so we explicitly include the former in the
latter. Tested locally on M1 Mac.

Issue: #7226
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants