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

Re: [PATCH 3/3] x86/build: Clean up boot/Makefile


  • To: Anthony Perard <anthony.perard@xxxxxxxxxx>
  • From: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
  • Date: Thu, 14 Apr 2022 19:27:56 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=y8zqh3+zgPXkgwMgdXb2YVMZEeAqe9RHrQMmSlDBnDA=; b=Ur+MA03VKWE396zHdoIVLVDI7kTCk7cVZgIbTK2GPuHWuy+VOfEPXqeshs+DYbkXf/5xb2RlpMIJsptsekpe+bvnLS+kCpspg2Mpi2NL0RbC3AlNLBt7bnd8lAQlIsoQ7yhSTEbXlFSeUP2hTyfRuoUcSJIUJSj2lHPx5cVLRfuu1dfqwpUOleOjgB+D/SMRzDgrlelLoisADs6byDykbL/9hIIT3pskzbGCbtKJIBq8h80VYu/eeE6n9ITm+3cAAxoKHafF3/auBQXIZliSAC/hs14TavZeyJScPzbMo5fHv+T6E5z51iiC7OThNONRF5GU4dSuhvu8d1S5ZbisNg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ea+AF9XuZ1yb1133L90EeNB7GBHfP25r+V8dubaYFCmm/CoCnStW8wfBM3VaDqEkasZucuu+0RPMa66TFQ5uw/kS1FgxseGiXXFfhqPIWeSaNJmfs6TtZvbv/Hvz503LK8kDFvu5L/qeb+saV9peQtuqmgRookYHVijBZ9AkGsH979mobyKTe/i9Ssjr0e4BcgPSsemfOqYxA0ff2j/K4W8nEY1acaeBCE/EFbq/298t56R4rZt9wlsyNQWd86vhpuNAGU1P5bTUXiqn9m3/6lJu34IyjMC/qMaUEEEjbZ1cpgv7g+bQGBDwHZwJ6QDMQWzuOwPvtF1aixs5ui8I4Q==
  • Authentication-results: esa1.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxx>, Roger Pau Monne <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Thu, 14 Apr 2022 19:28:13 +0000
  • Ironport-data: A9a23:mzn/gKiueNCqzi0D7PZMKAnxX161chAKZh0ujC45NGQN5FlHY01je htvUG7SPK6Jamv1f95zYdzi80wE7ZaEn9dlHlA4r31gQXgb9cadCdqndUqhZCn6wu8v7a5EA 2fyTvGacajYm1eF/k/F3oDJ9CU6jefSLlbFILas1hpZHGeIcw98z0M78wIFqtQw24LhX1rR4 YmaT/D3YzdJ5RYlagr41IrbwP9flKyaVOQw5wFWiVhj5TcyplFNZH4tDfjZw0jQG+G4KtWSV efbpIxVy0uCl/sb5nFJpZ6gGqECaua60QFjERO6UYD66vRJjnRaPqrWqJPwwKqY4tmEt4kZ9 TlDiXC/YRwMGqHxvPo/bz0GDwJefqQa/Pj5BHfq5KR/z2WeG5ft6/BnDUVwNowE4OdnR2pJ8 JT0KhhUMErF3bjvhuvmFK883azPL+GyVG8bklhmwSvUErANRpfbTr+RzdRZwC0xloZFGvO2i 88xN2szNEicMkIn1lE/FZkuu9qhj3DFfh5Wila4lbUe5FOD5VkkuFTqGIWMIYHbLSlPpW6Ho krW8mK/BQsVXPS94zeY9nOnhsfUgDj2HokVEdWQ5vNsxVGe2GEXIBkXTkeg5+m0jFakXNBSI FBS/TAhxZXe72TyEIO7BUfh5ifZ4FhMALK8DtHW9imW747Y3iKHJFQgECJiSJ8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SG6XY53uExr22u/KCJxc3pDURHXJ9upHpH 3saiIqiYdpQTOfNSSn5uw4zizw
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHYT/V67Id16NtaEUioBH+FcJmIEKzvrtSAgAAcvQA=
  • Thread-topic: [PATCH 3/3] x86/build: Clean up boot/Makefile

On 14/04/2022 18:45, Anthony PERARD wrote:
> On Thu, Apr 14, 2022 at 12:47:08PM +0100, Andrew Cooper wrote:
>> There are no .S intermediate files, so rework in terms of head-bin-objs.
>>
>> No functional change.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> The patch looks fine.
>
> Reviewed-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
>
>> ---
>> I'm slightly -1 on this, because
>>
>>   head-bin-objs := $(addprefix $(obj)/,$(head-bin-objs))
>>
>> is substantial obfuscation which I'd prefer to bin.
> It might be possible to do something that Kbuild does, which would be to
> teach the build system to look for "$(head-objs)" or maybe
> "$(head-bin-objs)" when it want to build "head.o". That something that's
> done in Kbuild I think to build a module from several source files.
>
>> Anthony: Why does dropping the targets += line interfere with incremental
>> builds?  With it gone, *.bin are regenerated unconditionally, but I can't see
>> what would cause that, nor why the normal dependencies on head.o don't work.
> Try to build with "make V=2", make will display why a target is been
> rebuild (when this target is built with $(if_changed, )
>
> $(targets) is used by Rules.mk to findout which dependencies files (the
> .cmd) to load and only load them if the target exist. Then the
> $(if_changed, ) macro rerun the command if prereq are newer than the
> target or if the command as changed. Without the .cmd file loaded, the
> macro would compare the new command to an empty value and so rebuild the
> target.
>
> Now, the *.bin files are regenerated because cmdline.o is been rebuild
> mostly because make didn't load the record of the previous command run.

I'm not certain if this case is a match with Linux's module logic.  The
module logic is "compile each .c file, then link all the .o's together
into one .ko".

In this case, we're saying "to assemble head.S to head.o, you first need
to build {cmdline,reloc}.bin so the incbin doesn't explode".  I guess it
depends how generic the "$X depends on arbitrary $Y's" expression can be
made.

Between this patch an the previous one, I've clearly got mixed up with
what exactly the target+= and regular dependencies.

The comment specifically refers to the fact that the old #include
"cmdline.S" used to show up as a dep in .head.o.cmd, whereas .incbin
doesn't.  (Not surprising, because -M and friends are from the
preprocessor, not assembler, but it would be helpful if this limitation
didn't exist.)  As a consequence, the dependency needs adding back in
somehow.

From your description above, I assume that simply being listed as a dep
isn't good enough to trigger a recursive load of the .bin's .cmd file
(not that there is one), which is why they need adding specially to targets?

As I have simplified this to (almost) normal build runes, should we be
expressing it differently now to fit in with the new way of doing things?

~Andrew

 


Rackspace

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