[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


  • To: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Wed, 24 May 2023 07:39:37 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ivUBw/lSIJMGqEvNt20YZqVfNrYZCUitn8kD/5DRJVY=; b=ByNxx17tXQVnX+CkXTWe4FgU4wADEVsf8HjmS+OuyKf00r8UVC2AnObOZz8Lq4KDbv+AAj0hjbfEW8M8UpNmF90MZkoenbu1sr8aurW4iNr0kw1aX919LznoembGpxbzcAultZ6geFW4wMl6V7TuCgGdOR6a8Shpx8kIDCDMaaF7Ttfg14Q0wwE0hNo3mQg3iz7sH8ofX/Imy84IjzG7vbMau9tFSMviFfi55HxeOj2kKoRizaMiGGRn0XW9Nz2Jt9aX/MR6ICs/vdOqfesLoaD4ydb0gadkONCaJwDXyMiy7vVR0TnEkAqT54N3fqOhOk/UAWDnUs1yJF+wpr+LDA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZBRscVxlWrz4dtQHFi+LvG6p8BRevPH2c045uh/2xjacwbU3ixd+O0WjXhojM+XsAdGNseghHryIfCQqhjXYuuIqJ8WQgLOlQh8mrbKUgRLpuNmRgaKgMg5b2CqKqWdf0Po+Vjs5LuSMUuZLugXR0B/mCApFIbAGJ+JU4EY4Tj7m+B/7nhhF7mPDsMLv+0uC2+qPiRl4zw4OP6rLQzrdfAOuIRQrTgdTQ9SCTUCVvWdyTeCfo9cIBDlJhmkkJNlYxbwIv0fxAaOhc2Ui+YVnU8hGgWdbSpqM73f4Dft+noUrj4q+7pRs7USZ5qy0b36xVMsRE11/cn84xB4+Abw4cw==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Wed, 24 May 2023 07:40:07 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHZjZUYHIYuuKOi9UK9bl3DPb8C/K9pCpGA
  • Thread-topic: [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>



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.