a-lunev edited a comment on issue #3737: URL: https://github.com/apache/incubator-nuttx/issues/3737#issuecomment-842768895
Initially (before creating the current issue #3737) I tried to test NXFLAT mode based on lm3s6965-ek:qemu-flat config because I do not have eagle100 board physically. I was able to build NuttX w/o build errors for lm3s6965-ek:qemu-flat using gcc 7.4.0 and binutils 2.28.1 (e7659eb89e1e7c8729d4cb526117c862d9511922 of https://bitbucket.org/nuttx/buildroot.git). I've attached my custom defconfig file with enabled NXFLAT. However, when I run the resulting binary on QEMU, it produced the following output: ``` Registering romdisk Mounting ROMFS filesystem at target=/mnt/romfs with source=/dev/ram0 **************************************************************************** * Executing errno **************************************************************************** ERROR: exec(errno) failed: 2 **************************************************************************** * Executing hello **************************************************************************** ERROR: exec(hello) failed: 2 **************************************************************************** * Executing struct **************************************************************************** ERROR: exec(struct) failed: 2 End-of-Test.. Exit-ing ``` Therefore, I supposed that the execution errors may be because of the new gcc version that was mentioned broken at least since gcc 4.6.3 concerning NXFLAT support. Thus I tried gcc 4.3.3, however it produced build errors even on eagle100:nxflat and eagle100:thttpd configurations in my case (I created the current issue #3737 at that point). I tried to test eagle100:nxflat and eagle100:thttpd because "Furthermore, NXFLAT has only been tested on the Eagle-100 LMS6918 Cortex-M3 board" is written here: https://cwiki.apache.org/confluence/display/NUTTX/NxFlat Now I've tested your suggestion concerning `-mno-pic-data-is-text-relative` flag using gcc 7.4.0, however I've not noticed any difference. lm3s6965-ek:qemu-flat is built w/o build errors not depending on the presence of the flag in Make.defs file of lm3s6965-ek directory. And the execution errors appear also not depending on the presence of the flag. 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 replace TEST_ROOT/nuttx/boards/arm/tiva/lm3s6965-ek/configs/qemu-flat/defconfig file by my attached one $ cd TEST_ROOT/nuttx $ ./tools/configure.sh -l lm3s6965-ek:qemu-flat ``` Build NXFLAT Toolchain: ``` $ git clone https://bitbucket.org/nuttx/buildroot.git TEST_ROOT/buildroot $ cd TEST_ROOT/buildroot $ cp configs/cortexm3-eabi-defconfig-7.4.0 .config $ make oldconfig $ make ``` Build NuttX: ``` $ cd TEST_ROOT/nuttx $ make CROSSDEV=TEST_ROOT/buildroot/build_arm_nofpu/staging_dir/bin/arm-nuttx-eabi- \ MKNXFLAT=TEST_ROOT/buildroot/build_arm_nofpu/staging_dir/bin/mknxflat \ LDNXFLAT=TEST_ROOT/buildroot/build_arm_nofpu/staging_dir/bin/ldnxflat ``` Run on QEMU: ``` qemu-system-arm -semihosting \ -M lm3s6965evb \ -netdev user,id=user0 \ -nic user,id=user0 \ -serial mon:stdio \ -kernel TEST_ROOT/nuttx/nuttx.bin ``` [defconfig.txt](https://github.com/apache/incubator-nuttx/files/6497753/defconfig.txt) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
