Khem Raj has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/43770 )
Change subject: Makefile: Check for last line only from preprocessed output ......................................................................
Makefile: Check for last line only from preprocessed output
This started to fail with glibc 2.32 since glibc added additional attributes to functions in signal.h therefore existing regexp started to fail as it is not able to handle these functions e.g.
extern int siginterrupt (int __sig, int __interrupt) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__deprecated__ ("Use sigaction with SA_RESTART instead")));
grep -v '^#' | grep '"' | cut -f 2 -d'"' bit outside of fd_set selected Use sigaction with SA_RESTART instead arm
So changing it to tail -1 | grep '"' | cut -f 2 -d'"' arm
Produces the expected result, this was hidden until now
Signed-off-by: Khem Raj raj.khem@gmail.com Change-Id: I123a046e142d54632f12d54e2aa09b0928c02b91 --- M Makefile 1 file changed, 3 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/70/43770/1
diff --git a/Makefile b/Makefile index 803529f..3795681 100644 --- a/Makefile +++ b/Makefile @@ -106,7 +106,7 @@ # IMPORTANT: The following line must be placed before TARGET_OS is ever used # (of course), but should come after any lines setting CC because the line # below uses CC itself. -override TARGET_OS := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E os.h 2>/dev/null | grep -v '^#' | grep '"' | cut -f 2 -d'"')) +override TARGET_OS := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E os.h 2>/dev/null | tail -1 | grep '"' | cut -f 2 -d'"'))
ifeq ($(TARGET_OS), Darwin) override CPPFLAGS += -I/opt/local/include -I/usr/local/include @@ -460,8 +460,8 @@ # IMPORTANT: The following line must be placed before ARCH is ever used # (of course), but should come after any lines setting CC because the line # below uses CC itself. -override ARCH := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E archtest.c 2>/dev/null | grep -v '^#' | grep '"' | cut -f 2 -d'"')) -override ENDIAN := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E endiantest.c 2>/dev/null | grep -v '^#')) +override ARCH := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E archtest.c 2>/dev/null | tail -1 | grep '"' | cut -f 2 -d'"')) +override ENDIAN := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E endiantest.c 2>/dev/null | tail -1))
# Disable the internal programmer on unsupported architectures (everything but x86 and mipsel) ifneq ($(ARCH)-little, $(filter $(ARCH),x86 mips)-$(ENDIAN))
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/43770 )
Change subject: Makefile: Check for last line only from preprocessed output ......................................................................
Patch Set 1: Code-Review+1
Khem Raj has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/43770 )
Change subject: Makefile: Check for last line only from preprocessed output ......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1: Can someone merge it please ?
Attention is currently required from: Nico Huber. Khem Raj has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/43770 )
Change subject: Makefile: Check for last line only from preprocessed output ......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1: I wonder if Iaa4477a71e758cf9ecad2c22f3b77bc6508a3510 fixes it too, Pyro was it similar issue you were seeing ?
Attention is currently required from: Khem Raj. Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/43770 )
Change subject: Makefile: Check for last line only from preprocessed output ......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
I wonder if Iaa4477a71e758cf9ecad2c22f3b77bc6508a3510 fixes it too, Pyro was it similar issue you we […]
I think it does, it looks like it's been taken care of. Although, Pyro's solution relies on the assumption that we really only need the last line of the output. Hmm, yours does too, I'd switch `tail` and `grep`, e.g.
grep '"' | tail -1 | cut -f 2 -d'"'
Not sure, though, if it's worth another patch.
Personally, I'm a fan of the `awk` tool. It let's you do multiple things in one program while still being rather simple. e.g. for the same result:
awk -v FS=" '/"/ { p = $2; } END { print p; }'
Also, I wonder what the unfiltered output of `cc -E os.h` looks like for you. Maybe there is a better pattern to check for.
Anastasia Klimchuk has abandoned this change. ( https://review.coreboot.org/c/flashrom/+/43770?usp=email )
Change subject: Makefile: Check for last line only from preprocessed output ......................................................................
Abandoned
Makefile removed in CB:83673