Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 1 | From 19d4c7f9812062a683b3ba60b35aac0461190456 Mon Sep 17 00:00:00 2001 |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 2 | From: Ricardo Neri <ricardo.neri-calderon@linux.intel.com> |
| 3 | Date: Fri, 26 Jul 2019 17:34:26 -0400 |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 4 | Subject: [PATCH 2/6] BaseTools: makefile: adjust to build in under bitbake |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 5 | |
| 6 | Prepend the build flags with those of bitbake. This is to build |
| 7 | using the bitbake native sysroot include and library directories. |
| 8 | |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame^] | 9 | Note from Alex: this is not appropriate for upstream submission as |
| 10 | the recipe already does lots of similar in-place fixups elsewhere, so |
| 11 | this patch shold be converted to follow that pattern. We're not going |
| 12 | to fight against how upstream wants to configure the build. |
| 13 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 14 | Signed-off-by: Ricardo Neri <ricardo.neri@linux.intel.com> |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame^] | 15 | Upstream-Status: Inappropriate [needs to be converted to in-recipe fixups] |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 16 | --- |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 17 | BaseTools/Source/C/Makefiles/header.makefile | 17 +++++++++-------- |
| 18 | 1 file changed, 9 insertions(+), 8 deletions(-) |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 19 | |
| 20 | diff --git a/BaseTools/Source/C/Makefiles/header.makefile b/BaseTools/Source/C/Makefiles/header.makefile |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 21 | index 0df728f327..1299d47c87 100644 |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 22 | --- a/BaseTools/Source/C/Makefiles/header.makefile |
| 23 | +++ b/BaseTools/Source/C/Makefiles/header.makefile |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 24 | @@ -75,35 +75,36 @@ $(error Bad HOST_ARCH) |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 25 | 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 Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 40 | 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 Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 47 | -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 Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 53 | 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 Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 60 | -BUILD_LFLAGS =
|
| 61 | -BUILD_CXXFLAGS = -Wno-unused-result
|
| 62 | +BUILD_LFLAGS = $(LDFLAGS)
|
| 63 | +BUILD_CXXFLAGS += -Wno-unused-result
|
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 64 | endif
|
| 65 | +
|
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 66 | ifeq ($(HOST_ARCH), IA32)
|
| 67 | #
|
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 68 | # Snow Leopard is a 32-bit and 64-bit environment. uname -m returns i386, but gcc defaults
|
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 69 | -- |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 70 | 2.32.0 |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 71 | |