[v2,0/2] Update Makefile fragments for DSO sorting tests

Message ID 20211108154211.167829-1-hjl.tools@gmail.com
Headers
Series Update Makefile fragments for DSO sorting tests |

Message

H.J. Lu Nov. 8, 2021, 3:42 p.m. UTC
  One problem of using

$(objpfx)%$o: $(objpfx)%.c $(before-compile); $$(compile-command.c)
compile-command.c = $(compile.c) $(OUTPUT_OPTION) $(compile-mkdep-flags)
compile.c = $(CC) $< -c $(CFLAGS) $(CPPFLAGS)

to build DSO sorting relocatable objects is that $< may not be the source
file with 3 "make -j 28" parallel builds on a machine with 112 cores.
When generating Makefile fragments at build time, the same file may be
generated more than once at the same time with parallel builds.

1. Update dso-ordering-test.py to put all sources for DSO sorting tests
in a single directory, dso-sort-tests-src, and compile relocatable objects
with

$(objpfx)tst-dso-ordering1-dir/tst-dso-ordering1-a.os: $(objpfx)dso-sort-tests-src/tst-dso-ordering1-a.c
	$(compile.c) $(OUTPUT_OPTION)

2. Generate Makefile fragments for DSO sorting tests at configure time
to avoid generate them in the elf directory at build time.

H.J. Lu (2):
  dso-ordering-test.py: Put all sources in one directory [BZ #28550]
  elf: Pre-generate Makefile fragment for DSO sorting tests [BZ #28550]

 configure                    | 11 +++++++++
 configure.ac                 | 12 +++++++++
 elf/Makefile                 | 22 ++++-------------
 scripts/dso-ordering-test.py | 47 ++++++++++++++++++++++++++----------
 4 files changed, 62 insertions(+), 30 deletions(-)
  

Comments

H.J. Lu Nov. 11, 2021, 1:46 p.m. UTC | #1
On Mon, Nov 8, 2021 at 7:42 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> One problem of using
>
> $(objpfx)%$o: $(objpfx)%.c $(before-compile); $$(compile-command.c)
> compile-command.c = $(compile.c) $(OUTPUT_OPTION) $(compile-mkdep-flags)
> compile.c = $(CC) $< -c $(CFLAGS) $(CPPFLAGS)
>
> to build DSO sorting relocatable objects is that $< may not be the source
> file with 3 "make -j 28" parallel builds on a machine with 112 cores.
> When generating Makefile fragments at build time, the same file may be
> generated more than once at the same time with parallel builds.
>
> 1. Update dso-ordering-test.py to put all sources for DSO sorting tests
> in a single directory, dso-sort-tests-src, and compile relocatable objects
> with
>
> $(objpfx)tst-dso-ordering1-dir/tst-dso-ordering1-a.os: $(objpfx)dso-sort-tests-src/tst-dso-ordering1-a.c
>         $(compile.c) $(OUTPUT_OPTION)
>
> 2. Generate Makefile fragments for DSO sorting tests at configure time
> to avoid generate them in the elf directory at build time.
>
> H.J. Lu (2):
>   dso-ordering-test.py: Put all sources in one directory [BZ #28550]
>   elf: Pre-generate Makefile fragment for DSO sorting tests [BZ #28550]
>
>  configure                    | 11 +++++++++
>  configure.ac                 | 12 +++++++++
>  elf/Makefile                 | 22 ++++-------------
>  scripts/dso-ordering-test.py | 47 ++++++++++++++++++++++++++----------
>  4 files changed, 62 insertions(+), 30 deletions(-)
>
> --
> 2.33.1
>

Any comments on the v2 patches?  "make check -j28" has been failing for me
on machines with many cores.   I'd like to resolve it soon.
  
Adhemerval Zanella Netto Nov. 11, 2021, 2:05 p.m. UTC | #2
On 11/11/2021 10:46, H.J. Lu via Libc-alpha wrote:
> On Mon, Nov 8, 2021 at 7:42 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>>
>> One problem of using
>>
>> $(objpfx)%$o: $(objpfx)%.c $(before-compile); $$(compile-command.c)
>> compile-command.c = $(compile.c) $(OUTPUT_OPTION) $(compile-mkdep-flags)
>> compile.c = $(CC) $< -c $(CFLAGS) $(CPPFLAGS)
>>
>> to build DSO sorting relocatable objects is that $< may not be the source
>> file with 3 "make -j 28" parallel builds on a machine with 112 cores.
>> When generating Makefile fragments at build time, the same file may be
>> generated more than once at the same time with parallel builds.
>>
>> 1. Update dso-ordering-test.py to put all sources for DSO sorting tests
>> in a single directory, dso-sort-tests-src, and compile relocatable objects
>> with
>>
>> $(objpfx)tst-dso-ordering1-dir/tst-dso-ordering1-a.os: $(objpfx)dso-sort-tests-src/tst-dso-ordering1-a.c
>>         $(compile.c) $(OUTPUT_OPTION)
>>
>> 2. Generate Makefile fragments for DSO sorting tests at configure time
>> to avoid generate them in the elf directory at build time.
>>
>> H.J. Lu (2):
>>   dso-ordering-test.py: Put all sources in one directory [BZ #28550]
>>   elf: Pre-generate Makefile fragment for DSO sorting tests [BZ #28550]
>>
>>  configure                    | 11 +++++++++
>>  configure.ac                 | 12 +++++++++
>>  elf/Makefile                 | 22 ++++-------------
>>  scripts/dso-ordering-test.py | 47 ++++++++++++++++++++++++++----------
>>  4 files changed, 62 insertions(+), 30 deletions(-)
>>
>> --
>> 2.33.1
>>
> 
> Any comments on the v2 patches?  "make check -j28" has been failing for me
> on machines with many cores.   I'd like to resolve it soon.
> 

It is on my list, just sorting out Florian comments to rtld-audit patchset.
  
H.J. Lu Nov. 15, 2021, 2:43 p.m. UTC | #3
On Thu, Nov 11, 2021 at 6:05 AM Adhemerval Zanella
<adhemerval.zanella@linaro.org> wrote:
>
>
>
> On 11/11/2021 10:46, H.J. Lu via Libc-alpha wrote:
> > On Mon, Nov 8, 2021 at 7:42 AM H.J. Lu <hjl.tools@gmail.com> wrote:
> >>
> >> One problem of using
> >>
> >> $(objpfx)%$o: $(objpfx)%.c $(before-compile); $$(compile-command.c)
> >> compile-command.c = $(compile.c) $(OUTPUT_OPTION) $(compile-mkdep-flags)
> >> compile.c = $(CC) $< -c $(CFLAGS) $(CPPFLAGS)
> >>
> >> to build DSO sorting relocatable objects is that $< may not be the source
> >> file with 3 "make -j 28" parallel builds on a machine with 112 cores.
> >> When generating Makefile fragments at build time, the same file may be
> >> generated more than once at the same time with parallel builds.
> >>
> >> 1. Update dso-ordering-test.py to put all sources for DSO sorting tests
> >> in a single directory, dso-sort-tests-src, and compile relocatable objects
> >> with
> >>
> >> $(objpfx)tst-dso-ordering1-dir/tst-dso-ordering1-a.os: $(objpfx)dso-sort-tests-src/tst-dso-ordering1-a.c
> >>         $(compile.c) $(OUTPUT_OPTION)
> >>
> >> 2. Generate Makefile fragments for DSO sorting tests at configure time
> >> to avoid generate them in the elf directory at build time.
> >>
> >> H.J. Lu (2):
> >>   dso-ordering-test.py: Put all sources in one directory [BZ #28550]
> >>   elf: Pre-generate Makefile fragment for DSO sorting tests [BZ #28550]
> >>
> >>  configure                    | 11 +++++++++
> >>  configure.ac                 | 12 +++++++++
> >>  elf/Makefile                 | 22 ++++-------------
> >>  scripts/dso-ordering-test.py | 47 ++++++++++++++++++++++++++----------
> >>  4 files changed, 62 insertions(+), 30 deletions(-)
> >>
> >> --
> >> 2.33.1
> >>
> >
> > Any comments on the v2 patches?  "make check -j28" has been failing for me
> > on machines with many cores.   I'd like to resolve it soon.
> >
>
> It is on my list, just sorting out Florian comments to rtld-audit patchset.

This bug has been causing false negative results with "makc check -jN"
on machines with many cores.  I will check it in on Tuesday if there are
no objections.

Thanks.