0003-Enforce-compilation-without-system-headers.patch 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. From 63bb6f6effbaae9864366588464a7b9354c9a623 Mon Sep 17 00:00:00 2001
  2. From: Paul Kocialkowski <contact@paulk.fr>
  3. Date: Wed, 20 Jul 2016 16:26:32 +0200
  4. Subject: [PATCH 3/6] Enforce compilation without system headers
  5. This is based on commit bc404c94b4ab1e6a62e607fd7ef034aa31d6388e
  6. (Enforce compilation without system headers)
  7. ---
  8. Makefile | 5 +++--
  9. Makefile.toolchain | 2 +-
  10. 2 files changed, 4 insertions(+), 3 deletions(-)
  11. diff --git a/Makefile b/Makefile
  12. index 01581fb..195ea44 100644
  13. --- a/Makefile
  14. +++ b/Makefile
  15. @@ -99,8 +99,9 @@ _rw_size_str:=$(shell echo "CONFIG_FW_RW_SIZE" | $(CPP) $(CPPFLAGS) -P \
  16. _rw_size:=$(shell echo "$$(($(_rw_size_str)))")
  17. # Get RSA key size from board defines
  18. -_rsa_size:=$(shell echo "CONFIG_RSA_KEY_SIZE" | $(CPP) $(CPPFLAGS) -P \
  19. - -Ichip/$(CHIP) -Iboard/$(BOARD) -imacros include/rsa.h)
  20. +_rsa_size:=$(shell echo "CONFIG_RSA_KEY_SIZE" | $(CPP) $(CPPFLAGS) \
  21. + $(CFLAGS_WARN) -P -Ichip/$(CHIP) -Iboard/$(BOARD) \
  22. + -imacros include/rsa.h)
  23. $(eval RSA_KEY_SIZE=$(_rsa_size))
  24. $(eval BOARD_$(UC_BOARD)=y)
  25. diff --git a/Makefile.toolchain b/Makefile.toolchain
  26. index 43f390c..898129c 100644
  27. --- a/Makefile.toolchain
  28. +++ b/Makefile.toolchain
  29. @@ -19,7 +19,7 @@ BUILDCC?=gcc
  30. HOSTCC?=$(HOST_CROSS_COMPILE)gcc
  31. CFLAGS_WARN=-Wall -Werror -Wundef -Wstrict-prototypes -Wno-trigraphs \
  32. - -fno-strict-aliasing -fno-common \
  33. + -fno-strict-aliasing -fno-common -ffreestanding -fno-builtin \
  34. -Werror-implicit-function-declaration -Wno-format-security \
  35. -fno-delete-null-pointer-checks -Wdeclaration-after-statement \
  36. -Wno-pointer-sign -fno-strict-overflow -fconserve-stack
  37. --
  38. 2.9.0