]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
libclc: Fix absolute symlinks in sysroot
authorKhem Raj <raj.khem@gmail.com>
Wed, 30 Jul 2025 04:38:08 +0000 (21:38 -0700)
committerMathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Wed, 30 Jul 2025 09:53:45 +0000 (11:53 +0200)
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 <raj.khem@gmail.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
meta/recipes-devtools/clang/libclc_git.bb

index ed31de503ae2538ee2a157ef8b88b4eaaac5397c..e508959791e1a59fb6977b0412475834e1cc429d 100644 (file)
@@ -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() {