From patchwork Mon Mar 16 18:30:24 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 2012 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1773685872; bh=PD+BNsVUw9sZRlwUaAswdNQm/QqEWOyFmETtLBoqxM8=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=U85gD+nVnt1TN7PuEkj8cDV+EyjvJL92oeLe79uWvc4uGqWf0/jrlrBaaUqDDqf3V 6Nzfg6FS59M8p7SY/sl1JZEZM24xXcCf8inueReKRdbS09v3IOiubqvJPi3nB5rTMh dXM2f916ruYaKZdiEck9qoHZ8do4mUS8gCaH76yzq0lNwCcy60EQ3fA1/T2Z1KU8E0 ues99hMptX13HE74CrXr5zU2Og5jyHJKfV2G6fSbw/s2XJ4scIuhiPLn2z978zXNr4 A2acEegj2ybaUXN4rLiJwkq23kcfQKptN+CpSJ8C/YbOpnCVvFIij4VhbLn7P3dNdY Ia2AYak6fPwwg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7CCAA6A0A5 for ; Mon, 16 Mar 2026 12:31:12 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id uXFnXzCegjVh for ; Mon, 16 Mar 2026 12:31:12 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1773685872; bh=PD+BNsVUw9sZRlwUaAswdNQm/QqEWOyFmETtLBoqxM8=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=U85gD+nVnt1TN7PuEkj8cDV+EyjvJL92oeLe79uWvc4uGqWf0/jrlrBaaUqDDqf3V 6Nzfg6FS59M8p7SY/sl1JZEZM24xXcCf8inueReKRdbS09v3IOiubqvJPi3nB5rTMh dXM2f916ruYaKZdiEck9qoHZ8do4mUS8gCaH76yzq0lNwCcy60EQ3fA1/T2Z1KU8E0 ues99hMptX13HE74CrXr5zU2Og5jyHJKfV2G6fSbw/s2XJ4scIuhiPLn2z978zXNr4 A2acEegj2ybaUXN4rLiJwkq23kcfQKptN+CpSJ8C/YbOpnCVvFIij4VhbLn7P3dNdY Ia2AYak6fPwwg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 522EB6A09E for ; Mon, 16 Mar 2026 12:31:12 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1773685869; bh=yyvwhUYiZwCMoj6f4yT+dV8fYaICEocfunV4HiTvM1s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LKpWArP5zSaFfsuHk+vZ1obZHOtL3wBKdsKMOMDz9iS0tN7h06tSfAWaNtj3r++oH h6cQ+Fyx66s587RsaNtG3UcEcUiNaxSB9qoz0zwEMVfTnIV3m6z1gW9gaa5+vsHZpj kgOnX7eQhCr85G71pjr/RU2Dgm4NPs8ZObrrBplc0xolcHRed4xlVVXF9L78z25Jey VIBKuCyFjarLsRzeiyvSwL8p6UV/ErdPGm/qSAbyd97jmdDEbUGg6/EV1P9RdPJVG1 ZQV6A7Lr1sJgsGakgCRaV/tCdlDOKxS7BORZGlWG53BcB5grRHkSOwPUVKUG2IfXHw E2ULyab/dvm9g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 182CB6A07B; Mon, 16 Mar 2026 12:31:09 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id vi7nBsC307YB; Mon, 16 Mar 2026 12:31:09 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1773685868; bh=FwcSQaTjr1zfT6Wkabax1GMesb4YuCCe0gMuQRbCsgg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S2WMnDUj2BPn3g4M22/QHTK/0nhzGD93DfHRKCfCeYW6iyZ736LzgTBAVeDpWX+AW rUm12pBcFlzuTOcG3wmjX5e5cINd4CBDIDzCCucdNtvS5DspjvRvsjXU5fEeiQRmbp 4LVU9SRBCAKon12TaFwNJpuRVXyFTOPcJ3F3FaoGsdts2yDPwufh0bnB1L/8fA5hfL Db1N7jgIt2rtPzPCiYzhxZvfvyWrYUSHoUJ0H1fSswEm/MEkoNyPNcrkttRWOJ2HjU UKf5UZ/xNfFKLEZG916P1ZM/xrovN/Cwq9qJahy8EPzT28fU3EEn16sNp91uuOThTc Io2XcGQRFyvXg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 5573C6A078; Mon, 16 Mar 2026 12:31:08 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 16 Mar 2026 12:30:24 -0600 Message-ID: <20260316183050.3855921-2-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260316183050.3855921-1-sjg@u-boot.org> References: <20260316183050.3855921-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: PWLVXUCZICJ6URAONLERCE2NOOLCHT5J X-Message-ID-Hash: PWLVXUCZICJ6URAONLERCE2NOOLCHT5J X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 01/17] kbuild: Use relative paths in generated .incbin directives List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass The generated .S files for fonts, images, splash screens, signer binaries 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/images/u_boot.bmp 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 --- scripts/Makefile.lib | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index e2d0cb78bc9..8ccab5444cd 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -174,6 +174,7 @@ c_flags = -Wp,-MD,$(depfile) $(nostdinc) $(ubootinclude) \ $(basename_flags) $(modname_flags) a_flags = -Wp,-MD,$(depfile) $(nostdinc) $(ubootinclude) \ + -Wa,-I$(srctree) \ $(__a_flags) $(modkern_aflags) cpp_flags = -Wp,-MD,$(depfile) $(nostdinc) $(ubootinclude) \ @@ -494,7 +495,7 @@ cmd_S_ttf= \ echo '.balign 16'; \ echo '.global __ttf_$(*F)_begin'; \ echo '__ttf_$(*F)_begin:'; \ - echo '.incbin "$<" '; \ + echo '.incbin "$(src)/$(notdir $<)" '; \ echo '__ttf_$(*F)_end:'; \ echo '.global __ttf_$(*F)_end'; \ echo '.balign 16'; \ @@ -514,7 +515,7 @@ cmd_S_signer= \ echo '.balign 16'; \ echo '.global __signer_$(subst .,_,$(*F))_begin'; \ echo '__signer_$(subst .,_,$(*F))_begin:'; \ - echo '.incbin "$<" '; \ + echo '.incbin "$(src)/$(notdir $<)" '; \ echo '__signer_$(subst .,_,$(*F))_end:'; \ echo '.global __signer_$(subst .,_,$(*F))_end'; \ echo '.balign 16'; \ @@ -535,7 +536,7 @@ cmd_S_splash= \ echo '.balign 16'; \ echo '.global __splash_$(*F)_logo_begin'; \ echo '__splash_$(*F)_logo_begin:'; \ - echo '.incbin "$<" '; \ + echo '.incbin "$(src)/$(notdir $<)" '; \ echo '__splash_$(*F)_logo_end:'; \ echo '.global __splash_$(*F)_logo_end'; \ echo '.balign 16'; \ @@ -554,7 +555,7 @@ cmd_S_image= \ echo '.balign 16'; \ echo '.global __image_$(*F)_begin'; \ echo '__image_$(*F)_begin:'; \ - echo '.incbin "$<" '; \ + echo '.incbin "$(src)/$(notdir $<)" '; \ echo '__image_$(*F)_end:'; \ echo '.global __image_$(*F)_end'; \ echo '.balign 16'; \ @@ -594,7 +595,7 @@ cmd_S_efi= \ echo '.balign 16'; \ echo '.global __efi_$*_begin'; \ echo '__efi_$*_begin:'; \ - echo '.incbin "$<" '; \ + echo '.incbin "$(src)/$(notdir $<)" '; \ echo '__efi_$*_end:'; \ echo '.global __efi_$*_end'; \ echo '.balign 16'; \