[PATCH 2/2] ARM: imx: bootaux: Fix LTO -Wlto-type-mismatch

sbabic at denx.de sbabic at denx.de
Tue Jan 31 10:51:25 CET 2023


> Commit 56c2dbdabab5 ("imx: bootaux: cleanup code") introduces the
> following LTO related warning:
> "
> arch/arm/mach-imx/imx_bootaux.c:24:31: warning: type of ‘hostmap’ does not match original declaration [-Wlto-type-mismatch]
>    24 | const __weak struct rproc_att hostmap[] = { };
>       |                               ^
> arch/arm/mach-imx/imx8m/soc.c:1590:24: note: array types have different bounds
>  1590 | const struct rproc_att hostmap[] = {
>       |                        ^
> arch/arm/mach-imx/imx8m/soc.c:1590:24: note: ‘hostmap’ was previously declared here
> ../aarch64-linux-gnu/bin/ld: warning: u-boot has a LOAD segment with RWX permissions
> "
> This is because the weak empty array of structures "hostmap" is eventually
> replaced by non-empty array of structures with different number of elements.
> Fix this by avoiding weak variable size array, instead use a weak function
> which returns single pointer to the array.
> Fixes: 56c2dbdabab5 ("imx: bootaux: cleanup code")
> Signed-off-by: Marek Vasut <marex at denx.de>
> Reviewed-by: Peng Fan <peng.fan at nxp.com>
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,        Managing Director: Erika Unter  
HRB 165235 Munich,   Office: Kirchenstr.5, 82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================


More information about the U-Boot mailing list