nuttx: nxflat build and run-time errors
Hello, Unfortunately, I can not build eagle100:nxflat and eagle100:thttpd configurations. As I’ve understood from README files and history files in NuttX repo, there are some not yet resolved issues with new gcc versions, and gcc 4.3.3 was the last version that still worked for NXFLAT mode. I tried to build NXFLAT Toolchain based on gcc 4.3.3 and binutils 2.19.1, however I’m still experiencing NuttX build errors.
Steps to reproduce:
$ mkdir TEST_ROOT
$ git clone https://github.com/apache/incubator-nuttx.git TEST_ROOT/nuttx
$ git clone https://github.com/apache/incubator-nuttx-apps TEST_ROOT/apps
$ cd TEST_ROOT/nuttx
$ ./tools/configure.sh -l eagle100:nxflat
Build NXFLAT Toolchain:
$ git clone https://bitbucket.org/nuttx/buildroot.git TEST_ROOT/buildroot/buildroot
$ cd TEST_ROOT/buildroot/buildroot
$ cp configs/cortexm3-defconfig-nxflat .config
$ make oldconfig
$ make menuconfig
activate the following options:
Toolchain Options -> Build GCC cross-compiler
Toolchain Options -> Build C++ compiler
$ make
Build NuttX:
$ cd TEST_ROOT/nuttx
$ make CROSSDEV=TEST_ROOT/buildroot/buildroot/build_arm_nofpu/staging_dir/bin/arm-nuttx-elf- \
MKNXFLAT=TEST_ROOT/buildroot/buildroot/build_arm_nofpu/staging_dir/bin/mknxflat \
LDNXFLAT=TEST_ROOT/buildroot/buildroot/build_arm_nofpu/staging_dir/bin/ldnxflat
There are multiple build errors. The first portion is as follows:
make[5]: Entering directory '.../TEST_ROOT/apps/examples/nxflat/tests/errno'
CC: errno.c
LD: errno.o
MK: errno.r1
AS: errno-thunk.S
LD: errno-thunk.o
LD: errno.r2
INPUT SECTIONS:
SECT LOW HIGH SIZE
TEXT 00000000 0000018a 0000018a
DATA 00000000 00000028 00000028
BSS 00000028 00000028 00000000
ERROR -- Symbol in GOT32 relocation is in TEXT
ERROR -- At addr 00000064 to sym '.LC0' [0000010c]
ERROR -- Symbol in GOT32 relocation is in TEXT
ERROR -- At addr 00000068 to sym '.LC1' [00000124]
ERROR -- Symbol in GOT32 relocation is in TEXT
ERROR -- At addr 0000006c to sym 'g_nonexistent' [000000fc]
ERROR -- Symbol in GOT32 relocation is in TEXT
ERROR -- At addr 00000070 to sym '.LC2' [0000013c]
ERROR -- Symbol in GOT32 relocation is in TEXT
ERROR -- At addr 00000074 to sym '.LC3' [0000013e]
ERROR -- Symbol in GOT32 relocation is in TEXT
ERROR -- At addr 00000078 to sym '.LC4' [00000165]
Entry symbol "main": 00000024 in section ".text"
Could you please tell me if I’m doing something wrong or what https://bitbucket.org/nuttx/buildroot.git SHA-1 (including what gcc and binutils version) and NuttX SHA-1 are compatible to each other to make NuttX with enabled NXFLAT working?
About this issue
- Original URL
- State: open
- Created 3 years ago
- Comments: 30 (30 by maintainers)
Commits related to this issue
- boards: lm3s6965-ek: added config to run NuttX with enabled NXFLAT binary loader mode on QEMU; Conditionally turn off -mpic-data-is-text-relative flag to access bss via the GOT (https://cwiki.apache.o... — committed to a-lunev/nuttx by a-lunev 3 years ago
- boards: lm3s6965-ek: added config to run NuttX with enabled NXFLAT binary loader mode on QEMU; Conditionally turn off -mpic-data-is-text-relative flag to access bss via the GOT (https://cwiki.apache.o... — committed to apache/nuttx by a-lunev 3 years ago
- boards: lm3s6965-ek: added config to run NuttX with enabled NXFLAT binary loader mode on QEMU; Conditionally turn off -mpic-data-is-text-relative flag to access bss via the GOT (https://cwiki.apache.o... — committed to unixjet/incubator-nuttx by a-lunev 3 years ago
- examples/nxflat: fixed an issue with the symbol table creation (#3737#issuecomment-844574935) — committed to Hrompic/incubator-nuttx by a-lunev 3 years ago
Interesting. But raises more question. None of the supported ARMv7-M do now, but it is possible that they could support both ARM and Thumb instruction sets (hence the need for distinction between the two). ARMv7-A certainly does support both ISAs. If Thumb functions are labled STT_FUNC that I don’t see how that could work.
None of this is unique to NxFLAT. The only place NxFLAT has an effect is in binding to base FLASH code. So why does apps/examples/elf/tests/struct not show the same problem. Something is different. I think you have identified the root cause of the problem, but this doesn’t feel like the fix.