Skip to content
Snippets Groups Projects
Commit 8fda4f99 authored by Andrei Gherzan's avatar Andrei Gherzan :penguin:
Browse files

edk2-firmware: Respect RECIPE_SYSROOT


This is particularly useful to make sure the compiler uses the recipe
sysroot for headers avoiding host contaminations like:

| opts-GCC.h:42:
| /usr/include/stdint.h:26:10: fatal error: 'bits/libc-header-start.h'
file not found
| #include <bits/libc-header-start.h>

Signed-off-by: Andrei Gherzan's avatarAndrei Gherzan <andrei.gherzan@huawei.com>
parent 93e34373
No related branches found
No related tags found
1 merge request!250Add support for qemuarm/64 machines with EFI
From 35b7765e0e140f45ff25348c81172baca6197f52 Mon Sep 17 00:00:00 2001
From: Andrei Gherzan <andrei.gherzan@huawei.com>
Date: Fri, 12 Aug 2022 00:23:37 +0200
Subject: [PATCH] Respect BUILD_CFLAGS in GCC_ALL_CC_FLAGS
Signed-off-by: Andrei Gherzan <andrei.gherzan@huawei.com>
Upstream-Status: Inappropriate [OE specific]
---
BaseTools/Conf/tools_def.template | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
index f2bb6247e8..e19d34214f 100755
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -1867,7 +1867,7 @@ NOOPT_*_*_OBJCOPY_ADDDEBUGFLAG = --add-gnu-debuglink=$(DEBUG_DIR)/$(MODULE_N
*_*_*_DTCPP_PATH = DEF(DTCPP_BIN)
*_*_*_DTC_PATH = DEF(DTC_BIN)
-DEFINE GCC_ALL_CC_FLAGS = -g -Os -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -include AutoGen.h -fno-common
+DEFINE GCC_ALL_CC_FLAGS = -g -Os -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -include AutoGen.h -fno-common --sysroot=ENV(TARGET_SYSROOT)
DEFINE GCC_IA32_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -m32 -malign-double -freorder-blocks -freorder-blocks-and-partition -O2 -mno-stack-arg-probe
DEFINE GCC_X64_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mno-red-zone -Wno-address -mno-stack-arg-probe
DEFINE GCC_ARM_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mlittle-endian -mabi=aapcs -fno-short-enums -funsigned-char -ffunction-sections -fdata-sections -fomit-frame-pointer -Wno-address -mthumb -mfloat-abi=soft -fno-pic -fno-pie
--
2.25.1
......@@ -2,9 +2,18 @@
#
# SPDX-License-Identifier: Apache-2.0
FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:"
SRC_URI += " \
file://0001-Respect-BUILD_CFLAGS-in-GCC_ALL_CC_FLAGS.patch \
"
export GCC5_ARM_PREFIX = "${TARGET_PREFIX}"
export CLANG38_ARM_PREFIX = "${TARGET_PREFIX}"
# This is passed in the 0001-Respect-BUILD_CFLAGS-in-GCC_ALL_CC_FLAGS.patch
# patch so that the build can find the right headers in the sysroot.
export TARGET_SYSROOT = "${RECIPE_SYSROOT}"
EDK2_BUILD_RELEASE:toolchain-clang = "1"
do_configure:prepend() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment