Bug 16069

Summary: Compiled kernel out-of-tree modules contain relative paths from $S to $KERNEL_SRC (also impact non-modules packages)
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Yoann Congal <yoann.congal>
Component: kernelAssignee: Richard Purdie <richard.purdie>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: High CC: randy.macleod, ross.burton, skandigraun, yoann.congal
Version: unspecified   
Target Milestone: 5.3 M4   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Yoann Congal 2025-11-19 00:11:37 UTC
To reproduce, with the meta-skeleton enabled and without rm_work:

 $ bitbake hello-mod
 $ strings tmp/work/qemux86_64-poky-linux/hello-mod/0.1/image/lib/modules/6.16.11-yocto-standard/updates/hello.ko |grep 'work-shared' |sort -u
../../../../../work-shared/qemux86-64/kernel-source/arch/x86/include/asm
../../../../../work-shared/qemux86-64/kernel-source/include/asm-generic
../../../../../work-shared/qemux86-64/kernel-source/include/linux
../../../../../work-shared/qemux86-64/kernel-source/include/linux/atomic
../../../../../work-shared/qemux86-64/kernel-source/include/linux/sched
../../../../../work-shared/qemux86-64/kernel-source/include/uapi/asm-generic
../../../../../work-shared/qemux86-64/kernel-source/include/uapi/linux
../../../../../work-shared/qemux86-64/kernel-source/include/vdso
../../../../../work-shared/qemux86-64/kernel-source/scripts
../../../../../work-shared/qemux86-64/kernel-source/scripts/module-common.c

Note: "../../../../../work-shared/qemux86-64/kernel-source/" is the relative path from $S to $KERNEL_SRC

That come from hello.ko having debug paths like "/usr/src/debug/hello-mod/0.1/../../../../../work-shared/qemux86-64/kernel-source/include/linux/sched.h" (which are wrong)

debugsources.list is also wrong:
 $ cat tmp/work/qemux86_64-poky-linux/hello-mod/0.1/debugsources.list |tr '\0' '\n' |grep work-shared |sort -u |head
/work-shared/qemux86-64/kernel-source/arch/x86/include/asm/asm.h
/work-shared/qemux86-64/kernel-source/arch/x86/include/asm/desc_defs.h
/work-shared/qemux86-64/kernel-source/arch/x86/include/asm/extable.h
/work-shared/qemux86-64/kernel-source/arch/x86/include/asm/mmu.h
/work-shared/qemux86-64/kernel-source/arch/x86/include/asm/module.h
/work-shared/qemux86-64/kernel-source/arch/x86/include/asm/pgtable_64_types.h
/work-shared/qemux86-64/kernel-source/arch/x86/include/asm/pgtable_types.h
/work-shared/qemux86-64/kernel-source/arch/x86/include/asm/processor.h
/work-shared/qemux86-64/kernel-source/arch/x86/include/asm/signal.h
/work-shared/qemux86-64/kernel-source/arch/x86/include/asm/thread_info.h
Comment 1 Yoann Congal 2025-11-19 10:42:09 UTC
This patch looks related: [PATCH] bitbake.conf: add canon-prefix-map to DEBUG_PREFIX_MAP
https://lists.openembedded.org/g/openembedded-core/message/226545
Comment 2 Yoann Congal 2025-11-19 11:08:14 UTC
Just tested, this patch does fix this bug : [PATCH] bitbake.conf: add canon-prefix-map to DEBUG_PREFIX_MAP
https://lists.openembedded.org/g/openembedded-core/message/226545
Comment 3 Randy MacLeod 2025-11-20 15:42:43 UTC
Not a release blocker. We might back-port a fix.
Comment 4 Randy MacLeod 2025-11-20 15:48:02 UTC
My bad, this IS a release blocker for 5.3-M4.
Comment 5 Yoann Congal 2025-11-20 15:49:58 UTC
New patch iteration:
[PATCH 0/2] -fcanon-file-prefix and cc-rs compiler flag mixing
https://lists.openembedded.org/g/openembedded-core/message/226617
[PATCH 1/2] bitbake.conf, gcc toolchain: add -fcanon-prefix-map to map-prefixes
https://lists.openembedded.org/g/openembedded-core/message/226618
[PATCH 2/2] rust-common.bbclass: filter out incorrect compiler flags in wrapper
https://lists.openembedded.org/g/openembedded-core/message/226619
Comment 6 Yoann Congal 2025-11-20 16:12:29 UTC
Added a note to the title to show that this impacts packages more generally than "just" out-of-tree kernel modules.