You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "yf13 (via GitHub)" <gi...@apache.org> on 2025/01/07 06:30:46 UTC
[PR] arm/qemu-armv7a: add EXE apps support [nuttx]
yf13 opened a new pull request, #15444:
URL: https://github.com/apache/nuttx/pull/15444
# Summary
This allows apps for kernel build NuttX on arm/qemu-armv7a to be built as executable type ELF files. Benefits of executable programs are smaller in size and easier GDB debugging.
# Impacts
Hardware: qemu-armv7a or other arm targets with kernel build.
# Testing
- local checks with QEMU v6.2 on Ubuntu 22.04
- CI checks
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] modlib: preprocess gnu-elf.ld for executable ELF [nuttx]
Posted by "yf13 (via GitHub)" <gi...@apache.org>.
yf13 commented on PR #15444:
URL: https://github.com/apache/nuttx/pull/15444#issuecomment-2584993105
@acassis, thanks.
Here I tried `sim:elf`. by default ELF type is relocatable and it works.
I then tried to blindly enable BINFMT_ELF_EXECUTABLE after selecting `ARCH_HAVE_ELF_EXECUTABLE` in arch/sim/Kconfig first, but the built ELFs in `../apps/examples/elf/tests/romfs` are still relocatable.
So if there is a way to make executable ELFs for sim, please teach.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] modlib: preprocess gnu-elf.ld for executable ELF [nuttx]
Posted by "yf13 (via GitHub)" <gi...@apache.org>.
yf13 commented on PR #15444:
URL: https://github.com/apache/nuttx/pull/15444#issuecomment-2587317998
It seems that `rv-virt:knsh` has this issue since `5076b0c74cc` which is pull/14064. Please help to review as my git bisect skill is still poor.
Criteria I used as a good commit:
- Hello app can show `static char NAME[] = "NuttX"` on console;
- file ../apps/bin/hello shows executable program.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] modlib: preprocess gnu-elf.ld for executable ELF [nuttx]
Posted by "lupyuen (via GitHub)" <gi...@apache.org>.
lupyuen commented on PR #15444:
URL: https://github.com/apache/nuttx/pull/15444#issuecomment-2588571886
But shall we revert the PR for now? I'm hoping we can clear the bug before the Lunar New Year holidays, so everyone can be a little less stressed thanks :-)
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] modlib: preprocess gnu-elf.ld for executable ELF [nuttx]
Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on PR #15444:
URL: https://github.com/apache/nuttx/pull/15444#issuecomment-2581144395
> @acassis, the usage is rather simple: just enable BINFMT_ELF_EXECUTABLE config for a kernel build.
>
> Actually this isn't new or specific to QEMU, I used it before for k230 devices, all canmv230 kernel mode have it enable by default, see pull/11513 for the old story.
Thank you for explanation, I thought it was specific for QEMU. BTW, but you should create a board config demo and include it in the sim page
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] modlib: preprocess gnu-elf.ld for executable ELF [nuttx]
Posted by "lupyuen (via GitHub)" <gi...@apache.org>.
lupyuen commented on PR #15444:
URL: https://github.com/apache/nuttx/pull/15444#issuecomment-2588455134
> It seems that `rv-virt:knsh` has this issue since `5076b0c74cc` which is pull/14064.
Sorry @yf13 I can't reproduce the bug with `rv-virt:knsh` and `rv-virt:knsh64`, based on https://github.com/apache/nuttx/commit/5076b0c74ccc280e4af6042219f6a5d07e78b7ac and https://github.com/apache/nuttx/pull/14064. Did I miss something?
- https://github.com/apache/nuttx/commit/5076b0c74ccc280e4af6042219f6a5d07e78b7ac was merged at 2024-10-11T03:20:45
- Most Recent NuttX App is https://github.com/apache/nuttx-apps/commit/9003110d7f68a0b4c24519b24a3254b6a23446e5 dated 2024-10-10T19:02:23
- Which I branched off as https://github.com/lupyuen2/wip-nuttx-apps/blob/uname2/examples/hello/hello_main.c
- And changed the `hello` code to:
```c
static char NAME[] = "NuttX";
int main(int argc, FAR char *argv[])
{
printf("NAME=%s\n", NAME);
printf("Address of NAME=%p\n", NAME);
return 0;
}
```
I compiled NuttX for https://github.com/apache/nuttx/commit/5076b0c74ccc280e4af6042219f6a5d07e78b7ac:
```text
+ git clone https://github.com/apache/nuttx --branch master nuttx
+ git clone https://github.com/lupyuen2/wip-nuttx-apps apps --branch uname2
+ cd nuttx
+ git reset --hard 5076b0c74cc
HEAD is now at 5076b0c74c risc-v:Unify module compilation options
NuttX Source: https://github.com/apache/nuttx/tree/5076b0c74ccc280e4af6042219f6a5d07e78b7ac
NuttX Apps: https://github.com/apache/nuttx-apps/tree/bf6d2f2be67b138f9bf1f4f69a9663cd10eb7663
+ tools/configure.sh rv-virt:knsh
Or tools/configure.sh rv-virt:knsh64
+ make -j ; make export
+ pushd ../apps ; ./tools/mkimport.sh -z -x ../nuttx/nuttx-export-12.8.0.tar.gz ; make import ; popd
```
`rv-virt:knsh` tested OK:
https://gist.github.com/lupyuen/a1544d3298035e0dd983ef636ebb728a
```text
+ tools/configure.sh rv-virt:knsh
+ qemu-system-riscv32 -semihosting -M virt,aclint=on -cpu rv32 -kernel nuttx -bios opensbi-1.5-rv-bin/share/opensbi/ilp32/generic/firmware/fw_dynamic.bin -nographic
QEMU emulator version 9.2.0
OpenSBI v1.5
nsh> uname -a
NuttX 12.8.0 5076b0c74c Jan 14 2025 07:07:44 risc-v rv-virt
nsh> hello
NAME=NuttX
Address of NAME=0xc0101000
```
`rv-virt:knsh64` also tested OK:
https://gist.github.com/lupyuen/54727956551cd6bea113891ddfd09288
```text
+ tools/configure.sh rv-virt:knsh64
+ qemu-system-riscv64 -semihosting -M virt,aclint=on -cpu rv64 -kernel nuttx -nographic
QEMU emulator version 9.2.0
OpenSBI v1.5.1
nsh> uname -a
NuttX 12.8.0 5076b0c74c Jan 14 2025 07:08:20 risc-v rv-virt
nsh> hello
NAME=NuttX
Address of NAME=0xc0101000
```
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] modlib: preprocess gnu-elf.ld for executable ELF [nuttx]
Posted by "lupyuen (via GitHub)" <gi...@apache.org>.
lupyuen commented on PR #15444:
URL: https://github.com/apache/nuttx/pull/15444#issuecomment-2588935699
Fixed here yay! 🎉
- https://github.com/apache/nuttx/pull/15527
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] arm/qemu-armv7a: add EXE apps support [nuttx]
Posted by "yf13 (via GitHub)" <gi...@apache.org>.
yf13 commented on code in PR #15444:
URL: https://github.com/apache/nuttx/pull/15444#discussion_r1904999874
##########
arch/arm/src/common/Toolchain.defs:
##########
@@ -546,10 +546,14 @@ ifeq ($(CONFIG_PIC),y)
# Generate an executable elf, need to ignore undefined symbols
LDELFFLAGS += --unresolved-symbols=ignore-in-object-files --emit-relocs
else
- LDELFFLAGS += -r
+ ifneq ($(CONFIG_BINFMT_ELF_EXECUTABLE),y)
+ LDELFFLAGS += -r
+ endif
endif
-LDELFFLAGS += -e main -T $(call CONVERT_PATH,$(TOPDIR)$(DELIM)libs$(DELIM)libc$(DELIM)modlib$(DELIM)gnu-elf.ld)
+ifneq ($(CONFIG_BINFMT_ELF_EXECUTABLE),y)
+ LDELFFLAGS += -e main -T $(call CONVERT_PATH,$(TOPDIR)$(DELIM)libs$(DELIM)libc$(DELIM)modlib$(DELIM)gnu-elf.ld)
Review Comment:
Currently the `gnu-elf.ld` in `boards/` folder contains target specific `.text` address, which is might be specific to target virtual space design. If later NuttX kernel build has a unified virtual space design (e.g. kernel at highmem, userspace in lowmem), I believe one userspace `gnu-elf.ld` will be enough. So maybe we should track unified userspace memory layout separately?
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] modlib: preprocess gnu-elf.ld for executable ELF [nuttx]
Posted by "yf13 (via GitHub)" <gi...@apache.org>.
yf13 commented on code in PR #15444:
URL: https://github.com/apache/nuttx/pull/15444#discussion_r1909581148
##########
arch/arm/src/common/Toolchain.defs:
##########
@@ -546,10 +546,14 @@ ifeq ($(CONFIG_PIC),y)
# Generate an executable elf, need to ignore undefined symbols
LDELFFLAGS += --unresolved-symbols=ignore-in-object-files --emit-relocs
else
- LDELFFLAGS += -r
+ ifneq ($(CONFIG_BINFMT_ELF_EXECUTABLE),y)
+ LDELFFLAGS += -r
+ endif
endif
-LDELFFLAGS += -e main -T $(call CONVERT_PATH,$(TOPDIR)$(DELIM)libs$(DELIM)libc$(DELIM)modlib$(DELIM)gnu-elf.ld)
+ifneq ($(CONFIG_BINFMT_ELF_EXECUTABLE),y)
+ LDELFFLAGS += -e main -T $(call CONVERT_PATH,$(TOPDIR)$(DELIM)libs$(DELIM)libc$(DELIM)modlib$(DELIM)gnu-elf.ld)
Review Comment:
@pussuw the `mkexport.sh` is same as before, so board specific scripts are preferred to the default one. This just tries to improve default one.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] arm/qemu-armv7a: add EXE apps support [nuttx]
Posted by "yf13 (via GitHub)" <gi...@apache.org>.
yf13 commented on code in PR #15444:
URL: https://github.com/apache/nuttx/pull/15444#discussion_r1904999874
##########
arch/arm/src/common/Toolchain.defs:
##########
@@ -546,10 +546,14 @@ ifeq ($(CONFIG_PIC),y)
# Generate an executable elf, need to ignore undefined symbols
LDELFFLAGS += --unresolved-symbols=ignore-in-object-files --emit-relocs
else
- LDELFFLAGS += -r
+ ifneq ($(CONFIG_BINFMT_ELF_EXECUTABLE),y)
+ LDELFFLAGS += -r
+ endif
endif
-LDELFFLAGS += -e main -T $(call CONVERT_PATH,$(TOPDIR)$(DELIM)libs$(DELIM)libc$(DELIM)modlib$(DELIM)gnu-elf.ld)
+ifneq ($(CONFIG_BINFMT_ELF_EXECUTABLE),y)
+ LDELFFLAGS += -e main -T $(call CONVERT_PATH,$(TOPDIR)$(DELIM)libs$(DELIM)libc$(DELIM)modlib$(DELIM)gnu-elf.ld)
Review Comment:
Currently the `gnu-elf.ld` in `boards/` folder contains target specific `.text` address, which is specific to target virtual space design now. If later NuttX kernel build has a unified virtual space design (e.g. kernel at highmem, userspace in lowmem), I believe one userspace `gnu-elf.ld` will be enough. So maybe we should track unified userspace memory layout separately?
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] modlib: preprocess gnu-elf.ld for executable ELF [nuttx]
Posted by "lupyuen (via GitHub)" <gi...@apache.org>.
lupyuen commented on PR #15444:
URL: https://github.com/apache/nuttx/pull/15444#issuecomment-2586229642
Erm @yf13 could you try `static char NAME[]` instead of `static char *NAME`? It makes a difference...
```c
static char test_static[] = "Testing Static Var"; //// TODO: Added this
static const char test_static_const[] = "Testing Static Cnost Var"; //// TODO: Added this
static char *NAME = "NuttX";
Address of test_static=0xc0100200
test_static_const=Testing Static Cnost Var
Address of test_static_const=0xc0001f10
Hello, World of NuttX!!
```
The reason why I chose `static char []` is because uname uses that:
https://github.com/apache/nuttx/blob/a2d4d74af75ffab527ac2422798c3368101da5f3/libs/libc/misc/lib_utsname.c#L53-L60
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] arm/qemu-armv7a: add EXE apps support [nuttx]
Posted by "yf13 (via GitHub)" <gi...@apache.org>.
yf13 commented on code in PR #15444:
URL: https://github.com/apache/nuttx/pull/15444#discussion_r1904999874
##########
arch/arm/src/common/Toolchain.defs:
##########
@@ -546,10 +546,14 @@ ifeq ($(CONFIG_PIC),y)
# Generate an executable elf, need to ignore undefined symbols
LDELFFLAGS += --unresolved-symbols=ignore-in-object-files --emit-relocs
else
- LDELFFLAGS += -r
+ ifneq ($(CONFIG_BINFMT_ELF_EXECUTABLE),y)
+ LDELFFLAGS += -r
+ endif
endif
-LDELFFLAGS += -e main -T $(call CONVERT_PATH,$(TOPDIR)$(DELIM)libs$(DELIM)libc$(DELIM)modlib$(DELIM)gnu-elf.ld)
+ifneq ($(CONFIG_BINFMT_ELF_EXECUTABLE),y)
+ LDELFFLAGS += -e main -T $(call CONVERT_PATH,$(TOPDIR)$(DELIM)libs$(DELIM)libc$(DELIM)modlib$(DELIM)gnu-elf.ld)
Review Comment:
Currently the `gnu-elf.ld` in `boards/` folder contains target specific `.text` address, which is might be specific to target virtual space design. If later NuttX kernel build has a unified virtual space design (e.g. kernel at highmem, userspace in lowmem), I believe one userspace `gnu-elf.ld` will be enough.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] modlib: preprocess gnu-elf.ld for executable ELF [nuttx]
Posted by "yf13 (via GitHub)" <gi...@apache.org>.
yf13 commented on PR #15444:
URL: https://github.com/apache/nuttx/pull/15444#issuecomment-2581448585
> BTW, but you should create a board config demo and include it in the sim page
@acassis I am unsure if `sim` device has KERNEL build because existing defconfigs there are all for FLAT build. My current understanding is that executable ELFs depend on SYSCALL thus not proper for FLAT build?
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] modlib: preprocess gnu-elf.ld for executable ELF [nuttx]
Posted by "lupyuen (via GitHub)" <gi...@apache.org>.
lupyuen commented on PR #15444:
URL: https://github.com/apache/nuttx/pull/15444#issuecomment-2585629269
Thank you so much YF! I think we need a NuttX Mirror to make things easier for you :-)
[__"Forgejo Git Forge for Apache NuttX RTOS (Experimental)"__](https://lupyuen.org/articles/forgejo.html)
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] modlib: preprocess gnu-elf.ld for executable ELF [nuttx]
Posted by "lupyuen (via GitHub)" <gi...@apache.org>.
lupyuen commented on PR #15444:
URL: https://github.com/apache/nuttx/pull/15444#issuecomment-2585648120
Fixed by YF:
- https://github.com/apache/nuttx/pull/15501
Thank you so much YF :-)
https://gist.github.com/lupyuen/7888125f58fe3034bc41b91b42fdabd7
```text
## NuttX Source: https://github.com/apache/nuttx/tree/2149d893363119e5368a495d9658acd1a5ea7668
## NuttX Apps: https://github.com/apache/nuttx-apps/tree/a6b9e718460a56722205c2a84a9b07b94ca664aa
$ tools/configure.sh rv-virt:knsh64
$ qemu-system-riscv64 -semihosting -M virt,aclint=on -cpu rv64 -kernel nuttx -nographic
NuttShell (NSH) NuttX-12.8.0
nsh> uname -a
NuttX 12.8.0 risc-v rv-virt
## Hmmm why is Commit Hash missing?
nsh> ostest
ostest_main: Exiting with status 0
```
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] modlib: preprocess gnu-elf.ld for executable ELF [nuttx]
Posted by "yf13 (via GitHub)" <gi...@apache.org>.
yf13 commented on PR #15444:
URL: https://github.com/apache/nuttx/pull/15444#issuecomment-2588480280
How about the `file ../apps/bin/hello` check?
Previously the type was ET_EXEC, since this it changes to ET_REL. The ET_EXEC type works fine before this commit. Can you confirm this?
The ET_REL support seems working since then, but we need find out when ET_EXEC type starts having the issue.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] modlib: preprocess gnu-elf.ld for executable ELF [nuttx]
Posted by "yf13 (via GitHub)" <gi...@apache.org>.
yf13 commented on PR #15444:
URL: https://github.com/apache/nuttx/pull/15444#issuecomment-2586217611
@lupyuen, thanks, but I got different test result here:
```bash
$ git diff
--- a/examples/hello/hello_main.c
+++ b/examples/hello/hello_main.c
@@ -28,6 +28,7 @@
/****************************************************************************
* Public Functions
****************************************************************************/
+static const char *NAME = "NuttX";
/****************************************************************************
* hello_main
@@ -35,6 +36,6 @@
int main(int argc, FAR char *argv[])
{
- printf("Hello, World!!\n");
+ printf("Hello, World of %s!!\n", NAME);
return 0;
}
```
Check with rv-virt:knsh:
```bash
$ qemu-system-riscv32 -M virt,aclint=on -semihosting -nographic -kernel nuttx
nsh> hello
Hello, World of NuttX!!
```
The commit string in uname might be a different story.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] modlib: preprocess gnu-elf.ld for executable ELF [nuttx]
Posted by "lupyuen (via GitHub)" <gi...@apache.org>.
lupyuen commented on PR #15444:
URL: https://github.com/apache/nuttx/pull/15444#issuecomment-2586220500
@yf13 What about knsh64?
https://gist.github.com/lupyuen/75c326a01c5e9110cac56b6e47f1a85f
```text
## NuttX Source: https://github.com/apache/nuttx/tree/5f4a15b690d31776081f1bf1f28103863a88e38b
## NuttX Apps: https://github.com/apache/nuttx-apps/tree/6908ba52c7c5719dfecceab99c2606113e0cf6b1
+ tools/configure.sh rv-virt:knsh64
+ qemu-system-riscv64 -semihosting -M virt,aclint=on -cpu rv64 -kernel nuttx -nographic
nsh> hello
test_static=
Address of test_static=0xc0100200
```
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] modlib: preprocess gnu-elf.ld for executable ELF [nuttx]
Posted by "lupyuen (via GitHub)" <gi...@apache.org>.
lupyuen commented on PR #15444:
URL: https://github.com/apache/nuttx/pull/15444#issuecomment-2588495284
Hi @yf13: About ET_EXEC vs ET_REL, could you post this as a NuttX Issue for the NuttX Community to decide? Perhaps also link the issue to the Mailing List?
Meanwhile I think it's important to fix the Static Vars, since it will break a lot of code. Would you consider rolling back your PR? Thanks :-)
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] modlib: preprocess gnu-elf.ld for executable ELF [nuttx]
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #15444:
URL: https://github.com/apache/nuttx/pull/15444#discussion_r1909046976
##########
arch/arm/src/common/Toolchain.defs:
##########
@@ -546,10 +546,14 @@ ifeq ($(CONFIG_PIC),y)
# Generate an executable elf, need to ignore undefined symbols
LDELFFLAGS += --unresolved-symbols=ignore-in-object-files --emit-relocs
else
- LDELFFLAGS += -r
+ ifneq ($(CONFIG_BINFMT_ELF_EXECUTABLE),y)
+ LDELFFLAGS += -r
+ endif
endif
-LDELFFLAGS += -e main -T $(call CONVERT_PATH,$(TOPDIR)$(DELIM)libs$(DELIM)libc$(DELIM)modlib$(DELIM)gnu-elf.ld)
+ifneq ($(CONFIG_BINFMT_ELF_EXECUTABLE),y)
+ LDELFFLAGS += -e main -T $(call CONVERT_PATH,$(TOPDIR)$(DELIM)libs$(DELIM)libc$(DELIM)modlib$(DELIM)gnu-elf.ld)
Review Comment:
elf file linker script is different from board linker script, since the layout should be general for all board like how Linux done.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] modlib: preprocess gnu-elf.ld for executable ELF [nuttx]
Posted by "yf13 (via GitHub)" <gi...@apache.org>.
yf13 commented on PR #15444:
URL: https://github.com/apache/nuttx/pull/15444#issuecomment-2585612371
Lup,
Here I saw `apps/bin/init` is of relocatable type but the BINFMT_ELF_EXECTUABLE is selected in `rv-virt:knsh64`? This mismatch will cause trouble. I guess this issue might be there even before this PR.
I haven't used this old PC for months so need fix the github access before I can send a fix for rv-virt.
Regards,
yf
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] modlib: preprocess gnu-elf.ld for executable ELF [nuttx]
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #15444:
URL: https://github.com/apache/nuttx/pull/15444#discussion_r1911883226
##########
libs/libc/Makefile:
##########
@@ -183,6 +183,10 @@ context:: bin kbin
ifeq ($(CONFIG_LIBC_ZONEINFO_ROMFS),y)
$(Q) $(MAKE) -C zoneinfo context BIN=$(BIN)
endif
+ifeq ($(CONFIG_LIBC_MODLIB),y)
Review Comment:
what's about cmake version
##########
libs/libc/modlib/gnu-elf.ld.in:
##########
@@ -18,9 +18,21 @@
*
****************************************************************************/
+
+#include <nuttx/config.h>
+
+#if defined(CONFIG_BUILD_KERNEL) && defined(CONFIG_BINFMT_ELF_EXECUTABLE)
Review Comment:
let's simplify to:
```
#define __ASSEMBLY__
#include <nuttx/addrenv.h>
#ifndef CONFIG_ARCH_TEXT_VBASE
# define CONFIG_ARCH_TEXT_VBASE 0
#endif
SECTIONS
{
.text CONFIG_ARCH_TEXT_VBASE :
```
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] arm/qemu-armv7a: add EXE apps support [nuttx]
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #15444:
URL: https://github.com/apache/nuttx/pull/15444#discussion_r1905629067
##########
arch/arm/src/common/Toolchain.defs:
##########
@@ -546,10 +546,14 @@ ifeq ($(CONFIG_PIC),y)
# Generate an executable elf, need to ignore undefined symbols
LDELFFLAGS += --unresolved-symbols=ignore-in-object-files --emit-relocs
else
- LDELFFLAGS += -r
+ ifneq ($(CONFIG_BINFMT_ELF_EXECUTABLE),y)
+ LDELFFLAGS += -r
+ endif
endif
-LDELFFLAGS += -e main -T $(call CONVERT_PATH,$(TOPDIR)$(DELIM)libs$(DELIM)libc$(DELIM)modlib$(DELIM)gnu-elf.ld)
+ifneq ($(CONFIG_BINFMT_ELF_EXECUTABLE),y)
+ LDELFFLAGS += -e main -T $(call CONVERT_PATH,$(TOPDIR)$(DELIM)libs$(DELIM)libc$(DELIM)modlib$(DELIM)gnu-elf.ld)
Review Comment:
but why not unify the layout now?
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] modlib: preprocess gnu-elf.ld for executable ELF [nuttx]
Posted by "pussuw (via GitHub)" <gi...@apache.org>.
pussuw commented on code in PR #15444:
URL: https://github.com/apache/nuttx/pull/15444#discussion_r1909109522
##########
arch/arm/src/common/Toolchain.defs:
##########
@@ -546,10 +546,14 @@ ifeq ($(CONFIG_PIC),y)
# Generate an executable elf, need to ignore undefined symbols
LDELFFLAGS += --unresolved-symbols=ignore-in-object-files --emit-relocs
else
- LDELFFLAGS += -r
+ ifneq ($(CONFIG_BINFMT_ELF_EXECUTABLE),y)
+ LDELFFLAGS += -r
+ endif
endif
-LDELFFLAGS += -e main -T $(call CONVERT_PATH,$(TOPDIR)$(DELIM)libs$(DELIM)libc$(DELIM)modlib$(DELIM)gnu-elf.ld)
+ifneq ($(CONFIG_BINFMT_ELF_EXECUTABLE),y)
+ LDELFFLAGS += -e main -T $(call CONVERT_PATH,$(TOPDIR)$(DELIM)libs$(DELIM)libc$(DELIM)modlib$(DELIM)gnu-elf.ld)
Review Comment:
You are right, the Linux toolchain has a generic linker script, so maybe this change is not as bad as I initially thought. I personally have the gnu-elf.ld file in the board folder for my projects because I still think it is board specific (for now).
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] modlib: preprocess gnu-elf.ld for executable ELF [nuttx]
Posted by "pussuw (via GitHub)" <gi...@apache.org>.
pussuw commented on code in PR #15444:
URL: https://github.com/apache/nuttx/pull/15444#discussion_r1909118075
##########
arch/arm/src/common/Toolchain.defs:
##########
@@ -546,10 +546,14 @@ ifeq ($(CONFIG_PIC),y)
# Generate an executable elf, need to ignore undefined symbols
LDELFFLAGS += --unresolved-symbols=ignore-in-object-files --emit-relocs
else
- LDELFFLAGS += -r
+ ifneq ($(CONFIG_BINFMT_ELF_EXECUTABLE),y)
+ LDELFFLAGS += -r
+ endif
endif
-LDELFFLAGS += -e main -T $(call CONVERT_PATH,$(TOPDIR)$(DELIM)libs$(DELIM)libc$(DELIM)modlib$(DELIM)gnu-elf.ld)
+ifneq ($(CONFIG_BINFMT_ELF_EXECUTABLE),y)
+ LDELFFLAGS += -e main -T $(call CONVERT_PATH,$(TOPDIR)$(DELIM)libs$(DELIM)libc$(DELIM)modlib$(DELIM)gnu-elf.ld)
Review Comment:
> but why not unify the layout now?
Us having a unified virtual address spacing (e.g. user in lowmem, kernel in himem) for now is impossible, as we do not have a good mechanism to move memory mapped devices into the kernel virtual memory area (like fdt and vmap). We have the pieces in place but not a single platform implements this AFAIK ?
This is why I for example configure MPFS the other way around; userspace starts from 0xc000_0000 and kernel resides in the lower part.
I guess this patch does not break this functionality, so I'm fine with it.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] modlib: preprocess gnu-elf.ld for executable ELF [nuttx]
Posted by "lupyuen (via GitHub)" <gi...@apache.org>.
lupyuen commented on PR #15444:
URL: https://github.com/apache/nuttx/pull/15444#issuecomment-2585595498
Sorry @yf13: This PR is causing "Instruction page fault" for `rv-virt:knsh64`. Wonder if there's something I missed in my testing steps? Thanks!
https://gist.github.com/lupyuen/60d54514ce9a8589b56ed6207c356d95#file-special-qemu-riscv-knsh64-log-L1396
```
+ git reset --hard 657247bda89d60112d79bb9b8d223eca5f9641b5
HEAD is now at 657247bda8 libc/modlib: preprocess gnu-elf.ld
+ tools/configure.sh rv-virt:knsh64
+ make -j
+ make export
+ ./tools/mkimport.sh -z -x ../nuttx/nuttx-export-12.8.0.tar.gz
+ make import
+ qemu-system-riscv64 -semihosting -M virt,aclint=on -cpu rv64 -kernel nuttx -nographic
QEMU emulator version 9.2.0
OpenSBI v1.5.1
ABC
riscv_exception: EXCEPTION: Instruction page fault. MCAUSE: 000000000000000c, EPC: 000000018000001a, MTVAL: 000000018000001a
riscv_exception: Segmentation fault in PID 2: /system/bin/init
```
[(Earlier Commit is OK)](https://gist.github.com/lupyuen/489af50d987c94e2cda54d927a8ea4f3)
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] modlib: preprocess gnu-elf.ld for executable ELF [nuttx]
Posted by "pussuw (via GitHub)" <gi...@apache.org>.
pussuw commented on code in PR #15444:
URL: https://github.com/apache/nuttx/pull/15444#discussion_r1908762773
##########
arch/arm/src/common/Toolchain.defs:
##########
@@ -546,10 +546,14 @@ ifeq ($(CONFIG_PIC),y)
# Generate an executable elf, need to ignore undefined symbols
LDELFFLAGS += --unresolved-symbols=ignore-in-object-files --emit-relocs
else
- LDELFFLAGS += -r
+ ifneq ($(CONFIG_BINFMT_ELF_EXECUTABLE),y)
+ LDELFFLAGS += -r
+ endif
endif
-LDELFFLAGS += -e main -T $(call CONVERT_PATH,$(TOPDIR)$(DELIM)libs$(DELIM)libc$(DELIM)modlib$(DELIM)gnu-elf.ld)
+ifneq ($(CONFIG_BINFMT_ELF_EXECUTABLE),y)
+ LDELFFLAGS += -e main -T $(call CONVERT_PATH,$(TOPDIR)$(DELIM)libs$(DELIM)libc$(DELIM)modlib$(DELIM)gnu-elf.ld)
Review Comment:
Isn't the linker script board specific data anyway, why must we change (or for that matter, have) anything in the common modlib folder, I don't understand ?
I presume the linker file in the modlib folder is there as an example, not intended for production use in any case.
I question the motivation to have this change at all in upstream.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] modlib: preprocess gnu-elf.ld for executable ELF [nuttx]
Posted by "yf13 (via GitHub)" <gi...@apache.org>.
yf13 commented on code in PR #15444:
URL: https://github.com/apache/nuttx/pull/15444#discussion_r1911923820
##########
libs/libc/Makefile:
##########
@@ -183,6 +183,10 @@ context:: bin kbin
ifeq ($(CONFIG_LIBC_ZONEINFO_ROMFS),y)
$(Q) $(MAKE) -C zoneinfo context BIN=$(BIN)
endif
+ifeq ($(CONFIG_LIBC_MODLIB),y)
Review Comment:
more investigation is needed for doing it in cmake system. can we add it later?
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] modlib: preprocess gnu-elf.ld for executable ELF [nuttx]
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 merged PR #15444:
URL: https://github.com/apache/nuttx/pull/15444
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] arm/qemu-armv7a: add EXE apps support [nuttx]
Posted by "yf13 (via GitHub)" <gi...@apache.org>.
yf13 commented on PR #15444:
URL: https://github.com/apache/nuttx/pull/15444#issuecomment-2574560187
Seems that CI is blocked by issue similar to #15441?
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] modlib: preprocess gnu-elf.ld for executable ELF [nuttx]
Posted by "lupyuen (via GitHub)" <gi...@apache.org>.
lupyuen commented on PR #15444:
URL: https://github.com/apache/nuttx/pull/15444#issuecomment-2586224570
@yf13 Can you also try `static char` instead of `static const char`? They show different results for knsh64:
```c
static char test_static[] = "Testing Static Var";
static const char test_static_const[] = "Testing Static Const Var";
int main(int argc, FAR char *argv[]) {
printf("test_static=%s\n", test_static);
printf("Address of test_static=%p\n", test_static);
printf("test_static_const=%s\n", test_static_const);
printf("Address of test_static_const=%p\n", test_static_const);
test_static=
Address of test_static=0xc0100200
test_static_const=Testing Static Const Var
Address of test_static_const=0xc0001ee0
```
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] modlib: preprocess gnu-elf.ld for executable ELF [nuttx]
Posted by "yf13 (via GitHub)" <gi...@apache.org>.
yf13 commented on PR #15444:
URL: https://github.com/apache/nuttx/pull/15444#issuecomment-2586241199
I finally reproduced it here with `static char NAME[] = xxx`.
The issue looks like somehow initialized data section is not properly populated. I don't see how it relates to this PR as current rv-virt kernel build is still using board specific linker script.
I will spend time later on this and update if I have findings. Do you know if this PR is the first broken commit?
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] modlib: preprocess gnu-elf.ld for executable ELF [nuttx]
Posted by "lupyuen (via GitHub)" <gi...@apache.org>.
lupyuen commented on PR #15444:
URL: https://github.com/apache/nuttx/pull/15444#issuecomment-2586160111
Sorry again @yf13: Static Variables don't seem to work correctly for `rv-virt:knsh64`, wonder if there's a problem with the Linking of Static Vars?
Here's the code that prints a Static Var: [hello_main.c](https://github.com/lupyuen2/wip-nuttx-apps/blob/uname/examples/hello/hello_main.c#L31-L57)
```c
static char test_static[] = "Testing Static Var";
int main(int argc, FAR char *argv[]) {
printf("test_static=%s\n", test_static);
printf("Address of test_static=%p\n", test_static);
```
`rv-virt:knsh64` shows that the Static Var is incorrectly empty: [knsh64 Log](https://gist.github.com/lupyuen/75c326a01c5e9110cac56b6e47f1a85f#file-special-qemu-riscv-knsh64-log-L1427-L1436)
```text
nsh> hello
test_static=
Address of test_static=0xc0100200
```
`rv-virt:nsh64` shows that the Static Var is correctly non-empty: [nsh64 Log](https://gist.github.com/lupyuen/28517259f7c610dc3219093eb8ddd258#file-special-qemu-riscv-nsh64-log-L600-L609)
```text
nsh> hello
test_static=Testing Static Var
Address of test_static=0x8002d6d8
```
This might explain why `uname -a` for `rv-virt:knsh64` doesn't print the Commit Hash. Thanks!
```text
nsh> uname -a
NuttX 12.8.0 risc-v rv-virt
```
[knsh64 Log](https://gist.github.com/lupyuen/75c326a01c5e9110cac56b6e47f1a85f#file-special-qemu-riscv-knsh64-log-L1392-L1393)
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] modlib: preprocess gnu-elf.ld for executable ELF [nuttx]
Posted by "lupyuen (via GitHub)" <gi...@apache.org>.
lupyuen commented on PR #15444:
URL: https://github.com/apache/nuttx/pull/15444#issuecomment-2586251662
> Do you know if this PR is the first broken commit?
The problem doesn't happen for the commit just before this PR. Thanks for looking into this :-)
https://gist.github.com/lupyuen/21167b5ce4f2c2e8b23e2057dcefbe64
```text
$ git reset --hard be40c01ddd6f43a527abeae31042ba7978aabb58
HEAD is now at be40c01ddd6 nuttx/addrenv.h: revise assembly guard
NuttX Source: https://github.com/apache/nuttx/tree/be40c01ddd6f43a527abeae31042ba7978aabb58
NuttX Apps: https://github.com/apache/nuttx-apps/tree/04f0b8e19274ff65ad8744d4b5b37f522c0097c0
$ qemu-system-riscv64 -semihosting -M virt,aclint=on -cpu rv64 -kernel nuttx -nographic
NuttShell (NSH) NuttX-12.7.0
nsh> uname -a
NuttX 12.7.0 be40c01ddd6 Jan 13 2025 14:22:45 risc-v rv-virt
nsh> hello
test_static=Testing Static Var
Address of test_static=0xc0101000
test_static_const=Testing Static Const Var
Address of test_static_const=0xc0002058
Hello, World of NuttX!!
Address of NAME=0xc0002020
```
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] modlib: preprocess gnu-elf.ld for executable ELF [nuttx]
Posted by "lupyuen (via GitHub)" <gi...@apache.org>.
lupyuen commented on PR #15444:
URL: https://github.com/apache/nuttx/pull/15444#issuecomment-2588482648
Sorry @yf13 I don't quite understand, what are the exact steps I need to run to reproduce the Static Vars bug?
I'm not sure if the file type of `../apps/bin/hello` matters, so long as it works correctly with Static Vars?
Do we agree that https://github.com/apache/nuttx/commit/5076b0c74ccc280e4af6042219f6a5d07e78b7ac and https://github.com/apache/nuttx/pull/14064 are not faulty, since they tested OK with `rv-virt:knsh` and `rv-virt:knsh64`? Thanks :-)
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] modlib: preprocess gnu-elf.ld for executable ELF [nuttx]
Posted by "yf13 (via GitHub)" <gi...@apache.org>.
yf13 commented on PR #15444:
URL: https://github.com/apache/nuttx/pull/15444#issuecomment-2579753119
@acassis, the usage is rather simple: just enable BINFMT_ELF_EXECUTABLE config for a kernel build.
Actually this isn't new or specific to QEMU, I used it before for k230 devices, all canmv230 kernel mode have it enable by default, see pull/11513 for the old story.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] modlib: preprocess gnu-elf.ld for executable ELF [nuttx]
Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on PR #15444:
URL: https://github.com/apache/nuttx/pull/15444#issuecomment-2582918473
Hi yf13,
ELF works in flat mode as well:
https://www.youtube.com/watch?v=oL6KAgkTb8M
Unless some recent modification has changed it.
BR,
Alan
On Thu, Jan 9, 2025 at 8:33 PM yf13 ***@***.***> wrote:
> BTW, but you should create a board config demo and include it in the sim
> page
>
> @acassis <https://github.com/acassis> I am unsure if sim device has
> KERNEL build because existing defconfigs there are all for FLAT build. My
> current understanding is that executable ELFs depend on SYSCALL thus not
> proper for FLAT build?
>
> —
> Reply to this email directly, view it on GitHub
> <https://github.com/apache/nuttx/pull/15444#issuecomment-2581448585>, or
> unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAAJBCA3XJFJ236WFWXC2D32J4BM5AVCNFSM6AAAAABUXA6KQ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKOBRGQ2DQNJYGU>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] modlib: preprocess gnu-elf.ld for executable ELF [nuttx]
Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on PR #15444:
URL: https://github.com/apache/nuttx/pull/15444#issuecomment-2585241644
> @acassis, thanks.
>
> Here I tried `sim:elf`. by default ELF type is relocatable and it works.
>
> I then tried to blindly enable BINFMT_ELF_EXECUTABLE after selecting `ARCH_HAVE_ELF_EXECUTABLE` in arch/sim/Kconfig first, but the built ELFs in `../apps/examples/elf/tests/romfs` are still relocatable.
>
> So if there is a way to make executable ELFs for sim, please teach.
Hi YF, I never tried it on SIM, only did it on ARM (STM32) some years ago.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] modlib: preprocess gnu-elf.ld for executable ELF [nuttx]
Posted by "lupyuen (via GitHub)" <gi...@apache.org>.
lupyuen commented on PR #15444:
URL: https://github.com/apache/nuttx/pull/15444#issuecomment-2586226080
Hmmm which commit for NuttX and Apps are you using? Lemme try your branch. Thanks :-)
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] modlib: preprocess gnu-elf.ld for executable ELF [nuttx]
Posted by "yf13 (via GitHub)" <gi...@apache.org>.
yf13 commented on PR #15444:
URL: https://github.com/apache/nuttx/pull/15444#issuecomment-2586225053
I removed the `const` modifier and tried on knsh64, also works:
```bash
$ git diff examples/hello
diff --git a/examples/hello/hello_main.c b/examples/hello/hello_main.c
index 2cd6cb400..270f3f453 100644
--- a/examples/hello/hello_main.c
+++ b/examples/hello/hello_main.c
@@ -28,6 +28,7 @@
/****************************************************************************
* Public Functions
****************************************************************************/
+static char *NAME = "NuttX";
/****************************************************************************
* hello_main
@@ -35,6 +36,6 @@
int main(int argc, FAR char *argv[])
{
- printf("Hello, World!!\n");
+ printf("Hello, World of %s!!\n", NAME);
return 0;
}
$ cd ../nuttx
$ qemu-system-riscv64 -M virt,aclint=on -semihosting -nographic -kernel nuttx
nsh> hello
Hello, World of NuttX!!
```
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] arm/qemu-armv7a: add EXE apps support [nuttx]
Posted by "nuttxpr (via GitHub)" <gi...@apache.org>.
nuttxpr commented on PR #15444:
URL: https://github.com/apache/nuttx/pull/15444#issuecomment-2574491389
[**\[Experimental Bot, please feedback here\]**](https://github.com/search?q=repo%3Aapache%2Fnuttx+13552&type=issues)
Yes, this PR appears to meet the basic NuttX requirements, although it could be more thorough. While it addresses the key points, it lacks specific details in several areas which would make review easier.
Here's a breakdown:
**Strengths:**
* **Clear Summary:** The summary explains the *what* and *why* of the change, and the benefit (smaller size, easier debugging).
* **Identifies Impacted Area:** Correctly identifies the impact as hardware-specific (qemu-armv7a).
* **Mentions Testing:** Indicates testing was performed locally and that CI checks are expected.
**Weaknesses:**
* **Missing Detail in Summary:** The *how* is somewhat vague. It states "allows apps... to be built as executable type ELF files," but doesn't explain the mechanism of the change. What was modified to achieve this?
* **Impact Lacks Detail:** The impact section needs significant expansion. While "qemu-armv7a" is mentioned, it doesn't specify whether other ARM architectures or boards are affected. All other impact categories are simply omitted (user impact, build process, documentation, security, compatibility). These should be explicitly stated as "NO" or "YES" with explanations.
* **Insufficient Testing Information:** "Local checks" and "CI checks" are too general. The PR needs specific details about the host system (OS version, compiler version). The target information is slightly better but should specify the NuttX configuration used. Most importantly, the "Testing logs before change" and "Testing logs after change" sections are empty. These are crucial for demonstrating the change's effect and should include relevant output showing the difference in behavior.
**Recommendation:**
The PR author should add the missing details to strengthen it. Specifically:
* **Summary:** Elaborate on the *how*. What files were changed? What build system modifications were made?
* **Impact:** Address *all* impact categories. Even if the answer is "NO," it should be explicitly stated. For "hardware," be more specific about affected architectures/boards.
* **Testing:** Provide detailed host and target information. Include actual log output demonstrating the change's effect (e.g., file sizes before/after, GDB debugging experience comparison). If logs are extensive, consider linking to a separate file or using a diff tool.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] arm/qemu-armv7a: add EXE apps support [nuttx]
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #15444:
URL: https://github.com/apache/nuttx/pull/15444#discussion_r1904978604
##########
arch/arm/src/common/Toolchain.defs:
##########
@@ -546,10 +546,14 @@ ifeq ($(CONFIG_PIC),y)
# Generate an executable elf, need to ignore undefined symbols
LDELFFLAGS += --unresolved-symbols=ignore-in-object-files --emit-relocs
else
- LDELFFLAGS += -r
+ ifneq ($(CONFIG_BINFMT_ELF_EXECUTABLE),y)
+ LDELFFLAGS += -r
+ endif
endif
-LDELFFLAGS += -e main -T $(call CONVERT_PATH,$(TOPDIR)$(DELIM)libs$(DELIM)libc$(DELIM)modlib$(DELIM)gnu-elf.ld)
+ifneq ($(CONFIG_BINFMT_ELF_EXECUTABLE),y)
+ LDELFFLAGS += -e main -T $(call CONVERT_PATH,$(TOPDIR)$(DELIM)libs$(DELIM)libc$(DELIM)modlib$(DELIM)gnu-elf.ld)
Review Comment:
can we share the same gnu-elf.ld for relacation and exeutable?
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] modlib: preprocess gnu-elf.ld for executable ELF [nuttx]
Posted by "yf13 (via GitHub)" <gi...@apache.org>.
yf13 commented on PR #15444:
URL: https://github.com/apache/nuttx/pull/15444#issuecomment-2588562920
I am hesitate to hide the issue, please allow more investigation, we'd better find the root cause.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org