From: "H.J. Lu" <hjl.tools@gmail.com>
To: Florian Weimer <fweimer@redhat.com>
Cc: "H.J. Lu via Libc-alpha" <libc-alpha@sourceware.org>
Subject: Re: [PATCH v2] elf: Use a temporary file to generate Makefile fragments [BZ #28550]
Date: Wed, 17 Nov 2021 08:02:38 -0800 [thread overview]
Message-ID: <CAMe9rOo5mwQ1hRG3gWnZW8yi4fkCF3v_LQ8+YZNaZ=qvyADgpA@mail.gmail.com> (raw)
In-Reply-To: <877dd66apj.fsf@oldenburg.str.redhat.com>
[-- Attachment #1: Type: text/plain, Size: 336 bytes --]
On Wed, Nov 17, 2021 at 7:52 AM Florian Weimer <fweimer@redhat.com> wrote:
>
> * H. J. Lu:
>
> > In my case, the same makefile fragment was included twice. Can you try
> >
> > https://sourceware.org/pipermail/libc-alpha/2021-November/132795.html
>
> Do you have an updated version? It doesn't apply anymore.
>
Here it is.
--
H.J.
[-- Attachment #2: 0001-elf-Pre-generate-Makefile-fragment-for-DSO-sorting-t.patch --]
[-- Type: text/x-patch, Size: 3102 bytes --]
From 66d865d6059c07e4650759e786178d7383cd7e65 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Fri, 5 Nov 2021 12:20:01 -0700
Subject: [PATCH] elf: Pre-generate Makefile fragment for DSO sorting tests [BZ
#28550]
Generate Makefile fragment for DSO sorting tests at configure time.
This partially fixes BZ #28550.
---
configure | 11 +++++++++++
configure.ac | 12 ++++++++++++
elf/Makefile | 24 ++++--------------------
3 files changed, 27 insertions(+), 20 deletions(-)
diff --git a/configure b/configure
index 2f9adca064..91993da3b9 100755
--- a/configure
+++ b/configure
@@ -8484,3 +8484,14 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi
+
+if test "$have_tunables" = yes; then
+ test -d elf || mkdir elf
+ objdir=`pwd`
+ rm -f elf/dso-sort-tests.mk
+ (for d in dso-sort-tests-1.def dso-sort-tests-2.def
+ do
+ $PYTHON $srcdir/scripts/dso-ordering-test.py \
+ --description-file $srcdir/elf/$d --objpfx $objdir/elf/
+ done) > elf/dso-sort-tests.mk
+fi
diff --git a/configure.ac b/configure.ac
index 7eb4239359..faf70b930c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1901,3 +1901,15 @@ echo "$config_vars" >> config.make;;
esac
test -d bits || mkdir bits]],[[config_vars='$config_vars']])
AC_OUTPUT
+
+dnl Generate Makefile fragments for DSO sorting tests.
+if test "$have_tunables" = yes; then
+ test -d elf || mkdir elf
+ objdir=`pwd`
+ rm -f elf/dso-sort-tests.mk
+ (for d in dso-sort-tests-1.def dso-sort-tests-2.def
+ do
+ $PYTHON $srcdir/scripts/dso-ordering-test.py \
+ --description-file $srcdir/elf/$d --objpfx $objdir/elf/
+ done) > elf/dso-sort-tests.mk
+fi
diff --git a/elf/Makefile b/elf/Makefile
index 2365c0c863..17acd4a5ab 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -491,29 +491,13 @@ 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
-# Makefile fragment to be included.
-define include_dsosort_tests
-$(objpfx)$(1).generated-makefile: $(1)
- $(PYTHON) $(..)scripts/dso-ordering-test.py \
- --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))
-$(eval $(call include_dsosort_tests,dso-sort-tests-1.def))
-$(eval $(call include_dsosort_tests,dso-sort-tests-2.def))
+# Include Makefile fragments for DSO sorting tests.
+include $(objpfx)dso-sort-tests.mk
endif
+postclean-generated += $(objpfx)/dso-sort-tests.mk
+
check-abi: $(objpfx)check-abi-ld.out
tests-special += $(objpfx)check-abi-ld.out
update-abi: update-abi-ld
--
2.33.1
next prev parent reply other threads:[~2021-11-17 16:03 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-16 13:14 H.J. Lu
2021-11-16 13:16 ` Adhemerval Zanella
2021-11-17 13:49 ` Florian Weimer
2021-11-17 13:56 ` H.J. Lu
2021-11-17 15:29 ` Florian Weimer
2021-11-17 15:39 ` H.J. Lu
2021-11-17 15:52 ` Florian Weimer
2021-11-17 16:02 ` H.J. Lu [this message]
2021-11-17 16:41 ` Florian Weimer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAMe9rOo5mwQ1hRG3gWnZW8yi4fkCF3v_LQ8+YZNaZ=qvyADgpA@mail.gmail.com' \
--to=hjl.tools@gmail.com \
--cc=fweimer@redhat.com \
--cc=libc-alpha@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).