0001-Makefile-Check-for-last-line-only-from-preprocessed-.patch 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. From 3c078497e506bd6acb406da5cde7ce20e8896353 Mon Sep 17 00:00:00 2001
  2. From: Khem Raj <raj.khem@gmail.com>
  3. Date: Thu, 23 Jul 2020 14:13:59 -0700
  4. Subject: [PATCH] Makefile: Check for last line only from preprocessed output
  5. This started to fail with glibc 2.32 since glibc added additional
  6. attributes to functions in signal.h therefore existing regexp started to
  7. fail as it is not able to handle these functions e.g.
  8. extern int siginterrupt (int __sig, int __interrupt) __attribute__ ((__nothrow__ , __leaf__))
  9. __attribute__ ((__deprecated__ ("Use sigaction with SA_RESTART instead")));
  10. grep -v '^\#' | grep '"' | cut -f 2 -d'"'
  11. bit outside of fd_set selected
  12. Use sigaction with SA_RESTART instead
  13. arm
  14. So changing it to
  15. tail -1 | grep '"' | cut -f 2 -d'"'
  16. arm
  17. Produces the expected result, this was hidden until now
  18. Upstream-Status: Submitted [https://review.coreboot.org/c/flashrom/+/43770]
  19. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  20. Change-Id: I123a046e142d54632f12d54e2aa09b0928c02b91
  21. ---
  22. Makefile | 6 +++---
  23. 1 file changed, 3 insertions(+), 3 deletions(-)
  24. diff --git a/Makefile b/Makefile
  25. index 803529f..3795681 100644
  26. --- a/Makefile
  27. +++ b/Makefile
  28. @@ -106,7 +106,7 @@ endif
  29. # IMPORTANT: The following line must be placed before TARGET_OS is ever used
  30. # (of course), but should come after any lines setting CC because the line
  31. # below uses CC itself.
  32. -override TARGET_OS := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E os.h 2>/dev/null | grep -v '^\#' | grep '"' | cut -f 2 -d'"'))
  33. +override TARGET_OS := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E os.h 2>/dev/null | tail -1 | grep '"' | cut -f 2 -d'"'))
  34. ifeq ($(TARGET_OS), Darwin)
  35. override CPPFLAGS += -I/opt/local/include -I/usr/local/include
  36. @@ -460,8 +460,8 @@ endif
  37. # IMPORTANT: The following line must be placed before ARCH is ever used
  38. # (of course), but should come after any lines setting CC because the line
  39. # below uses CC itself.
  40. -override ARCH := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E archtest.c 2>/dev/null | grep -v '^\#' | grep '"' | cut -f 2 -d'"'))
  41. -override ENDIAN := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E endiantest.c 2>/dev/null | grep -v '^\#'))
  42. +override ARCH := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E archtest.c 2>/dev/null | tail -1 | grep '"' | cut -f 2 -d'"'))
  43. +override ENDIAN := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E endiantest.c 2>/dev/null | tail -1))
  44. # Disable the internal programmer on unsupported architectures (everything but x86 and mipsel)
  45. ifneq ($(ARCH)-little, $(filter $(ARCH),x86 mips)-$(ENDIAN))
  46. --
  47. 2.27.0