blob: 2293d7e938c1b3564c90c53a7569e258f236cd5f [file] [log] [blame]
Andrew Geissler09036742021-06-25 14:25:14 -05001From 19d4c7f9812062a683b3ba60b35aac0461190456 Mon Sep 17 00:00:00 2001
Andrew Geissler82c905d2020-04-13 13:39:40 -05002From: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
3Date: Fri, 26 Jul 2019 17:34:26 -0400
Andrew Geissler09036742021-06-25 14:25:14 -05004Subject: [PATCH 2/6] BaseTools: makefile: adjust to build in under bitbake
Andrew Geissler82c905d2020-04-13 13:39:40 -05005
6Prepend the build flags with those of bitbake. This is to build
7using the bitbake native sysroot include and library directories.
8
Patrick Williams2390b1b2022-11-03 13:47:49 -05009Note 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
Andrew Geissler82c905d2020-04-13 13:39:40 -050014Signed-off-by: Ricardo Neri <ricardo.neri@linux.intel.com>
Patrick Williams2390b1b2022-11-03 13:47:49 -050015Upstream-Status: Inappropriate [needs to be converted to in-recipe fixups]
Andrew Geissler82c905d2020-04-13 13:39:40 -050016---
Andrew Geissler6ce62a22020-11-30 19:58:47 -060017 BaseTools/Source/C/Makefiles/header.makefile | 17 +++++++++--------
18 1 file changed, 9 insertions(+), 8 deletions(-)
Andrew Geissler82c905d2020-04-13 13:39:40 -050019
20diff --git a/BaseTools/Source/C/Makefiles/header.makefile b/BaseTools/Source/C/Makefiles/header.makefile
Andrew Geissler09036742021-06-25 14:25:14 -050021index 0df728f327..1299d47c87 100644
Andrew Geissler82c905d2020-04-13 13:39:40 -050022--- a/BaseTools/Source/C/Makefiles/header.makefile
23+++ b/BaseTools/Source/C/Makefiles/header.makefile
Andrew Geissler09036742021-06-25 14:25:14 -050024@@ -75,35 +75,36 @@ $(error Bad HOST_ARCH)
Andrew Geissler82c905d2020-04-13 13:39:40 -050025 endif
26
27 INCLUDE = $(TOOL_INCLUDE) -I $(MAKEROOT) -I $(MAKEROOT)/Include/Common -I $(MAKEROOT)/Include/ -I $(MAKEROOT)/Include/IndustryStandard -I $(MAKEROOT)/Common/ -I .. -I . $(ARCH_INCLUDE)
28-BUILD_CPPFLAGS = $(INCLUDE)
29+BUILD_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-BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror \
37+BUILD_CFLAGS += -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror \
38 -Wno-deprecated-declarations -Wno-self-assign -Wno-unused-result -nostdlib -g
39 else
Andrew Geissler6ce62a22020-11-30 19:58:47 -060040 ifeq ($(CXX), llvm)
41-BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -fwrapv \
42+BUILD_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
Andrew Geissler82c905d2020-04-13 13:39:40 -050047-BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -fwrapv \
48+BUILD_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
Andrew Geissler6ce62a22020-11-30 19:58:47 -060053 endif
54 ifeq ($(CXX), llvm)
55-BUILD_LFLAGS =
56-BUILD_CXXFLAGS = -Wno-deprecated-register -Wno-unused-result
57+BUILD_LFLAGS = $(LDFLAGS)
58+BUILD_CXXFLAGS += -Wno-deprecated-register -Wno-unused-result
59 else
Andrew Geissler82c905d2020-04-13 13:39:40 -050060-BUILD_LFLAGS =
61-BUILD_CXXFLAGS = -Wno-unused-result
62+BUILD_LFLAGS = $(LDFLAGS)
63+BUILD_CXXFLAGS += -Wno-unused-result
Andrew Geissler6ce62a22020-11-30 19:58:47 -060064 endif
65+
Andrew Geissler82c905d2020-04-13 13:39:40 -050066 ifeq ($(HOST_ARCH), IA32)
67 #
Andrew Geissler6ce62a22020-11-30 19:58:47 -060068 # Snow Leopard is a 32-bit and 64-bit environment. uname -m returns i386, but gcc defaults
Andrew Geissler82c905d2020-04-13 13:39:40 -050069--
Andrew Geissler09036742021-06-25 14:25:14 -0500702.32.0
Andrew Geissler82c905d2020-04-13 13:39:40 -050071