Bug 15878

Summary: linux-yocto does not build for qemuriscv32
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Khem Raj <raj.khem>
Component: kernelAssignee: Unassigned <unassigned>
Status: NEW --- QA Contact:
Severity: normal    
Priority: Low CC: randy.macleod, tgamblin
Version: 5.3   
Target Milestone: 6.1   
Hardware: Other   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Bug Depends on:    
Bug Blocks: 15433    

Description Khem Raj 2025-05-25 05:24:57 UTC
kernel does not build currently when debug info is enabled for kernel during build. It ends up with modpost failing with errors like 

WARNING: modpost: vmlinux: section mismatch in reference: bstr_printf+0x2c0 (section: .text) -> init_dynamic_event (section: .init.text)
WARNING: modpost: vmlinux: section mismatch in reference: bstr_printf+0x332 (section: .text) -> init_dynamic_event (section: .init.text)
WARNING: modpost: vmlinux: section mismatch in reference: bstr_printf+0x366 (section: .text) -> init_dynamic_event (section: .init.text)
WARNING: modpost: vmlinux: section mismatch in reference: bstr_printf+0x3ee (section: .text) -> init_dynamic_event (section: .init.text)
ERROR: modpost: vmlinux: local symbol 'system_state' was exported
ERROR: modpost: vmlinux: local symbol 'static_key_initialized' was exported
ERROR: modpost: vmlinux: local symbol 'reset_devices' was exported
ERROR: modpost: vmlinux: local symbol 'loops_per_jiffy' was exported
ERROR: modpost: vmlinux: local symbol 'init_uts_ns' was exported
ERROR: modpost: vmlinux: local symbol 'wait_for_initramfs' was exported
ERROR: modpost: vmlinux: local symbol 'init_task' was exported
ERROR: modpost: vmlinux: local symbol 'riscv_cached_mvendorid' was exported
ERROR: modpost: vmlinux: local symbol 'riscv_cached_marchid' was exported
ERROR: modpost: vmlinux: local symbol 'riscv_cached_mimpid' was exported
ERROR: modpost: vmlinux: local symbol 'riscv_isa_extension_base' was exported
ERROR: modpost: vmlinux: local symbol '__riscv_isa_extension_available' was exported
ERROR: modpost: vmlinux: local symbol 'riscv_get_intc_hwnode' was exported
ERROR: modpost: vmlinux: local symbol 'pm_power_off' was exported
ERROR: modpost: vmlinux: local symbol 'return_address' was exported
ERROR: modpost: vmlinux: local symbol 'riscv_timebase' was exported
ERROR: modpost: vmlinux: local symbol 'memset' was exported
ERROR: modpost: vmlinux: local symbol 'memcpy' was exported
ERROR: modpost: vmlinux: local symbol 'memmove' was exported
ERROR: modpost: vmlinux: local symbol '__memset' was exported
ERROR: modpost: vmlinux: local symbol '__memcpy' was exported
ERROR: modpost: vmlinux: local symbol '__memmove' was exported
ERROR: modpost: vmlinux: local symbol 'riscv_set_cacheinfo_ops' was exported

...

ERROR: modpost: __ex_table+0x17a0 references non-executable section '.debug_loclists'
WARNING: modpost: vmlinux: section mismatch in reference: 0x17a4 (section: __ex_table) -> .LLST146 (section: .debug_loclists)
ERROR: modpost: __ex_table+0x17a4 references non-executable section '.debug_loclists'
WARNING: modpost: vmlinux: section mismatch in reference: event_nfs4_renew+0xc (section: .data) -> unbound_reg_init (section: .init.text)
WARNING: modpost: vmlinux: section mismatch in reference: linear_target+0x24 (section: .data) -> bpf_syscall_sysctl_init (section: .init.text)
make[2]: *** [/mnt/b/yoe/master/sources/poky/build/tmp/work-shared/qemuriscv32/kernel-source/scripts/Makefile.modpost:145: vmlinux.symvers] Error 1
make[1]: *** [/mnt/b/yoe/master/sources/poky/build/tmp/work-shared/qemuriscv32/kernel-source/Makefile:1901: modpost] Error 2
make: *** [/mnt/b/yoe/master/sources/poky/build/tmp/work-shared/qemuriscv32/kernel-source/Makefile:224: __sub-make] Error 2
ERROR: oe_runmake failed

The workaround is to disable debug info in defconfig for now.

KERNEL_FEATURES:remove:riscv32 = "features/debug/debug-kernel.scc"
Comment 1 Randy MacLeod 2025-05-29 14:36:38 UTC
There is a work-around merged but this bug should remain opened until we figure out a proper fix.
Comment 2 Randy MacLeod 2025-12-18 15:42:33 UTC
Not important unless someone can explain their use-case.
Comment 3 Randy MacLeod 2026-05-28 13:16:28 UTC
Bulk move of 6.0 Medium bugs to 6.1.