[RFC PATCH] Kbuild: Always use $(PHASE_)

Tom Rini trini at konsulko.com
Thu Mar 6 15:08:11 CET 2025


On Thu, Mar 06, 2025 at 06:57:11AM -0700, Simon Glass wrote:
> Hi Tom,
> 
> On Wed, 5 Mar 2025 at 08:49, Tom Rini <trini at konsulko.com> wrote:
> >
> > On Wed, Mar 05, 2025 at 07:15:50AM -0700, Simon Glass wrote:
> > > Hi Tom,
> > >
> > > On Tue, 4 Mar 2025 at 13:41, Tom Rini <trini at konsulko.com> wrote:
> > > >
> > > > It is confusing to have both "$(PHASE_)" and "$(XPL_)" be used in our
> > > > Makefiles as part of the macros to determine when to do something in our
> > > > Makefiles based on what phase of the build we are in. For consistency,
> > > > bring this down to a single macro and use "$(PHASE_)" only.
> > > >
> > > > Signed-off-by: Tom Rini <trini at konsulko.com>
> > > > ---
> > > > Cc: Simon Glass <sjg at chromium.org>
> > > >
> > > > This leads a little bit of dead code in scripts/Makefile.xpl that I
> > > > didn't remove as this is an RFC. This also omits expanding on our build
> > > > documentation slightly.
> > > >
> > > > With the following patches applied (which are correct regardless of this
> > > > RFC and so separate):
> > > > https://patchwork.ozlabs.org/project/uboot/patch/20250304203235.2834031-1-trini@konsulko.com/
> > > > https://patchwork.ozlabs.org/project/uboot/patch/20250304202436.2783784-1-trini@konsulko.com/
> > > >
> > > > There's no change in the resulting build before/after this patch.
> > > >
> > > > We could do the other direction and drop $(PHASE_) in favour of $(XPL_)
> > > > but that would require updating the logic of how XPL_ is defined.
> > >
> > > These are not the same thing at present:
> > >
> > > XPL_ refers to any xPL phase
> > > PHASE_ refers to a particular xPL phase
> > >
> > > Since it doesn't change the build, it must be fine. It's just surprising, to me.
> >
> > Erm, this is what we have in scripts/Makefile.xpl today:
> >
> > ifdef CONFIG_XPL_BUILD
> > XPL_ := SPL_
> > ifeq ($(CONFIG_VPL_BUILD),y)
> > PHASE_ := VPL_
> > else
> > ifeq ($(CONFIG_TPL_BUILD),y)
> > PHASE_ := TPL_
> > else
> > PHASE_ := SPL_
> > endif
> > endif
> > else
> > XPL_ :=
> > PHASE_ :=
> > endif
> >
> > Which is why I sent the two fixes first, for places that relied on
> > CONFIG_SPL_FOO=y in a TPL (PowerPC and their spl->tpl->U-Boot chain) or
> > VPL (sandbox didn't set TPL_DM_I2C but did set SPL_DM_I2C) phase of the
> > build.
> 
> OK. I believe this means that we won't be able to say 'build this for
> any xPL' without adding a separate Kconfig for each phase where we
> want it enabled. Is that right?
> 
> If so, that's fine with me and I would prefer it.

Yes, there's never been an intentional "build this for any xPL".

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20250306/7e3adc33/attachment.sig>


More information about the U-Boot mailing list