toolchain-asan: offer hisilicon-hi3516ev200, proven on an ev300 - #2356
Merged
Conversation
The stock OpenIPC musl toolchains carry no sanitizer runtime, so ASan was unavailable on every HiSilicon V4 board — which is most of the fleet. Building one locally works, and the entry here is what saves everyone else from doing it. Proven the way the comment above the list demands, not merely built: built with `make BOARD=hi3516ev300_lite toolchain-asan`, checked with general/scripts/verify-asan-toolchain.sh (9 libsanitizer patches applied for gcc 13.3.0, libasan.so.8 at 1 001 712 bytes, the compiler links -fsanitize=address), then `scripts/asan.sh smoke` in the majestic repo against the lab hi3516ev300-imx335 — where the planted out-of-bounds read, out-of-bounds write and 81-byte leak are all reported, symbolised to file and line on the target, with all three suspended threads read correctly. One trap for whoever builds this by hand on a current distro: a host GCC 16 cannot build gcc 13.3.0. Its C++ default of 202002L breaks libcody on `u8""` being const char8_t*, and pinning HOST_CXXFLAGS to gnu++17 instead trips libcody's own probe, which demands __cplusplus <= 201103. Build it with HOSTCC=gcc-11 HOSTCXX=g++-11, which is what this runner has anyway. The detail is in majestic's docs/asan.md, beside the rest of the recipe.
widgetii
requested review from
cronyx,
flyrouter and
viktorxda
as code owners
September 2, 2026 08:01
PR Summary by QodoEnable HiSilicon V4 ASan toolchain builds
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can turn on the rule miner and Qodo learns your standards from review history |
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.
The stock OpenIPC musl toolchains carry no sanitizer runtime, so
scripts/asan.shin the majestic repo stops at "no libasan.so.* in the hi3516ev200 toolchain sysroot" on every HiSilicon V4 board — which is most of the fleet. Building one locally works; this entry is what saves everyone else from doing it.Proven, not merely built
The comment above the choice list asks for end-to-end proof on real hardware before a family is listed, so:
make BOARD=hi3516ev300_lite toolchain-asangeneral/scripts/verify-asan-toolchain.sh— 9 libsanitizer patches applied for gcc 13.3.0,libasan.so.8present at 1 001 712 bytes, the compiler links-fsanitize=addressscripts/asan.sh smoke(majestic) against a labhi3516ev300-imx335:All three planted controls are reported — out-of-bounds read, out-of-bounds write, and an 81-byte leak — symbolised to file and line on the target with no symbolizer installed there. The suspended-thread check matters because that is the mips failure mode the harness exists to catch.
musl's
libasanis smaller than glibc's (1 001 712 vs 1 366 764 bytes); the extra cost islibstdc++.so.6, which a musl rootfs does not ship anddeploysends automatically.The ev300 defconfig is not a typo
V4 boards share one toolchain and
make toolnamenames it after the family, sohi3516ev300_liteyieldstoolchain.hisilicon-hi3516ev200. The existing guard in this job (test "${NAME}" = "toolchain.${{inputs.family}}") is what would catch that if it ever stopped holding; a comment says so at the mapping.One trap for anyone building this by hand
A host GCC 16 cannot build gcc 13.3.0. Its C++ default of
202002Lbreakslibcody/client.cconu8""beingconst char8_t*, and pinningHOST_CXXFLAGS="-O2 -std=gnu++17"to fix that trips libcody's own configure probe, which compiles#if __cplusplus > 201103 / #errorand demands the opposite. Buildroot also strips-std=out ofHOST_CXXFLAGSon purpose (filter-out -std=%inpackage/Makefile.in), so a-std=inHOST_CFLAGSnever reaches C++ anyway.Build it with
HOSTCC=gcc-11 HOSTCXX=g++-11— which is what this runner has, so it is matching CI rather than working around it. Nothing about the resulting toolchain differs. The detail is recorded in majestic'sdocs/asan.mdbeside the rest of the recipe.Not included
hi3516av100shares the stocktoolchain.hisilicon-hi3516ev200and would share this one, but gets no entry: the list records the boardsmokeran on, and borrowing a sibling's proof is the one thing it is there to prevent.After merge
The artefact still has to be published — dispatch this workflow with
family: hisilicon-hi3516ev200. The companion majestic change (theDL_ASANline, the docs table row and the host-compiler note) is onasan/hi3516ev200there and should land alongside.