[PATCH v2 1/2] dso-ordering-test.py: Put all sources in one directory [BZ #28550]

H.J. Lu hjl.tools@gmail.com
Thu Nov 11 18:21:45 GMT 2021


On Thu, Nov 11, 2021 at 9:52 AM Chung-Lin Tang <cltang@codesourcery.com> wrote:
>
>
>
> On 2021/11/8 11:42 PM, H.J. Lu via Libc-alpha wrote:
> > Put all sources for DSO sorting tests in the dso-sort-tests-src directory
> > and compile test 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)
> >
> > to avoid random $< values from $(before-compile) when compiling test
> > relocatable objects with
> >
> > $(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)
>
> I kind of see what you mean, but it appears that the explicit compile rule is the main required addition?
> If so, why the directory change to "dso-sort-tests-src"?
> (it kind of adds more complexity to the already somewhat complex placement of files, at least to someone new to the setup)
>

If the generated files are placed in the same directory where the object files
are, they will match the default rule:

$(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)

which is the root cause of the parallel build problem.


-- 
H.J.


More information about the Libc-alpha mailing list