diff mbox series

kernel.bbclass: Use KERNEL_STRIP instead of STRIP

Message ID 20230814022550.357118-1-raj.khem@gmail.com
State Accepted, archived
Commit 2db0ef8fe6381c893791ad645748f6e7c8134e5f
Headers show
Series kernel.bbclass: Use KERNEL_STRIP instead of STRIP | expand

Commit Message

Khem Raj Aug. 14, 2023, 2:25 a.m. UTC
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'

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Bruce Ashfield <bruce.ashfield@gmail.com>
---
 meta/classes-recipe/kernel.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Bruce Ashfield Aug. 14, 2023, 2:35 a.m. UTC | #1
On Sun, Aug 13, 2023 at 10:25 PM Khem Raj <raj.khem@gmail.com> wrote:
>
> 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

>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> Cc: Bruce Ashfield <bruce.ashfield@gmail.com>
> ---
>  meta/classes-recipe/kernel.bbclass | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/classes-recipe/kernel.bbclass b/meta/classes-recipe/kernel.bbclass
> index bb5995b4954..acb43bd4d57 100644
> --- a/meta/classes-recipe/kernel.bbclass
> +++ b/meta/classes-recipe/kernel.bbclass
> @@ -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
>
diff mbox series

Patch

diff --git a/meta/classes-recipe/kernel.bbclass b/meta/classes-recipe/kernel.bbclass
index bb5995b4954..acb43bd4d57 100644
--- a/meta/classes-recipe/kernel.bbclass
+++ b/meta/classes-recipe/kernel.bbclass
@@ -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"