public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: GNU C Library <libc-alpha@sourceware.org>,
	Florian Weimer <fweimer@redhat.com>
Subject: Re: [PATCH v2 2/2] elf: Pre-generate Makefile fragment for DSO sorting tests [BZ #28550]
Date: Mon, 15 Nov 2021 17:18:47 -0300	[thread overview]
Message-ID: <95b7c1f9-406b-9711-d056-461e657c26b1@linaro.org> (raw)
In-Reply-To: <CAMe9rOor1B6J-ZXYm8esQwiO=XuP3mY-tkFSgcQiP-E+AdvZfA@mail.gmail.com>



On 15/11/2021 16:51, H.J. Lu wrote:
> On Mon, Nov 15, 2021 at 10:59 AM Adhemerval Zanella
> <adhemerval.zanella@linaro.org> wrote:
>>
>>
>>
>> On 08/11/2021 12:42, H.J. Lu via Libc-alpha wrote:
>>> Generate Makefile fragment for DSO sorting tests at configure time.
>>>
>>> This partially fixes BZ #28550.
>>
>> I am not sure if configure.ac is the right place to generate the Makefile
>> fragment required for tests.  Can we use 'avoid-generated' instead?
>>
>>
>> diff --git a/elf/Makefile b/elf/Makefile
>> index a311c3e23c..8556105a20 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
>> @@ -507,6 +508,7 @@ ifeq (yes,$(have-tunables))
>>  $(eval $(call include_dsosort_tests,dso-sort-tests-1.def))
>>  $(eval $(call include_dsosort_tests,dso-sort-tests-2.def))
>>  endif
>> +endif
> 
> It doesn't work.  "make check -j28" on a machine with 112 cores failed:
> 
> /export/users/hjl/build/gnu/tools-build/glibc-cet-gitlab/build-x86_64-linux/elf/dso-sort-tests-1.def.generated-makefile:938:
> warning: ignoring old recipe for target
> '/export/users/hjl/build/gnu/tools-build/glibc-cet-gitlab/build-x86_64-linux/elf/tst-dso-ordering9-dir/tst-dso-ordering9_25-bacde-b.so'
> ...
> make[3]: *** [Makefile:483: elf/tests] Error 2
> 
> I couldn't find the exact error message in a very long make log file.
This is usual way to create other auto-generated Makefile fragments, such as
sysd-sycalls and time64-compat.mk.  Maybe the below helps (I forgot to use 
'-include' and add the fragments on postclean-generated).


diff --git a/elf/Makefile b/elf/Makefile
index a311c3e23c..0e6d7ffb51 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
@@ -499,7 +500,7 @@ 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
+-include $(objpfx)$(1).generated-makefile
 endef
 
 # Generate from each testcase description file
@@ -507,6 +508,10 @@ ifeq (yes,$(have-tunables))
 $(eval $(call include_dsosort_tests,dso-sort-tests-1.def))
 $(eval $(call include_dsosort_tests,dso-sort-tests-2.def))
 endif
+endif
+
+postclean-generated += $(objpfx)/dso-sort-tests-2.generated-makefile \
+                      $(objpfx)/dso-sort-tests-2.generated-makefile
 
 check-abi: $(objpfx)check-abi-ld.out
 tests-special += $(objpfx)check-abi-ld.out

  reply	other threads:[~2021-11-15 20:18 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-08 15:42 [PATCH v2 0/2] Update Makefile fragments for DSO sorting tests H.J. Lu
2021-11-08 15:42 ` [PATCH v2 1/2] dso-ordering-test.py: Put all sources in one directory [BZ #28550] H.J. Lu
2021-11-11 17:52   ` Chung-Lin Tang
2021-11-11 18:21     ` H.J. Lu
2021-11-15 18:50   ` Adhemerval Zanella
2021-11-08 15:42 ` [PATCH v2 2/2] elf: Pre-generate Makefile fragment for DSO sorting tests " H.J. Lu
2021-11-15 18:59   ` Adhemerval Zanella
2021-11-15 19:51     ` H.J. Lu
2021-11-15 20:18       ` Adhemerval Zanella [this message]
2021-11-16  4:48         ` [PATCH] elf: Use a temporary file to generate Makefile fragments " H.J. Lu
2021-11-16 12:52           ` Adhemerval Zanella
2021-11-16 13:15             ` H.J. Lu
2021-11-11 13:46 ` [PATCH v2 0/2] Update Makefile fragments for DSO sorting tests H.J. Lu
2021-11-11 14:05   ` Adhemerval Zanella
2021-11-15 14:43     ` H.J. Lu

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=95b7c1f9-406b-9711-d056-461e657c26b1@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=fweimer@redhat.com \
    --cc=hjl.tools@gmail.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).