public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Work around shortest-stem feature in make 3.82+
@ 2010-09-10 10:15 Andreas Schwab
  2010-09-10 10:34 ` Roland McGrath
  0 siblings, 1 reply; 3+ messages in thread
From: Andreas Schwab @ 2010-09-10 10:15 UTC (permalink / raw)
  To: libc-hacker

make 3.82+ no longer selects pattern rules by order, but by shortest
stem, so we need to add more rules to make sure we still get the right
matches.

Andreas.

2010-09-09  Andreas Schwab  <schwab@redhat.com>

	* Makeconfig (sysd-rules-patterns): Add rtld-%:rtld-%.
	(sysd-rules-targets): Remove duplicates.
	* elf/rtld-Rules ($(objpfx)rtld-%.os): Add pattern rules with
	rtld-%.$o dependency.
---
 Makeconfig     |    6 +++---
 elf/rtld-Rules |    9 +++++++++
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/Makeconfig b/Makeconfig
index 9778998..807c1d1 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -966,7 +966,7 @@ endif
 # emitted into sysd-rules.  A sysdeps Makeconfig fragment can
 # add its own special object file prefix to this list with e.g. foo-%:%
 # to have foo-*.? compiled from *.? using $(foo-CPPFLAGS).
-sysd-rules-patterns := %:% rtld-%:% m_%:s_%
+sysd-rules-patterns := %:% rtld-%:rtld-% rtld-%:% m_%:s_%
 
 # Let sysdeps/ subdirs contain a Makeconfig fragment for us to include here.
 sysdep-makeconfigs := $(wildcard $(+sysdep_dirs:=/Makeconfig))
@@ -975,8 +975,8 @@ include $(sysdep-makeconfigs)
 endif
 
 # Compute just the target patterns.  Makeconfig has set sysd-rules-patterns.
-sysd-rules-targets := $(foreach p,$(sysd-rules-patterns),\
-		      		$(firstword $(subst :, ,$p)))
+sysd-rules-targets := $(sort $(foreach p,$(sysd-rules-patterns),\
+				       $(firstword $(subst :, ,$p))))
 
 endif # Makeconfig not yet included
 
diff --git a/elf/rtld-Rules b/elf/rtld-Rules
index 9f31a56..fc225f2 100644
--- a/elf/rtld-Rules
+++ b/elf/rtld-Rules
@@ -93,6 +93,12 @@ else
 # These are the basic compilation rules corresponding to the Makerules ones.
 # The sysd-rules generated makefile already defines pattern rules for rtld-%
 # targets built from sysdeps source files.
+$(objpfx)rtld-%.os: rtld-%.S $(before-compile)
+	$(compile-command.S) $(rtld-CPPFLAGS)
+$(objpfx)rtld-%.os: rtld-%.s $(before-compile)
+	$(compile-command.s) $(rtld-CPPFLAGS)
+$(objpfx)rtld-%.os: rtld-%.c $(before-compile)
+	$(compile-command.c) $(rtld-CPPFLAGS)
 $(objpfx)rtld-%.os: %.S $(before-compile)
 	$(compile-command.S) $(rtld-CPPFLAGS)
 $(objpfx)rtld-%.os: %.s $(before-compile)
@@ -101,6 +107,9 @@ $(objpfx)rtld-%.os: %.c $(before-compile)
 	$(compile-command.c) $(rtld-CPPFLAGS)
 
 # The rules for generated source files.
+$(objpfx)rtld-%.os: $(objpfx)rtld-%.S $(before-compile); $(compile-command.S)
+$(objpfx)rtld-%.os: $(objpfx)rtld-%.s $(before-compile); $(compile-command.s)
+$(objpfx)rtld-%.os: $(objpfx)rtld-%.c $(before-compile); $(compile-command.c)
 $(objpfx)rtld-%.os: $(objpfx)%.S $(before-compile); $(compile-command.S)
 $(objpfx)rtld-%.os: $(objpfx)%.s $(before-compile); $(compile-command.s)
 $(objpfx)rtld-%.os: $(objpfx)%.c $(before-compile); $(compile-command.c)
-- 
1.7.2.2


-- 
Andreas Schwab, schwab@redhat.com
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84  5EC7 45C6 250E 6F00 984E
"And now for something completely different."

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Work around shortest-stem feature in make 3.82+
  2010-09-10 10:15 [PATCH] Work around shortest-stem feature in make 3.82+ Andreas Schwab
@ 2010-09-10 10:34 ` Roland McGrath
  2010-09-10 11:11   ` Andreas Schwab
  0 siblings, 1 reply; 3+ messages in thread
From: Roland McGrath @ 2010-09-10 10:34 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: libc-hacker

> make 3.82+ no longer selects pattern rules by order, but by shortest
> stem, so we need to add more rules to make sure we still get the right
> matches.

Sweet mother of god, what is that guy thinking?  I shudder to think at all
the subtle breakage introduced to makefile magic that has worked the same
for 20 years now.  He's kind of making me regret choosing him as maintainer.
Even I have a hard time figuring out what exactly this dismal change could
mean for complex uses of pattern rules like we have.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Work around shortest-stem feature in make 3.82+
  2010-09-10 10:34 ` Roland McGrath
@ 2010-09-10 11:11   ` Andreas Schwab
  0 siblings, 0 replies; 3+ messages in thread
From: Andreas Schwab @ 2010-09-10 11:11 UTC (permalink / raw)
  To: Roland McGrath; +Cc: libc-hacker

You can add your comments to <http://savannah.gnu.org/bugs/?31002>.

Andreas.

-- 
Andreas Schwab, schwab@redhat.com
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84  5EC7 45C6 250E 6F00 984E
"And now for something completely different."

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-09-10 11:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-10 10:15 [PATCH] Work around shortest-stem feature in make 3.82+ Andreas Schwab
2010-09-10 10:34 ` Roland McGrath
2010-09-10 11:11   ` Andreas Schwab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).