All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-zephyr][PATCH v1] zephyr-sdk: replace pre-built host tool of zephyr-sdk with Native packages
@ 2024-12-19  2:20 Jamin Lin
  0 siblings, 0 replies; only message in thread
From: Jamin Lin @ 2024-12-19  2:20 UTC (permalink / raw)
  To: yocto-patches; +Cc: troy_lee, vince_chang, jamin_lin

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



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-12-19  2:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-19  2:20 [meta-zephyr][PATCH v1] zephyr-sdk: replace pre-built host tool of zephyr-sdk with Native packages Jamin Lin

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.