mirror of
https://git.yoctoproject.org/meta-zephyr
synced 2026-01-29 21:58:41 +01:00
https://github.com/zephyrproject-rtos/zephyr/releases/tag/v3.6.0 Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
94 lines
3.8 KiB
Diff
94 lines
3.8 KiB
Diff
From 25cf09358eebde64474cbf0759974e2087d4dcc6 Mon Sep 17 00:00:00 2001
|
|
From: Naveen Saini <naveen.kumar.saini@intel.com>
|
|
Date: Tue, 31 Oct 2023 16:57:31 +0800
|
|
Subject: [PATCH] x86: fix efi binary generation issue in cross compilation env
|
|
|
|
Set root directory for headers.
|
|
|
|
Upstream-Status: Inappropriate [Cross-compilation specific]
|
|
|
|
Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
|
|
---
|
|
arch/x86/zefi/zefi.py | 5 ++++-
|
|
boards/x86/intel_adl/CMakeLists.txt | 1 +
|
|
boards/x86/intel_ehl/CMakeLists.txt | 1 +
|
|
boards/x86/intel_rpl/CMakeLists.txt | 1 +
|
|
boards/x86/up_squared/CMakeLists.txt | 1 +
|
|
5 files changed, 8 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/arch/x86/zefi/zefi.py b/arch/x86/zefi/zefi.py
|
|
index 99c188ecd0..1cd86a21cd 100755
|
|
--- a/arch/x86/zefi/zefi.py
|
|
+++ b/arch/x86/zefi/zefi.py
|
|
@@ -109,8 +109,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,
|
|
"-Wl,-nostdlib", "-T", ldscript, "-o", "zefi.elf", cfile])
|
|
verbose(" ".join(cmd))
|
|
subprocess.run(cmd, check = True)
|
|
@@ -150,6 +152,7 @@ def parse_args():
|
|
parser.add_argument("-v", "--verbose", action="store_true", help="Verbose output")
|
|
parser.add_argument("-i", "--includes", required=True, nargs="+",
|
|
help="Zephyr base include directories")
|
|
+ parser.add_argument("-s", "--sysroot", required=True, help="Cross compilation --sysroot=path")
|
|
|
|
return parser.parse_args()
|
|
|
|
diff --git a/boards/x86/intel_adl/CMakeLists.txt b/boards/x86/intel_adl/CMakeLists.txt
|
|
index 2dc5afcc32..7981e576f2 100644
|
|
--- a/boards/x86/intel_adl/CMakeLists.txt
|
|
+++ b/boards/x86/intel_adl/CMakeLists.txt
|
|
@@ -6,6 +6,7 @@ set_property(GLOBAL APPEND PROPERTY extra_post_build_commands
|
|
-o ${CMAKE_OBJCOPY}
|
|
-i ${ZEPHYR_BASE}/include
|
|
-f ${PROJECT_BINARY_DIR}/${CONFIG_KERNEL_BIN_NAME}.elf
|
|
+ -s ${SYSROOT_DIR}
|
|
$<$<BOOL:${CMAKE_VERBOSE_MAKEFILE}>:--verbose>
|
|
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
|
|
)
|
|
diff --git a/boards/x86/intel_ehl/CMakeLists.txt b/boards/x86/intel_ehl/CMakeLists.txt
|
|
index 2dc5afcc32..7981e576f2 100644
|
|
--- a/boards/x86/intel_ehl/CMakeLists.txt
|
|
+++ b/boards/x86/intel_ehl/CMakeLists.txt
|
|
@@ -6,6 +6,7 @@ set_property(GLOBAL APPEND PROPERTY extra_post_build_commands
|
|
-o ${CMAKE_OBJCOPY}
|
|
-i ${ZEPHYR_BASE}/include
|
|
-f ${PROJECT_BINARY_DIR}/${CONFIG_KERNEL_BIN_NAME}.elf
|
|
+ -s ${SYSROOT_DIR}
|
|
$<$<BOOL:${CMAKE_VERBOSE_MAKEFILE}>:--verbose>
|
|
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
|
|
)
|
|
diff --git a/boards/x86/intel_rpl/CMakeLists.txt b/boards/x86/intel_rpl/CMakeLists.txt
|
|
index 2dc5afcc32..7981e576f2 100644
|
|
--- a/boards/x86/intel_rpl/CMakeLists.txt
|
|
+++ b/boards/x86/intel_rpl/CMakeLists.txt
|
|
@@ -6,6 +6,7 @@ set_property(GLOBAL APPEND PROPERTY extra_post_build_commands
|
|
-o ${CMAKE_OBJCOPY}
|
|
-i ${ZEPHYR_BASE}/include
|
|
-f ${PROJECT_BINARY_DIR}/${CONFIG_KERNEL_BIN_NAME}.elf
|
|
+ -s ${SYSROOT_DIR}
|
|
$<$<BOOL:${CMAKE_VERBOSE_MAKEFILE}>:--verbose>
|
|
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
|
|
)
|
|
diff --git a/boards/x86/up_squared/CMakeLists.txt b/boards/x86/up_squared/CMakeLists.txt
|
|
index 2dc5afcc32..7981e576f2 100644
|
|
--- a/boards/x86/up_squared/CMakeLists.txt
|
|
+++ b/boards/x86/up_squared/CMakeLists.txt
|
|
@@ -6,6 +6,7 @@ set_property(GLOBAL APPEND PROPERTY extra_post_build_commands
|
|
-o ${CMAKE_OBJCOPY}
|
|
-i ${ZEPHYR_BASE}/include
|
|
-f ${PROJECT_BINARY_DIR}/${CONFIG_KERNEL_BIN_NAME}.elf
|
|
+ -s ${SYSROOT_DIR}
|
|
$<$<BOOL:${CMAKE_VERBOSE_MAKEFILE}>:--verbose>
|
|
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
|
|
)
|
|
--
|
|
2.34.1
|
|
|