[PATCH] kbuild: Use relative paths in generated .incbin directives

Tom Rini trini at konsulko.com
Wed Mar 25 19:26:19 CET 2026


On Wed, Mar 25, 2026 at 11:57:17AM -0600, Simon Glass wrote:
> Hi Tom,
> 
> On Wed, 25 Mar 2026 at 11:15, Tom Rini <trini at konsulko.com> wrote:
> >
> > On Wed, Mar 25, 2026 at 11:12:00AM -0600, Simon Glass wrote:
> > > Hi Tom,
> > >
> > > On Wed, 25 Mar 2026 at 10:54, Tom Rini <trini at konsulko.com> wrote:
> > > >
> > > > On Wed, Mar 25, 2026 at 07:08:09AM -0600, Simon Glass wrote:
> > > > > The generated .S files for fonts, splash screens and EFI apps use
> > > > > .incbin with the full prerequisite path. When building with O= this
> > > > > bakes an absolute path into the .S file. If the build directory is
> > > > > later used on a different machine (e.g. in a container), the assembler
> > > > > cannot find the source file.
> > > > >
> > > > > Use $(src)/$(notdir $<) instead of $< so the .incbin directive contains
> > > > > a source-relative path like drivers/video/fonts/nimbus_sans_l_regular.ttf
> > > > > rather than an absolute one. Add -Wa,-I$(srctree) to the assembler
> > > > > flags so the assembler can resolve these paths.
> > > > >
> > > > > The DTB and DTBO rules are left unchanged since their prerequisites are
> > > > > generated files in the build directory.
> > > > >
> > > > > Signed-off-by: Simon Glass <sjg at chromium.org>
> > > > > ---
> > > > >
> > > > >  scripts/Makefile.lib | 7 ++++---
> > > > >  1 file changed, 4 insertions(+), 3 deletions(-)
> > > >
> > > > This is generic kbuild infrastructure now. Is there a fix we're missing
> > > > from upstream, a change we haven't pulled in yet (as we need to keep
> > > > syncing upwards) or a problem upstream too? Thanks!
> > >
> > > Linux does this with DTB files in quiet_cmd_wrap_S_dtb:
> > >
> > > echo '.incbin "$<" ';
> > >
> > > But Linux only uses generated files in the build directory, never
> > > actual source files. The font/splash/EFI .incbin rules are U-Boot
> > > additions that aren't in the upstream kbuild. So Linux doesn't have
> > > this problem.
> >
> > Shouldn't we be generating these files in to the build directory too?
> 
> These are actually source files, e.g.
> drivers/video/fonts/nimbus_sans_l_regular.ttf

So, the first thing then is that S_ttf is a local U-Boot rule. Lets
start by moving this out of scripts/Makefile.lib to
scripts/Makefile.lib-u-boot as that will make future re-sync work easier
(and is something we've talked about in the re-sync threads, splitting
U-Boot specific stuff out to new files). Then 2/2 of that series can be
this change, thanks.

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


More information about the U-Boot mailing list