[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [XEN PATCH 02/15] build: rework asm-offsets.* build step to use kbuild
> On 23 May 2023, at 17:37, Anthony PERARD <anthony.perard@xxxxxxxxxx> wrote: > > Use $(if_changed_dep, ) macro to generate "asm-offsets.s" and remove > the use of $(move-if-changes,). That mean that "asm-offset.s" will be > changed even when the output doesn't change. > > But "asm-offsets.s" is only used to generated "asm-offsets.h". So > instead of regenerating "asm-offsets.h" every time "asm-offsets.s" > change, we will use "$(filechk, )" to only update the ".h" when the > output change. Also, with "$(filechk, )", the file does get > regenerated when the rule change in the makefile. > > This changes also result in a cleaner build log. > > Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx> > --- > > Instead of having a special $(cmd_asm-offsets.s) command, we could > probably reuse $(cmd_cc_s_c) from Rules.mk, but that would mean that > an hypothetical additional flags "-flto" in CFLAGS would not be > removed anymore, not sure if that matter here. > > But then we could write this: > > targets += arch/$(TARGET_ARCH)/$(TARGET_SUBARCH)/asm-offsets.s > arch/$(TARGET_ARCH)/$(TARGET_SUBARCH)/asm-offsets.s: CFLAGS-y += -g0 > arch/$(TARGET_ARCH)/include/asm/asm-offsets.h: > arch/$(TARGET_ARCH)/$(TARGET_SUBARCH)/asm-offsets.s FORCE > > instead of having to write a rule for asm-offsets.s The solution above seems clean, maybe I am wrong but -flto should not matter here as we are not building objects to include in the final build, isn’t it? And gcc documentation states just: “It is recommended that you compile all the files participating in the same link with the same options and also specify those options at link time." I’ve also tested this patch and it works fine, I have to say however that I preferred a more verbose output, so that people can check how we are invoking the compiler, but I guess now it’s more consistent with the other invocations that doesn’t print the compiler invocation. So if you want to proceed with this one, for me looks fine: Reviewed-by: Luca Fancellu <luca.fancellu@xxxxxxx> Tested-by: Luca Fancellu <luca.fancellu@xxxxxxx>
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |