[PATCH v2] fs: Fix SPL build if FS_LOADER is enabled

Sean Anderson seanga2 at gmail.com
Thu Nov 16 19:39:11 CET 2023


On 11/16/23 12:16, Mayuresh Chitale wrote:
> If FS_LOADER is enabled for the SPL then the build fails with the error:
> 
> fs/fs.o:(.data.rel.fstypes+0x128):
> undefined reference to `smh_fs_set_blk_dev'
> fs/fs.o:(.data.rel.fstypes+0x140):
> undefined reference to `smh_fs_size'
> fs/fs.o:(.data.rel.fstypes+0x148):
> undefined reference to `smh_fs_read'
> fs/fs.o:(.data.rel.fstypes+0x150):
> undefined reference to `smh_fs_write'
> 
> Fix the error by populating the semihosting entry in the fs_types array
> only for non-SPL builds.
> 
> Signed-off-by: Mayuresh Chitale <mchitale at ventanamicro.com>
> ---
> Changes in v2:
> - Use CONFIG_IS_ENABLED instead of CONFIG_SPL_BUILD
> 
>   fs/fs.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/fs.c b/fs/fs.c
> index 4cb4310c9c..5c27ae2fe1 100644
> --- a/fs/fs.c
> +++ b/fs/fs.c
> @@ -256,7 +256,7 @@ static struct fstype_info fstypes[] = {
>   		.ln = fs_ln_unsupported,
>   	},
>   #endif
> -#ifdef CONFIG_SEMIHOSTING
> +#if CONFIG_IS_ENABLED(SEMIHOSTING)
>   	{
>   		.fstype = FS_TYPE_SEMIHOSTING,
>   		.name = "semihosting",

Reviewed-by: Sean Anderson <seanga2 at gmail.com>


More information about the U-Boot mailing list