0002-BaseTools-makefile-adjust-to-build-in-under-bitbake.patch 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. From 667c0cf97dadc4f5994d26ec3984f559a05ec406 Mon Sep 17 00:00:00 2001
  2. From: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
  3. Date: Fri, 26 Jul 2019 17:34:26 -0400
  4. Subject: [PATCH 2/4] BaseTools: makefile: adjust to build in under bitbake
  5. Prepend the build flags with those of bitbake. This is to build
  6. using the bitbake native sysroot include and library directories.
  7. Signed-off-by: Ricardo Neri <ricardo.neri@linux.intel.com>
  8. Upstream-Status: Pending
  9. ---
  10. BaseTools/Source/C/Makefiles/header.makefile | 17 +++++++++--------
  11. 1 file changed, 9 insertions(+), 8 deletions(-)
  12. diff --git a/BaseTools/Source/C/Makefiles/header.makefile b/BaseTools/Source/C/Makefiles/header.makefile
  13. index 1c105ee7d4..d5eea3864e 100644
  14. --- a/BaseTools/Source/C/Makefiles/header.makefile
  15. +++ b/BaseTools/Source/C/Makefiles/header.makefile
  16. @@ -69,35 +69,36 @@ $(error Bad HOST_ARCH)
  17. endif
  18. INCLUDE = $(TOOL_INCLUDE) -I $(MAKEROOT) -I $(MAKEROOT)/Include/Common -I $(MAKEROOT)/Include/ -I $(MAKEROOT)/Include/IndustryStandard -I $(MAKEROOT)/Common/ -I .. -I . $(ARCH_INCLUDE)
  19. -BUILD_CPPFLAGS = $(INCLUDE)
  20. +BUILD_CPPFLAGS += $(INCLUDE)
  21. # keep EXTRA_OPTFLAGS last
  22. BUILD_OPTFLAGS = -O2 $(EXTRA_OPTFLAGS)
  23. ifeq ($(DARWIN),Darwin)
  24. # assume clang or clang compatible flags on OS X
  25. -BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror \
  26. +BUILD_CFLAGS += -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror \
  27. -Wno-deprecated-declarations -Wno-self-assign -Wno-unused-result -nostdlib -g
  28. else
  29. ifeq ($(CXX), llvm)
  30. -BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -fwrapv \
  31. +BUILD_CFLAGS += -MD -fshort-wchar -fno-strict-aliasing -fwrapv \
  32. -fno-delete-null-pointer-checks -Wall -Werror \
  33. -Wno-deprecated-declarations -Wno-self-assign \
  34. -Wno-unused-result -nostdlib -g
  35. else
  36. -BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -fwrapv \
  37. +BUILD_CFLAGS += -MD -fshort-wchar -fno-strict-aliasing -fwrapv \
  38. -fno-delete-null-pointer-checks -Wall -Werror \
  39. -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict \
  40. -Wno-unused-result -nostdlib -g
  41. endif
  42. endif
  43. ifeq ($(CXX), llvm)
  44. -BUILD_LFLAGS =
  45. -BUILD_CXXFLAGS = -Wno-deprecated-register -Wno-unused-result
  46. +BUILD_LFLAGS = $(LDFLAGS)
  47. +BUILD_CXXFLAGS += -Wno-deprecated-register -Wno-unused-result
  48. else
  49. -BUILD_LFLAGS =
  50. -BUILD_CXXFLAGS = -Wno-unused-result
  51. +BUILD_LFLAGS = $(LDFLAGS)
  52. +BUILD_CXXFLAGS += -Wno-unused-result
  53. endif
  54. +
  55. ifeq ($(HOST_ARCH), IA32)
  56. #
  57. # Snow Leopard is a 32-bit and 64-bit environment. uname -m returns i386, but gcc defaults
  58. --
  59. 2.28.0