Skip to contentSkip to conversation

fs: Fix SPL build if FS_LOADER is enabled

PATCH Superseded Mayuresh Chitale 2 participants 3 messages Sep 14, 2023 – Sep 21, 2023 VFS

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs: Fix SPL build if FS_LOADER is enabled

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.

---
 fs/fs.c | 2 ++
 1 file changed, 2 insertions(+)
fs/fs.c +2 -0
index 2b815b1db0..074db4b20f 100644
@@ -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
 	{
Signature · 1 line
2.34.1
#1 lore raw
Quoted 25 lines · Mayuresh Chitale

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.

---
 fs/fs.c | 2 ++
 1 file changed, 2 insertions(+)
fs/fs.c +0 -0
index 2b815b1db0..074db4b20f 100644

fs/fs.c static struct fstype_info fstypes[] = { · line 262

Quoted 7 lines
fs/fs.c +1 -0
@@ -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).

Signature · 1 line
Tom
#2 lore raw
Quoted 25 lines · Tom Rini
Quoted 23 lines · Mayuresh Chitale

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.

Quoted 1 line
---
 fs/fs.c | 2 ++
 1 file changed, 2 insertions(+)
Quoted 14 lines

fs/fs.c static struct fstype_info fstypes[] = { · line 262

Quoted 12 lines
fs/fs.c +1 -0
index 2b815b1db0..074db4b20f 100644
@@ -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.

Quoted 1 line