raulcxw opened a new pull request, #19352:
URL: https://github.com/apache/nuttx/pull/19352
arch/arm/ameba: fix per-IC asdk toolchain selection and fwlib archive hygiene
## Summary
* Why: RTL8720F failed to link (`arm-none-eabi-ld: __romlib_bss_end__ is
changed`), and the fwlib archive could pick up stale objects.
* The asdk (arm-none-eabi) toolchain version is declared per SoC-project
(`component/soc/<soc>/project/CMakeLists.txt: v_ASDK_VER`), which
overrides
the top-level `cmake/global_define.cmake` default. The RTL8720F
project pins
12.3.1 while the amebadplus (RTL8721Dx) subtree default is 10.3.1.
`toolchain.mk` and `ameba_fetch_toolchain.sh` only read the top-level
default, so RTL8720F was linked with the wrong `ld` and tripped the SDK
ROM-overlay assert. Now the per-SoC CMakeLists is read first (via
`AMEBA_SOC_NAME`), falling back to the global default.
* `libameba_fwlib.a` / `libameba_wifi.a` are now archived from the
explicit
object list derived from `AMEBA_FWLIB_SRCS` / `AMEBA_WIFI_SRCS`
instead of a
`fwlib_obj/*.o` wildcard. `distclean` does not clean the gitignored
prebuilt
object dir, so a stale object left from an earlier source list (e.g.
`log.o`,
whose `.bss` is ROM-resident) was silently re-archived and dragged
into the
link. The archive is removed before rebuilding so it never accumulates.
## Impact
* Is new feature added / existing changed? NO (build-system fix only).
* Impact on user? NO.
* Impact on build? YES — RTL8720F now links; RTL8721Dx build is
unaffected
(it already resolved 10.3.1, which is now selected explicitly per-SoC).
* Impact on hardware? NO logic change; affects arch/arm/ameba build only.
* Impact on documentation? NO.
* Impact on security? NO.
* Impact on compatibility? NO (self-contained to arch/arm/ameba).
## Testing
Build Host: Ubuntu (WSL2), x86_64; Realtek asdk arm-none-eabi-gcc
auto-fetched
by the board build (10.3.1 for RTL8721Dx, 12.3.1 for RTL8720F).
Targets: `pke8721daf:nsh` (RTL8721Dx), `rtl8720f_evb:nsh` (RTL8720F).
Testing logs before change:
```
# rtl8720f_evb:nsh
LD: nuttx
arm-none-eabi-ld: __romlib_bss_end__ is changed. Common bss of rom_lib
and
rom_tz may be modified illegally.
make[1]: *** [Makefile:230: nuttx] Error 1
```
Testing logs after change:
```
# rtl8720f_evb:nsh -> asdk-12.3.1-4600 selected, links clean
PACK: wrote {app.bin, boot.bin, km4ns_image2_all.bin}
# pke8721daf:nsh -> asdk-10.3.1-4602, unaffected
PACK: wrote {app.bin, boot.bin, km0_image2_all.bin}
# both images boot to NSH on hardware (see WiFi PR for boot logs).
```
## PR verification Self-Check
* [x] This PR introduces only one functional change (build-system fix).
* [x] I have updated all required description fields above.
* [x] My PR adheres to Contributing Guidelines (commit title/message,
coding
standard).
* [ ] My PR is still work in progress (not ready for review).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]