Skip to contentSkip to conversation

kernel.bbclass: Use KERNEL_STRIP instead of STRIP

PATCH In review Khem Raj 2 participants 2 messages Aug 14, 2023

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 kernel.bbclass: Use KERNEL_STRIP instead of STRIP

Kernel uses its own variables KERNEL_* instead of general toolchain env variables, therefore use KERNEL_STRIP here explicitly, Problems happen when using llvm-strip as default STRIP in distro settings, since kernel defaults to using gcc, system does not stage llvm/clang toolchain into kernel's staging sysroot and this function ends up with

FileNotFoundError: [Errno 2] No such file or directory: 'riscv64-yoe-linux-llvm-strip'

Cc Bruce Ashfield <[email protected]>
---
 meta/classes-recipe/kernel.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes-recipe/kernel.bbclass +1 -1
index bb5995b4954..acb43bd4d57 100644
@@ -760,7 +760,7 @@ addtask kernel_link_images after do_compile before do_strip
 python do_strip() {
     import shutil
 
-    strip = d.getVar('STRIP')
+    strip = d.getVar('KERNEL_STRIP')
     extra_sections = d.getVar('KERNEL_IMAGE_STRIP_EXTRA_SECTIONS')
     kernel_image = d.getVar('B') + "/" + d.getVar('KERNEL_OUTPUT_DIR') + "/vmlinux"
 
Signature · 1 line
2.41.0
#1 lore raw
Quoted 8 lines · Khem Raj

Kernel uses its own variables KERNEL_* instead of general toolchain env variables, therefore use KERNEL_STRIP here explicitly, Problems happen when using llvm-strip as default STRIP in distro settings, since kernel defaults to using gcc, system does not stage llvm/clang toolchain into kernel's staging sysroot and this function ends up with

FileNotFoundError: [Errno 2] No such file or directory: 'riscv64-yoe-linux-llvm-strip'

Makes sense to me.

Bruce

Quoted 23 lines
Cc Bruce Ashfield <[email protected]>
---
 meta/classes-recipe/kernel.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes-recipe/kernel.bbclass +1 -2
index bb5995b4954..acb43bd4d57 100644
@@ -760,7 +760,7 @@ addtask kernel_link_images after do_compile before do_strip
 python do_strip() {
     import shutil
 
-    strip = d.getVar('STRIP')
+    strip = d.getVar('KERNEL_STRIP')
     extra_sections = d.getVar('KERNEL_IMAGE_STRIP_EXTRA_SECTIONS')
     kernel_image = d.getVar('B') + "/" + d.getVar('KERNEL_OUTPUT_DIR') + "/vmlinux"
 
--

2.41.0

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II