[PATCH v3 10/23] Makefile: add vmbarebox build target

Ahmad Fatoum a.fatoum at pengutronix.de
Mon Jan 12 05:08:41 PST 2026



On 1/8/26 4:50 PM, Sascha Hauer wrote:
> Add a build target to create vmbarebox, which provides an ELF format
> version of barebox that will be used later to link into the PBL
> 
> Co-Authored-By: Claude Sonnet 4.5 <noreply at anthropic.com>
> Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>

Reviewed-by: Ahmad Fatoum <a.fatoum at pengutronix.de>

But see nitpick below

> ---
>  Makefile | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/Makefile b/Makefile
> index 3b31cecc22c431a063b8d2d3c387da487b698e74..9d8fe242411422163cb800c0b2dd1eb9f0709f47 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1096,6 +1096,15 @@ barebox.fit: images/barebox-$(CONFIG_ARCH_LINUX_NAME).fit
>  barebox.srec: barebox
>  	$(OBJCOPY) -O srec $< $@
>  
> +OBJCOPYFLAGS_vmbarebox = $(call objcopy-option,--strip-section-headers,--strip-all)  \
> +			 --remove-section=.comment \
> +			 --remove-section=.note* \
> +			 --remove-section=.note.gnu.build-id \

Should be covered by above line.

> +			 --remove-section=.gnu.hash
> +
> +vmbarebox: barebox FORCE
> +	$(call if_changed,objcopy)
> +
>  quiet_cmd_barebox_proper__ = CC      $@
>        cmd_barebox_proper__ = $(CC) -r -o $@ -Wl,--whole-archive $(BAREBOX_OBJS)
>  
> @@ -1378,7 +1387,7 @@ CLEAN_FILES +=	barebox System.map include/generated/barebox_default_env.h \
>                  .tmp_version .tmp_barebox* barebox.bin barebox.map \
>  		.tmp_kallsyms* compile_commands.json \
>  		.tmp_barebox.o barebox.o barebox-flash-image \
> -		barebox.srec barebox.efi
> +		barebox.srec barebox.efi vmbarebox
>  
>  CLEAN_FILES +=	scripts/bareboxenv-target scripts/kernel-install-target \
>  		scripts/bareboxcrc32-target scripts/bareboximd-target \
> 

-- 
Pengutronix e.K.                  |                             |
Steuerwalder Str. 21              | http://www.pengutronix.de/  |
31137 Hildesheim, Germany         | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |




More information about the barebox mailing list