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

Re: [XEN PATCH v7 05/51] x86/mm: avoid building multiple .o from a single .c file

  • To: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 8 Sep 2021 14:01:43 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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; bh=UG2AjnDcsmumIq1uOUgi3tNiDykLsZsmE9tn4WXrbnY=; b=dGhhtLCGDj55ld7Vf4r4w8y7UgzkepZhKMdjesP94Wxg3pyZjIEFvPJZyDq8pWxVbdSZ6iI2D/AviePDJdCmtL3N2KKLa1JLnRriTP4CVzS1imlhWgqDJdYU56H0Pd4mKBTyZmk8nTG1i3IWOtaiXmf479Kp/34H5209YFVpTaIL2lcgkOS4ZZlu5zMZJVBP7DxN0NAPDYU6DI2ewa4z6YL3Vng6kTS58XLFYdAQ1XtVmN6pSmrQ5nnI4r+QFJi1p+v8/HAli2it7qFyL0xC72j7LkgJZ2e5M5M4A+gP/F7CxQ/ZUp4JROyaPb4kDh/o0ReSq23CzM6kYhwmSwro/Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CMplft3RF/qv2zfzrZG9BISwNk9psfoiMDxyjQNgzd32ZmLLxBRFhQFHcfuytoCw7m8qNsOICjVc/P1D5fOzOks8uU2xXhWG39EqwAVZnZtQ0/X5sZAyCLcfhS6HwSu8qpAydQCLb/iAL3w0fKcPYMAOxy46M6+c0Bk0YwMaBIcTC8a/A8EsnmNseZR4pgu8WVcKi2B5RAjtViYl91l8VcdwHFEer/Ki9WkQRFlLb/T6JAJentpEXVhWASbt2LvvQKYDOYuY7jK36qiKs4JxoowxPrRkKBzvWynplWE0Fb+/sWfYqKZUsfZFUF2NFD7nd/qlNR+Lti+H2GyvjNaeeQ==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Tim Deegan <tim@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 08 Sep 2021 12:01:53 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 08.09.2021 13:14, Anthony PERARD wrote:
> On Tue, Sep 07, 2021 at 08:14:14AM +0200, Jan Beulich wrote:
>> On 24.08.2021 12:49, Anthony PERARD wrote:
>>> This replace the use of a single .c file use for multiple .o file by
>>> creating multiple .c file including the first one.
>>> There's quite a few issues with trying to build more than one object
>>> file from a single source file: there's is a duplication of the make
>>> rules to generate those targets; there is an additional ".file" symbol
>>> added in order to differentiate between the object files; and the
>>> tools/symbols have an heuristic to try to pick up the right ".file".
>>> This patch adds new .c source file which avoid the need to add a
>>> second ".file" symbol and thus avoid the need to deal with those
>>> issues.
>>> Also remove __OBJECT_FILE__ from $(CC) command line as it isn't used
>>> anywhere anymore. And remove the macro "build-intermediate" since the
>>> generic rules for single targets can be used.
>>> And rename the objects in mm/hap/ to remove the extra "level".
>>> Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
>>> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
>> Hmm, when replying to 00/51 I didn't recall I gave an R-b for this one
>> already. I'd like to restrict it some: It should be taken to stand for
>> the technical correctness of the change. Nevertheless I'm not really
>> happy with the introduction of the various tiny source files. I've
>> meanwhile been wondering: Can't these be generated (in the build tree,
>> as soon as that's possible to be separate) rather than getting put in
>> the repo?
> Do we really need to generated those never to be change tiny source
> file? Do we really need to make the build system a lot more complicated?
> With those tiny source file in a different directory to the main source
> file, we need to add "-I" to CFLAGS. (source tree vs build tree.)
> I don't like preparation phase, I'd rather do just-in-time generation of
> those tiny file (if we really have too...) as to let make organize
> itself on when to do things. That mean, extra targets on how to generate
> the files, and telling make that those would be intermediate target
> shouldn't be deleted to avoid the final object from been regenerated
> over and over again (I'm not sure why the rebuild of tiny source file
> happen when they are intermediate, maybe because FORCE prerequisite on
> %.o).
> Can't we commit this patch as is?

I'll consider another time.

> What kind of issue is there with those tiny source files?

To me they're ugly and their presence is at least mildly confusing.
And apparently I'm not the only one thinking that way, or else such
tiny stubs would have been put there right when introducing these
multiply built sources.

> Should we add a warning in those tiny source files,
> something like "No modification of this file allowed, it's part of the
> build system." ?

Not sure this would make much of a difference. Them getting touched
later on is not a primary concern of mine. In fact once they're
there, I don't see why they couldn't be extended. At least in shadow
code there might be functions which could live there, reducing




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