gk7102: BR2_TARGET_OPTIMIZATION=-mno-unaligned-access - #2260
Conversation
Avoid ARMv6 userspace corruption from unaligned LDR/STR on GK7102/GK7102S. Co-authored-by: Cursor <cursoragent@cursor.com>
PR Summary by Qodogk7102: disable unaligned accesses via BR2_TARGET_OPTIMIZATION
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo
1. Optimization flags clobbered
|
| BR2_arm1176jzf_s=y | ||
| BR2_ARM_EABI=y | ||
|
|
||
| BR2_TARGET_OPTIMIZATION="-mno-unaligned-access" |
There was a problem hiding this comment.
1. Optimization flags clobbered 🐞 Bug ➹ Performance
BR2_TARGET_OPTIMIZATION is set to only -mno-unaligned-access in the GK7102 lite defconfigs, which drops any explicit -O* optimization level from the target CFLAGS. Packages that consume $(TARGET_CFLAGS) (e.g., ffmpeg-openipc) may then compile without the intended size/performance optimizations, inflating binaries and slowing runtime.
Agent Prompt
## Issue description
`BR2_TARGET_OPTIMIZATION` is being overwritten with only `-mno-unaligned-access`, which can remove the intended optimization level (e.g., `-Os`) for this target.
## Issue Context
This repo enables size optimization globally via `BR2_OPTIMIZE_S=y`, and several packages (e.g., ffmpeg-openipc) use `$(TARGET_CFLAGS)` directly, so the target optimization string should still include an `-O*` flag.
## Fix Focus Areas
- br-ext-chip-goke/configs/gk7102_lite_defconfig[1-8]
- br-ext-chip-goke/configs/gk7102s_lite_defconfig[1-8]
## Suggested change
Update both defconfigs to *include* the normal optimization flags plus `-mno-unaligned-access` (example: `BR2_TARGET_OPTIMIZATION="-Os -pipe -mno-unaligned-access"`), matching the project’s intended optimization mode while still preventing unaligned accesses.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
|
Closing this since no reply |
Summary
BR2_TARGET_OPTIMIZATION=\"-mno-unaligned-access\"ongk7102_liteandgk7102s_liteto avoid ARMv6 userspace corruption from unaligned accesses.Test plan
-mno-unaligned-accessPart of splitting #2256.
Made with Cursor