arch/arm/ameba: fix per-IC asdk toolchain selection and fwlib archive hygiene#19352
Open
raulcxw wants to merge 1 commit into
Open
arch/arm/ameba: fix per-IC asdk toolchain selection and fwlib archive hygiene#19352raulcxw wants to merge 1 commit into
raulcxw wants to merge 1 commit into
Conversation
4471548 to
ba6ae60
Compare
xiaoxiang781216
previously approved these changes
Jul 6, 2026
… hygiene Two independent Ameba build-system fixes: 1. Per-IC asdk (arm-none-eabi) toolchain selection. The 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 declares 12.3.1 while the amebadplus (RTL8721Dx) subtree default is 10.3.1, but toolchain.mk and ameba_fetch_toolchain.sh only read the top-level default, so RTL8720F was built with the wrong toolchain (10.3.1 instead of its declared 12.3.1). Read the per-SoC CMakeLists first (via AMEBA_SOC_NAME), falling back to the global default. Also resolve the toolchain archive name from the SDK cmake's TOOLCHAINNAME instead of hardcoding it: the name differs per version (asdk-12.3.1 drops the "_with_small_reent" suffix asdk-10.3.1 uses), so the hardcoded name 404s when fetching 12.3.1. 2. fwlib/wifi archive hygiene. libameba_fwlib.a / libameba_wifi.a were archived with a fwlib_obj/*.o wildcard, but distclean does not clean the gitignored prebuilt object dir. On an incremental build after the source list changed, a stale object left behind (e.g. log.o, whose .bss is ROM-resident) was silently re-archived and dragged into the link, tripping the SDK ROM-overlay assert (__romlib_bss_end__ is changed). A clean build is unaffected. Archive only the explicit object list derived from AMEBA_FWLIB_SRCS / AMEBA_WIFI_SRCS, and remove the archive before rebuilding so it never accumulates. Signed-off-by: raul_chen <raul_chen@realsil.com.cn>
ba6ae60 to
3a06ddf
Compare
xiaoxiang781216
approved these changes
Jul 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two independent Ameba build-system fixes:
Per-IC asdk toolchain selection. The asdk (arm-none-eabi) toolchain
version is declared per SoC-project (
component/soc/<soc>/project/CMakeLists.txt: v_ASDK_VER), overriding the top-levelcmake/global_define.cmakedefault. TheRTL8720F project declares 12.3.1 while the amebadplus (RTL8721Dx) subtree
default is 10.3.1, but
toolchain.mk/ameba_fetch_toolchain.shonly read thetop-level default, so RTL8720F was built with the wrong toolchain (10.3.1
instead of its declared 12.3.1). Now the per-SoC CMakeLists is read first (via
AMEBA_SOC_NAME), falling back to the global default.fwlib/wifi archive hygiene.
libameba_fwlib.a/libameba_wifi.awerearchived with a
fwlib_obj/*.owildcard, butdistcleandoes not clean thegitignored prebuilt object dir. On an incremental build after the source list
changed, a stale object (e.g.
log.o, whose.bssis ROM-resident) wassilently re-archived and dragged into the link, tripping the SDK ROM-overlay
assert (
__romlib_bss_end__ is changed). A clean build is unaffected. Now onlythe explicit object list from
AMEBA_FWLIB_SRCS/AMEBA_WIFI_SRCSisarchived, and the archive is removed before rebuilding so it never accumulates.
Impact
incremental builds no longer trip the ROM-overlay assert from a stale object.
RTL8721Dx is unaffected (10.3.1, now selected explicitly per-SoC).
Testing
Build Host: Ubuntu (WSL2), x86_64; Realtek asdk arm-none-eabi-gcc auto-fetched by
the board build.
Targets:
pke8721daf:nsh(RTL8721Dx),rtl8720f_evb:nsh(RTL8720F).Before change — incremental RTL8720F build with a stale prebuilt object:
After change — both boards build clean; RTL8720F now selects asdk-12.3.1:
Both images boot to NSH on hardware (boot/iperf logs in the WiFi PR).
PR verification Self-Check