Re: [PATCH] kbuild: prevent building single targets twice
From: Nathan Chancellor
Date: Thu Oct 22 2026 - 15:37:24 EST
On Thu, Oct 22, 2026 at 12:05:27PM +0200, Mathias Krause wrote:
> Already visible in the diff context is 'libs-y' which has the same issue
> and a real behavioral change, depending on which compiler invocation
> runs last for arch/x86/lib/delay.o, it'll either be compiled with or
> without -pg under KCSAN.
Ah, I had not realized that libs-y suffered from the same problem.
> Others are:
> - arch/x86/platform/pvh/enlighten.o (via arch/x86/Kbuild),
> - drivers/char/ipmi/ipmi_msghandler.o (via drivers/Makefile,
> intentionally there for init ordering),
> - drivers/input/serio/i8042.o (also via drivers/Makefile)
>
> But what's worse, your change also affects link order which also defines
> runtime initialization order. I don't want to crawl into that rabbit
> hole and look for all the implicit dependencies that'd be broken by that
> change...
>
> One obvious, however, would be pci_subsys_init() which would then run
> before acpi_init(), leaving out ACPI-discovered PCI roots from getting
> discovered.
>
> So no, I don't like your change and prefer the more fundamental kbuild
> fix to get this sorted out once for all.
Totally fair, I had briefly thought about that but did not fully
consider all implications, so thanks for pointing that out.
I'll keep your change in my review queue and study it soon.
--
Cheers,
Nathan