Blame SOURCES/0007-Make.rules-incomplete-wrong-make-r-failure.patch

4c0d37
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
4c0d37
From: Nigel Croxon <ncroxon@redhat.com>
4c0d37
Date: Fri, 15 Mar 2019 09:48:10 -0400
4c0d37
Subject: [PATCH] Make.rules incomplete/wrong; make -r failure
4c0d37
4c0d37
Make.rules is not complete; in particular it lacks a %.o: %.S rule.
4c0d37
This happens to work due to the builtin make rule to that effect. but
4c0d37
building with make -r, or building as a sub-make of an environment that
4c0d37
uses make -r (or MAKEFLAGS += -r) causes it to break.
4c0d37
4c0d37
In general, make -r is strongly preferred, and Make.rules seems to have
4c0d37
been created explicitly to support this.
4c0d37
4c0d37
To further complicate things, the rule %.S: %.c causes a completely
4c0d37
incomprehensible error message. This rule is wrong, it should be %.s:
4c0d37
%.c not %.S: %.c.
4c0d37
4c0d37
Finally, the rule %.E: %.c is normally %.i: %.c; .i is the normal
4c0d37
extension for preprocessed C source. The equivalent rule for assembly is
4c0d37
%.s: %.S.
4c0d37
4c0d37
Signed-off-by: H. Peter Anvin <hpa@users.sf.net>
4c0d37
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
4c0d37
---
4c0d37
 Make.rules | 10 ++++++++--
4c0d37
 1 file changed, 8 insertions(+), 2 deletions(-)
4c0d37
4c0d37
diff --git a/Make.rules b/Make.rules
4c0d37
index 5b1c2862e1b..8cb93b0a039 100644
4c0d37
--- a/Make.rules
4c0d37
+++ b/Make.rules
4c0d37
@@ -51,8 +51,14 @@
4c0d37
 %.o: %.c
4c0d37
 	$(CC) $(INCDIR) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
4c0d37
 
4c0d37
-%.S: %.c
4c0d37
+%.s: %.c
4c0d37
 	$(CC) $(INCDIR) $(CFLAGS) $(CPPFLAGS) -S $< -o $@
4c0d37
 
4c0d37
-%.E: %.c
4c0d37
+%.i: %.c
4c0d37
+	$(CC) $(INCDIR) $(CFLAGS) $(CPPFLAGS) -E $< -o $@
4c0d37
+
4c0d37
+%.o: %.S
4c0d37
+	$(CC) $(INCDIR) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
4c0d37
+
4c0d37
+%.s: %.S
4c0d37
 	$(CC) $(INCDIR) $(CFLAGS) $(CPPFLAGS) -E $< -o $@