Fixes buildpath issues when compiling rust-out-of-tree recipe.
Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
# More details in: https://lists.openembedded.org/g/openembedded-core/message/229336
# Disable ccache for kernel build if kernel rust support is enabled to workaround this
CCACHE_DISABLE ?= "${@bb.utils.contains('KERNEL_RUST_SUPPORT', 'True', '1', '0', d)}"
+
+#Fixes buildpath issues when compiling rust-out-of-tree module
+RUST_DEBUG_REMAP ?= "--remap-path-prefix=${TMPDIR}/work-shared=${TARGET_DBGSRC_DIR} \
+ --remap-path-prefix=${TMPDIR}/work=${TARGET_DBGSRC_DIR} \
+"
+KRUSTFLAGS = " ${RUST_DEBUG_REMAP}"
+EXTRA_OEMAKE:append = ' KRUSTFLAGS="${KRUSTFLAGS}"'