From: Khem Raj Date: Wed, 30 Jul 2025 04:38:08 +0000 (-0700) Subject: libclc: Fix absolute symlinks in sysroot X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=277ae664bc0034d4e8d6ee3e95396eaf760be5b2;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git libclc: Fix absolute symlinks in sysroot This helps in creating relative symlinks Fixes sstate errors e.g. ERROR: sstate found an absolute path symlink /home/khem/yoe/build/tmp/work/aarch64-linux/libclc-native/21.1.0/sysroot-destdir/home/khem/yoe/build/tmp/work/aarch64-linux/libclc-native/21.1.0/recipe-sysroot-native/usr/share/clc/gfx90c-amdgcn-mesa-mesa3d.bc pointing at /home/khem/yoe/build/tmp/work/aarch64-linux/libclc-native/21.1.0/build/tahiti-amdgcn-mesa-mesa3d.bc. Please replace this with a relative link. Signed-off-by: Khem Raj Signed-off-by: Mathieu Dubois-Briand --- diff --git a/meta/recipes-devtools/clang/libclc_git.bb b/meta/recipes-devtools/clang/libclc_git.bb index ed31de503a..e508959791 100644 --- a/meta/recipes-devtools/clang/libclc_git.bb +++ b/meta/recipes-devtools/clang/libclc_git.bb @@ -24,6 +24,21 @@ LIBCLC_TARGETS ?= "all" EXTRA_OECMAKE = "-DLIBCLC_TARGETS_TO_BUILD=${LIBCLC_TARGETS} \ -DPREPARE_BUILTINS=${B_NATIVE}/prepare_builtins" +do_install:append() { + # Convert absolute symlinks to relative ones (same directory) + cd ${D} + find . -type l | while read link; do + target=$(readlink "$link") + case "$target" in + /*) + # Extract filename and point to current directory + target_basename=$(basename "$target") + ln -sf "$target_basename" "$link" + ;; + esac + done +} + # Need to build a native prepare_builtins binary in target builds. The easiest # way to do this is with a second native cmake build tree. do_build_prepare_builtins() {