public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] elf: Use a temporary file to generate Makefile fragments [BZ #28550]
@ 2021-11-16 13:18 H.J. Lu
  0 siblings, 0 replies; only message in thread
From: H.J. Lu @ 2021-11-16 13:18 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=1f67d8286b5da9266a138198ef1f15c27cbb0010

commit 1f67d8286b5da9266a138198ef1f15c27cbb0010
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Nov 15 16:28:39 2021 -0800

    elf: Use a temporary file to generate Makefile fragments [BZ #28550]
    
    1. Use a temporary file to generate Makefile fragments for DSO sorting
    tests and use -include on them.
    2. Add Makefile fragments to postclean-generated so that a "make clean"
    removes the autogenerated fragments and a subsequent "make" regenerates
    them.
    
    This partially fixes BZ #28550.
    
    Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

Diff:
---
 elf/Makefile | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/elf/Makefile b/elf/Makefile
index a311c3e23c..525f302d1a 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -491,6 +491,7 @@ tests-special += $(objpfx)order-cmp.out $(objpfx)tst-array1-cmp.out \
 		 $(objpfx)tst-unused-dep-cmp.out
 endif
 
+ifndef avoid-generated
 # DSO sorting tests:
 # The dso-ordering-test.py script generates testcase source files in $(objpfx),
 # creating a $(objpfx)<testcase-name>-dir for each testcase, and creates a
@@ -498,9 +499,14 @@ endif
 define include_dsosort_tests
 $(objpfx)$(1).generated-makefile: $(1)
 	$(PYTHON) $(..)scripts/dso-ordering-test.py \
-	--description-file $$< --objpfx $(objpfx) --output-makefile $$@
-include $(objpfx)$(1).generated-makefile
+	--description-file $$< --objpfx $(objpfx) --output-makefile $$@T
+	mv $$@T $$@
+-include $(objpfx)$(1).generated-makefile
 endef
+endif
+
+postclean-generated += $(objpfx)/dso-sort-tests-2.generated-makefile \
+		       $(objpfx)/dso-sort-tests-2.generated-makefile
 
 # Generate from each testcase description file
 ifeq (yes,$(have-tunables))


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-11-16 13:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-16 13:18 [glibc] elf: Use a temporary file to generate Makefile fragments [BZ #28550] H.J. Lu

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).