diff mbox series

[v1] fs: Fix SPL build if FS_LOADER is enabled

Message ID 20230914160515.1121668-1-mchitale@ventanamicro.com
State Changes Requested
Delegated to: Tom Rini
Headers show
Series [v1] fs: Fix SPL build if FS_LOADER is enabled | expand

Commit Message

Mayuresh Chitale Sept. 14, 2023, 4:05 p.m. UTC
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.

Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com>
---
 fs/fs.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Tom Rini Sept. 14, 2023, 4:39 p.m. UTC | #1
On Thu, Sep 14, 2023 at 09:35:15PM +0530, 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.
> 
> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com>
> ---
>  fs/fs.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/fs/fs.c b/fs/fs.c
> index 2b815b1db0..074db4b20f 100644
> --- a/fs/fs.c
> +++ b/fs/fs.c
> @@ -256,6 +256,7 @@ static struct fstype_info fstypes[] = {
>  		.ln = fs_ln_unsupported,
>  	},
>  #endif
> +#ifndef CONFIG_SPL_BUILD
>  #ifdef CONFIG_SEMIHOSTING
>  	{
>  		.fstype = FS_TYPE_SEMIHOSTING,

This should be CONFIG_IS_ENABLED(SEMIHOSTING).
Mayuresh Chitale Sept. 21, 2023, 11:36 a.m. UTC | #2
On Thu, 2023-09-14 at 12:39 -0400, Tom Rini wrote:
> On Thu, Sep 14, 2023 at 09:35:15PM +0530, 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.
> > 
> > Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com
> > >
> > Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com>
> > ---
> >  fs/fs.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/fs/fs.c b/fs/fs.c
> > index 2b815b1db0..074db4b20f 100644
> > --- a/fs/fs.c
> > +++ b/fs/fs.c
> > @@ -256,6 +256,7 @@ static struct fstype_info fstypes[] = {
> >  		.ln = fs_ln_unsupported,
> >  	},
> >  #endif
> > +#ifndef CONFIG_SPL_BUILD
> >  #ifdef CONFIG_SEMIHOSTING
> >  	{
> >  		.fstype = FS_TYPE_SEMIHOSTING,
> 
> This should be CONFIG_IS_ENABLED(SEMIHOSTING).
Ok. I will update it.
>
diff mbox series

Patch

diff --git a/fs/fs.c b/fs/fs.c
index 2b815b1db0..074db4b20f 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -256,6 +256,7 @@  static struct fstype_info fstypes[] = {
 		.ln = fs_ln_unsupported,
 	},
 #endif
+#ifndef CONFIG_SPL_BUILD
 #ifdef CONFIG_SEMIHOSTING
 	{
 		.fstype = FS_TYPE_SEMIHOSTING,
@@ -275,6 +276,7 @@  static struct fstype_info fstypes[] = {
 		.ln = fs_ln_unsupported,
 	},
 #endif
+#endif
 #ifndef CONFIG_SPL_BUILD
 #ifdef CONFIG_CMD_UBIFS
 	{