[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XEN PATCH v9 04/30] build: set ALL_OBJS in main Makefile; move prelink.o to main Makefile


  • To: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 27 Jan 2022 16:50:32 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=dBZnrUhW5qQClEpXHSUcEADMuARLM/i+xLdUFskPT2g=; b=UGPP8B8ryy50DDjpYkpQXTQdf2m3qI3CBSp7kaGIrWPXsMah9hZL4wfjrxnWg7J/ljlGpHHBGixp/h2fTl1GljpIo8bfPVwbbGeeYzRV8mFVwsKP286BoPVtIpD+nhFNnCD7hMggobHNe8xNujxm09CcYH2G2auDW/T1Txxcj2kWpFlmhQGvyg79PpTis/sEOXCm/i2DwIIt5fOyHDA8MPGD1FScC38fQsemw0QY24PSNxm8+q39qab6E5DRJNStdWpccgurArq+s+ybRPNO4HV/kHfgHMGNUY6v4mCKqUwSOAED1JSfJNXpzE2vLo3Ng4dS09bDO+M7fW7sk0cKBw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GqoF57IKHKuOF/yUq+MEEtzGMCEOU57EkgpAF28H7EZgPDJtrN74E/t/FrdyAhoruiih3MlqhKaZEBj9p+TuDLXT7xMrcQ5J2To1XPlfT+6//NroilOdgG0WkapVC34D1l7OQTWmppiiHTK8Fz18EKxM+rqFkYpI7prGdunWGgaf1oV4OlabVTMINT1WfPbjDADyp5qpeIR5LKCYJumw6qlNtQ6Xq8/Z6LLObOOfZl/I8FzKrjb9hFkeBN6lmRpGX1YWuTL9/YZeU14mZ1jRBFgFpKIkEBwH90/HteSQGb8Ce0BuKEsGcjcWNYuTdMiSD6zueAQ2lpr3Av61k/hsWg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 27 Jan 2022 15:50:41 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 25.01.2022 12:00, Anthony PERARD wrote:
> This is to avoid arch/$arch/Makefile having to recurse into parents
> directories.
> 
> This avoid duplication of the logic to build prelink.o between arches.
> 
> In order to do that, we cut the $(TARGET) target in the main Makefile in
> two, there is a "prepare" phase/target runned before starting to build
> "prelink.o" which will prepare "include/" among other things, then all
> the $(ALL_OBJS) will be generated in order to build "prelink.o" and
> finally $(TARGET) will be generated by calling into "arch/*/" to make
> $(TARGET).
> 
> Now we don't need to prefix $(ALL_OBJS) with $(BASEDIR) as it is now
> only used from the main Makefile. Other changes is to use "$<" instead
> of spelling "prelink.o" in the target "$(TARGET)" in both
> arch/*/Makefile.
> 
> Beside "prelink.o" been at a different location, no other functional
> change intended.
> 
> Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
with a remark and maybe a small adjustment suggestion:

> --- a/xen/Makefile
> +++ b/xen/Makefile
> @@ -285,6 +285,16 @@ CFLAGS += -flto
>  LDFLAGS-$(CONFIG_CC_IS_CLANG) += -plugin LLVMgold.so
>  endif
>  
> +# Note that link order matters!

Merely as a remark: I wonder how applicable that comment is anymore.
If anything I'd expect it to be relevant to $(TARGET_SUBARCH)/head.o
(Arm) and boot/built_in.o (x86), neither of which get named here.

> @@ -407,7 +417,7 @@ $(TARGET): FORCE
>       $(MAKE) -f $(BASEDIR)/Rules.mk -C include
>       $(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) include
>       $(MAKE) -f $(BASEDIR)/Rules.mk 
> arch/$(TARGET_ARCH)/include/asm/asm-offsets.h
> -     $(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) 
> MKRELOC=$(MKRELOC) $@
> +     $(MAKE) -f $(BASEDIR)/Rules.mk MKRELOC=$(MKRELOC) 
> "ALL_OBJS=$(ALL_OBJS-y)" "ALL_LIBS=$(ALL_LIBS-y)" $@

I'm always a little wary of using double quotes when it's not clear
what exactly a macro may expand to. Single quotes at least have less
restrictions ...

Jan




 


Rackspace

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