From: Jamin Lin <jamin_lin@aspeedtech.com>
To: <yocto-patches@lists.yoctoproject.org>
Cc: <troy_lee@aspeedtech.com>, <vince_chang@aspeedtech.com>,
<jamin_lin@aspeedtech.com>
Subject: [meta-zephyr][PATCH v1] zephyr-sdk: replace pre-built host tool of zephyr-sdk with Native packages
Date: Thu, 19 Dec 2024 10:20:36 +0800 [thread overview]
Message-ID: <20241219022036.561047-1-jamin_lin@aspeedtech.com> (raw)
It installed pre-built host tool of zephyr-sdk into build environment at the
host side. However, the pre-built host tool of zephyr-sdk linked the
"ld-linux-x86-64.so.2" from the hardcode SDK installation path.
Used "ldd recipe-sysroot-native/usr/zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/dtc"
command to show the linker information of pre-built dtc tool.
```
/XXX/build/tmp/work/x86_64-linux/zephyr-sdk-native/0.16.9/XXX/build/tmp/work/x86_64-linux/zephyr-sdk-native/0.16.9/recipe-sysroot-native/usr/zephyr-sdk/sysroots/x86_64-pokysdk-linux/lib/ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2
```
The pre-built host dtc tool linked "${D}${ZEPHYR_SDK_DIR}/recipe-sysroot-native/usr/zephyr-sdk/sysroots/x86_64-pokysdk-linux/lib/ld-linux-x86-64.so.2"
However, the hardcode link path causes the pre-built host tools cannot be
executed if users set sstate-cache build.
How to reproduce it:
1. Setup a new build environment A and build zephyr image by "bitbake zephyr-helloworld"
2. Save and copy the "build/sstate-cache" directory to ${HOME} directory.
3. Remove a completely build environment A.
4. Setup a new build environment B and set SSTATE_DIR variable to "${HOME}/sstate-cache".
5. Build zephyr image by "bitbake zephyr-helloworld". The pre-built host tool
from zephyr-sdk cannot be executed.
```
./recipe-sysroot-native/usr/zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/dtc -h
No such file or directory
```
To fix it, replace pre-built host tool of zephyr-sdk with Yocto Native packages.
Append "dtc-natvie" in the DEPENDS variable in zephyr-kernel-common.inc.
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
---
.../recipes-devtools/zephyr-sdk/zephyr-sdk_0.16.9.bb | 3 ---
.../recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc | 2 +-
2 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/meta-zephyr-core/recipes-devtools/zephyr-sdk/zephyr-sdk_0.16.9.bb b/meta-zephyr-core/recipes-devtools/zephyr-sdk/zephyr-sdk_0.16.9.bb
index 57fe777..3d9e628 100644
--- a/meta-zephyr-core/recipes-devtools/zephyr-sdk/zephyr-sdk_0.16.9.bb
+++ b/meta-zephyr-core/recipes-devtools/zephyr-sdk/zephyr-sdk_0.16.9.bb
@@ -28,9 +28,6 @@ ZEPHYR_SDK_DIR = "${prefix}/zephyr-sdk"
do_install() {
install -d ${D}${prefix}
cp -r ${UNPACKDIR}/zephyr-sdk-${PV} ${D}${ZEPHYR_SDK_DIR}
-
- # Install host tools
- ${D}${ZEPHYR_SDK_DIR}/setup.sh -h
}
SYSROOT_DIRS += "${ZEPHYR_SDK_DIR}"
diff --git a/meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc b/meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc
index 6544475..77d1cfa 100644
--- a/meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc
+++ b/meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc
@@ -29,7 +29,7 @@ EXTRA_OECMAKE:append = " -DZEPHYR_EXTRA_MODULES=${ZEPHYR_EXTRA_MODULES}"
export ZEPHYR_BASE="${S}/zephyr"
-DEPENDS += "gperf-native"
+DEPENDS += "gperf-native dtc-native"
DEPENDS:append:qemuall = " qemu-native qemu-helper-native"
--
2.25.1
reply other threads:[~2024-12-19 2:20 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241219022036.561047-1-jamin_lin@aspeedtech.com \
--to=jamin_lin@aspeedtech.com \
--cc=troy_lee@aspeedtech.com \
--cc=vince_chang@aspeedtech.com \
--cc=yocto-patches@lists.yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.