[PATCH 1/7] spl: guard u_boot_any with X86

Tom Rini trini at konsulko.com
Sat May 7 14:58:34 CEST 2022


On Sat, May 07, 2022 at 05:21:36PM +0800, Peng Fan (OSS) wrote:

> From: Peng Fan <peng.fan at nxp.com>
> 
> set the symbol as weak not work if LTO is enabled. Since u_boot_any is
> only used on X86 for now, so guard it with X86, otherwise build break
> if we use BINMAN_SYMBOLS on i.MX.
> 
> Signed-off-by: Peng Fan <peng.fan at nxp.com>
> ---
>  common/spl/spl.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/common/spl/spl.c b/common/spl/spl.c
> index c8c463f80bd..4b28180467a 100644
> --- a/common/spl/spl.c
> +++ b/common/spl/spl.c
> @@ -50,7 +50,7 @@ DECLARE_GLOBAL_DATA_PTR;
>  
>  u32 *boot_params_ptr = NULL;
>  
> -#if CONFIG_IS_ENABLED(BINMAN_SYMBOLS)
> +#if CONFIG_IS_ENABLED(BINMAN_SYMBOLS) && CONFIG_IS_ENABLED(X86)
>  /* See spl.h for information about this */
>  binman_sym_declare(ulong, u_boot_any, image_pos);
>  binman_sym_declare(ulong, u_boot_any, size);
> @@ -148,7 +148,7 @@ void spl_fixup_fdt(void *fdt_blob)
>  #endif
>  }
>  
> -#if CONFIG_IS_ENABLED(BINMAN_SYMBOLS)
> +#if CONFIG_IS_ENABLED(BINMAN_SYMBOLS) && CONFIG_IS_ENABLED(X86)
>  ulong spl_get_image_pos(void)
>  {
>  #ifdef CONFIG_VPL
> @@ -221,7 +221,11 @@ __weak struct image_header *spl_get_load_buffer(ssize_t offset, size_t size)
>  
>  void spl_set_header_raw_uboot(struct spl_image_info *spl_image)
>  {
> +#if CONFIG_IS_ENABLED(X86)
>  	ulong u_boot_pos = binman_sym(ulong, u_boot_any, image_pos);
> +#else
> +	ulong u_boot_pos = BINMAN_SYM_MISSING;
> +#endif
>  
>  	spl_image->size = CONFIG_SYS_MONITOR_LEN;

I think we need to look at using __used perhaps?  LTO is / will be
enabled on imx boards at some point.

-- 
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/20220507/3834f83f/attachment.sig>


More information about the U-Boot mailing list