1From ac9df4fb92965f1f95a5bdbde5f2f86d0c569711 Mon Sep 17 00:00:00 2001 2From: Ricardo Neri <ricardo.neri-calderon@linux.intel.com> 3Date: Fri, 26 Jul 2019 17:34:26 -0400 4Subject: [PATCH] BaseTools: makefile: adjust to build in under bitbake 5 6Prepend the build flags with those of bitbake. This is to build 7using the bitbake native sysroot include and library directories. 8 9Note from Alex: this is not appropriate for upstream submission as 10the recipe already does lots of similar in-place fixups elsewhere, so 11this patch shold be converted to follow that pattern. We're not going 12to fight against how upstream wants to configure the build. 13 14Signed-off-by: Ricardo Neri <ricardo.neri@linux.intel.com> 15Upstream-Status: Inappropriate [needs to be converted to in-recipe fixups] 16--- 17 BaseTools/Source/C/Makefiles/header.makefile | 15 +++++++-------- 18 1 file changed, 7 insertions(+), 8 deletions(-) 19 20diff --git a/BaseTools/Source/C/Makefiles/header.makefile b/BaseTools/Source/C/Makefiles/header.makefile 21index d369908a09..22c670f316 100644 22--- a/BaseTools/Source/C/Makefiles/header.makefile 23+++ b/BaseTools/Source/C/Makefiles/header.makefile 24@@ -85,35 +85,34 @@ endif 25 26 INCLUDE = $(TOOL_INCLUDE) -I $(MAKEROOT) -I $(MAKEROOT)/Include/Common -I $(MAKEROOT)/Include/ -I $(MAKEROOT)/Include/IndustryStandard -I $(MAKEROOT)/Common/ -I .. -I . $(ARCH_INCLUDE) 27 INCLUDE += -I $(EDK2_PATH)/MdePkg/Include 28-CPPFLAGS = $(INCLUDE) 29+CPPFLAGS += $(INCLUDE) 30 31 # keep EXTRA_OPTFLAGS last 32 BUILD_OPTFLAGS = -O2 $(EXTRA_OPTFLAGS) 33 34 ifeq ($(DARWIN),Darwin) 35 # assume clang or clang compatible flags on OS X 36-CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror \ 37+CFLAGS += -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror \ 38 -Wno-deprecated-declarations -Wno-self-assign -Wno-unused-result -nostdlib -g 39 else 40 ifneq ($(CLANG),) 41-CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -fwrapv \ 42+CFLAGS += -MD -fshort-wchar -fno-strict-aliasing -fwrapv \ 43 -fno-delete-null-pointer-checks -Wall -Werror \ 44 -Wno-deprecated-declarations -Wno-self-assign \ 45 -Wno-unused-result -nostdlib -g 46 else 47-CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -fwrapv \ 48+CFLAGS += -MD -fshort-wchar -fno-strict-aliasing -fwrapv \ 49 -fno-delete-null-pointer-checks -Wall -Werror \ 50 -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict \ 51 -Wno-unused-result -nostdlib -g 52 endif 53 endif 54 ifneq ($(CLANG),) 55-LDFLAGS = 56-CXXFLAGS = -Wno-deprecated-register -Wno-unused-result -std=c++14 57+CXXFLAGS += -Wno-deprecated-register -Wno-unused-result -std=c++14 58 else 59-LDFLAGS = 60-CXXFLAGS = -Wno-unused-result 61+CXXFLAGS += -Wno-unused-result 62 endif 63+ 64 ifeq ($(HOST_ARCH), IA32) 65 # 66 # Snow Leopard is a 32-bit and 64-bit environment. uname -m returns i386, but gcc defaults 67-- 682.30.2 69 70