From 6361f29ecd333c02134efd50e49bceaec28ef834 Mon Sep 17 00:00:00 2001 From: Lee Chee Yang Date: Fri, 1 May 2026 12:13:07 +0800 Subject: [PATCH] zephyr-kernel/4.3: Fix sysrootarg | build_elf(args.elf_file, args.includes) | ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/data/build-zephyr/tmp/work/intel_ehl_crb-zephyr/zephyr-helloworld/4.3.0+git/sources/zephyr-helloworld-4.3.0+git/zephyr/arch/x86/zefi/zefi.py", line 120, in build_elf | ["-fno-stack-protector", "-fpic", "-mno-red-zone", "-fshort-wchar", sysrootarg, | ^^^^^^^^^^ | NameError: name 'sysrootarg' is not defined | ninja: build stopped: subcommand failed. Signed-off-by: Lee Chee Yang --- ...-x86-fix-efi-binary-generation-issue-in-cross-compila.patch | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meta-zephyr-core/recipes-kernel/zephyr-kernel/files/0001-v4.3.0-x86-fix-efi-binary-generation-issue-in-cross-compila.patch b/meta-zephyr-core/recipes-kernel/zephyr-kernel/files/0001-v4.3.0-x86-fix-efi-binary-generation-issue-in-cross-compila.patch index ba454a9..fe7b7ef 100644 --- a/meta-zephyr-core/recipes-kernel/zephyr-kernel/files/0001-v4.3.0-x86-fix-efi-binary-generation-issue-in-cross-compila.patch +++ b/meta-zephyr-core/recipes-kernel/zephyr-kernel/files/0001-v4.3.0-x86-fix-efi-binary-generation-issue-in-cross-compila.patch @@ -24,11 +24,12 @@ diff --git a/arch/x86/zefi/zefi.py b/arch/x86/zefi/zefi.py index b98419f8a49..790797f011a 100755 --- a/arch/x86/zefi/zefi.py +++ b/arch/x86/zefi/zefi.py -@@ -115,8 +115,9 @@ def build_elf(elf_file, include_dirs): +@@ -115,8 +115,10 @@ def build_elf(elf_file, include_dirs): includes = [] for include_dir in include_dirs: includes.extend(["-I", include_dir]) + # Pass --sysroot path for cross compilation ++ sysrootarg = "--sysroot=" + args.sysroot cmd = ([args.compiler, "-shared", "-Wall", "-Werror", "-I."] + includes + - ["-fno-stack-protector", "-fpic", "-mno-red-zone", "-fshort-wchar", + ["-fno-stack-protector", "-fpic", "-mno-red-zone", "-fshort-wchar", sysrootarg,