Skip to contentSkip to conversation

fs: Fix SPL build if FS_LOADER is enabled

PATCH In review Mayuresh Chitale 3 participants 4 messages Nov 16, 2023 – Dec 21, 2023 VFS

lore
Share & tools
lore
#0 lore raw

PATCH v2 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.

---
Changes in v2:
- Use CONFIG_IS_ENABLED instead of CONFIG_SPL_BUILD

 fs/fs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/fs.c +1 -1
index 4cb4310c9c..5c27ae2fe1 100644
@@ -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",
Signature · 1 line
2.34.1
Reviewed-by on v2 1/1
#1 lore raw
Quoted 11 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'

Quoted 4 lines

Fix the error by populating the semihosting entry in the fs_types array only for non-SPL builds.

Signature · 1 line
Tom
Reviewed-by on v2 1/1
#2 lore raw
In reply to Mayuresh Chitale
Quoted 27 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.

---
Changes in v2:
- Use CONFIG_IS_ENABLED instead of CONFIG_SPL_BUILD

  fs/fs.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
fs/fs.c +0 -0
index 4cb4310c9c..5c27ae2fe1 100644

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

Quoted 8 lines
fs/fs.c +1 -1
@@ -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",
#3 lore raw
In reply to Mayuresh Chitale
Quoted 11 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'

Quoted 6 lines

Fix the error by populating the semihosting entry in the fs_types array only for non-SPL builds.

Applied to u-boot/next, thanks!

Signature · 1 line
Tom