From f94101afd57014e4af3a306255a4a34cb8c21215 Mon Sep 17 00:00:00 2001 From: Dmitry Ilyin <6576495+widgetii@users.noreply.github.com> Date: Sun, 17 May 2026 20:33:08 +0300 Subject: [PATCH] toolchain: mirror hi3516cv100 MPP headers into hisilicon SDK tarballs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Hisilicon vendor SDKs for hi3520dv200, hi3516av100, hi3516cv200, hi3516cv300, hi3516cv500, hi3516ev200, hi3519v101, hi3536dv100 ship their binary blobs (`kmod/`, `lib/`, `script/`) under `general/package/hisilicon-osdrv-/files/` but none of them include the `include/` headers needed to compile MPP userspace code against `libmpi.so`. Only `hisilicon-osdrv-hi3516cv100/files/include/` carries the canonical Hisilicon MPP header set (62 files: `hi_type.h`, `hi_comm_sys.h`, `mpi_sys.h`, `hifb.h`, …), and that set is ABI-compatible across the family — the literal `/***** 3520 ADDed *****/` comment block in `hi_comm_vo.h` confirms 3520 compatibility patches were applied to it upstream. Consequence today: applications built against the downloaded `toolchain.hisilicon-.tgz` (e.g. hifb-using utilities, OSD helpers, video pipeline daemons targeting Hisilicon SoCs other than hi3516cv100) must each bundle their own copy of the cv100 headers. We hit this when prototyping an `hifb_demo` for hi3520dv200 — ~20 headers had to be carried inside the package source tree. Extend `BUNDLE_SDK` to mirror the cv100 header set into `sdk/include/` whenever the target is a Hisilicon board that doesn't already ship its own `include/` directory. Strictly additive: cv100 itself is unaffected (its own `include/` is copied by the existing `cp -a $OSDRV_DIR/*`), non-hisilicon boards are unaffected, and the new copy is a no-op if `hi3516cv100/files/include/` is ever removed. After this lands, the published `toolchain.hisilicon-hi3520dv200.tgz` (and siblings) will have `/sdk/include/hi_type.h` etc. so a downstream consumer can `-I$(SDK)/sdk/include -L$(SDK)/sdk/lib -lmpi` without copying any headers around. Co-Authored-By: Claude Opus 4.7 (1M context) --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile b/Makefile index c9f84f8251..088dfc24ac 100644 --- a/Makefile +++ b/Makefile @@ -117,6 +117,7 @@ endif define BUNDLE_SDK OSDRV_DIR=$(PWD)/general/package/$(BR2_OPENIPC_SOC_VENDOR)-osdrv-$(BR2_OPENIPC_SOC_FAMILY)/files; \ + MPP_HEADERS=$(PWD)/general/package/hisilicon-osdrv-hi3516cv100/files/include; \ SDK_TGZ=$$(find $(TARGET)/images -name '*_sdk-buildroot.tar.gz' | head -1); \ COMPAT_SRC=$(PWD)/general/package/uclibc-compat/src/uclibc-compat.c; \ SDK_CC=$$(ls $(TARGET)/host/bin/*-gcc 2>/dev/null | head -1); \ @@ -124,6 +125,10 @@ define BUNDLE_SDK SDK_TOP=$$(tar tzf $$SDK_TGZ | head -1 | cut -d/ -f1); \ rm -rf /tmp/sdk-overlay && mkdir -p /tmp/sdk-overlay/$$SDK_TOP/sdk; \ cp -a $$OSDRV_DIR/* /tmp/sdk-overlay/$$SDK_TOP/sdk/; \ + if [ "$(BR2_OPENIPC_SOC_VENDOR)" = "hisilicon" ] && [ ! -d "$$OSDRV_DIR/include" ] && [ -d "$$MPP_HEADERS" ]; then \ + mkdir -p /tmp/sdk-overlay/$$SDK_TOP/sdk/include; \ + cp -a $$MPP_HEADERS/. /tmp/sdk-overlay/$$SDK_TOP/sdk/include/; \ + fi; \ if [ -f "$$COMPAT_SRC" ] && [ -n "$$SDK_CC" ]; then \ $$SDK_CC -shared -Wall -O2 -fPIC \ -o /tmp/sdk-overlay/$$SDK_TOP/sdk/lib/libuclibc-compat.so \