Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build NuttX with a romfs image #306

Closed
sgysh opened this issue Feb 19, 2020 · 2 comments · Fixed by #410
Closed

Cannot build NuttX with a romfs image #306

sgysh opened this issue Feb 19, 2020 · 2 comments · Fixed by #410

Comments

@sgysh
Copy link
Contributor

sgysh commented Feb 19, 2020

I cannot build NuttX with a romfs image.

CC:  stm32_romfs_initialize.c
{standard input}: Assembler messages:
{standard input}:498: Error: can't resolve `.rodata' {.rodata section} - `.Ltext0' {.text section}
{standard input}:499: Error: can't resolve `.rodata' {.rodata section} - `.Ltext0' {.text section}
{standard input}:502: Error: can't resolve `.rodata' {.rodata section} - `.Ltext0' {.text section}
{standard input}:503: Error: can't resolve `.rodata' {.rodata section} - `.Ltext0' {.text section}
/home/ysugino/incubator-nuttx/nuttx/boards/Board.mk:109: recipe for target 'stm32_romfs_initialize.o' failed
make[2]: *** [stm32_romfs_initialize.o] Error 1
make[2]: Leaving directory '/home/ysugino/incubator-nuttx/nuttx/boards/arm/stm32/stm32f4discovery/src'
Makefile:181: recipe for target 'board/libboard.a' failed
make[1]: *** [board/libboard.a] Error 2
make[1]: Leaving directory '/home/ysugino/incubator-nuttx/nuttx/arch/arm/src'
tools/Makefile.unix:465: recipe for target 'pass2' failed
make: *** [pass2] Error 2

Steps to reproduce

  1. Make a configuration
$ ./tools/configure.sh stm32f4discovery:rndis
  1. Make a romfs image
$ mkdir foo
$ cd foo/
$ echo bar > baz
$ genromfs -f rom.img
$ cp rom.img /PATH_TO_NUTTX_DIR/
  1. Enable FS_ROMFS and STM32_ROMFS
$ make menuconfig
  1. Build NuttX
$ make

Workaround

I found a following workaround.

diff --git a/boards/arm/stm32/stm32f4discovery/src/stm32_romfs_initialize.c b/boards/arm/stm32/stm32f4discovery/src/stm32_romfs_initialize.c
index 9f63db65ad..79839b84c1 100644
--- a/boards/arm/stm32/stm32f4discovery/src/stm32_romfs_initialize.c
+++ b/boards/arm/stm32/stm32f4discovery/src/stm32_romfs_initialize.c
@@ -93,7 +93,8 @@ __asm__ (
 "romfs_data_end:\n"
     ".globl   romfs_data_size\n"
 "romfs_data_size:\n"
-    ".word romfs_data_end - romfs_data_begin\n");
+    ".word romfs_data_end - romfs_data_begin\n"
+    ".text\n");

 extern const char romfs_data_begin;
 extern const char romfs_data_end;
@sgysh sgysh changed the title Cannot build NuttX with a rom image Cannot build NuttX with a romfs image Feb 19, 2020
@xiaoxiang781216
Copy link
Contributor

@sgysh could you provide a PR for review?

@sgysh
Copy link
Contributor Author

sgysh commented Feb 23, 2020

I found the workaround, but I still don't understand the cause of this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants