casaroli opened a new pull request, #3803:
URL: https://github.com/apache/nuttx-apps/pull/3803
depends-on: [apache/nuttx/pull/20377]
## Summary
`apps/examples/nxflat/tests` carries nine test modules and the Makefile
built three of them, under a comment saying "Most of these do no build yet".
Eight build and convert: `errno`, `hello`, `longjmp`, `mutex`, `pthread`,
`signal`, `struct` and `task`. Between them they cover a function pointer in
D-Space, a callback from the firmware, a non-local return, threads, task
creation and thread-local `errno`. What had kept most of them out was
read-only data reached PC-relative, which apache/nuttx#20377 makes the tree
compile GOT-relative.
`BUILD_SUBDIRS` was assigned and never read, so `mutex`, `pthread` and
`task` were left out of the build even where the configuration allowed them.
The conditionals now append to `SUBDIRS`, which is the variable the recipes
walk.
`longjmp` is built only where `CONFIG_ARCH_SETJMP_H` is set. The module
imports `setjmp()` and `longjmp()`, which reach it through the symbol table the
firmware exports, and the firmware carries them only when it supplies its own
implementation. Without the guard the kernel link fails on two undefined
references, which is a poor way to learn it.
`install -D` is a GNU extension. The BSD `install` that macOS carries has
no such option and fails the build of every module with its usage message.
`mkdir -p` does that part, and the mode the recipe wanted is now explicit
rather than implied.
`hello++` stays out. Two of its four modules convert, the third needs
`R_ARM_TARGET1` from the converter, which apache/nuttx#20377 adds, and the
fourth needs an `iostream`.
## Impact
No configuration in this repository selects these modules;
`CONFIG_EXAMPLES_NXFLAT` does, and only the boards that set it are affected.
A board that sets `CONFIG_EXAMPLES_NXFLAT` now puts eight modules in its
ROMFS rather than three, so the image grows by roughly 9 KB.
## Testing
`lm3s6965-ek:qemu-nxflat`, both ways round the `longjmp` guard.
With `CONFIG_ARCH_SETJMP_H` off, the ROMFS holds the other seven modules and
the image links, where before it failed on `setjmp` and `longjmp`.
With it on, all eight run under `qemu-system-arm -M lm3s6965evb`:
```
* Executing errno / hello / longjmp / mutex / pthread / signal / struct /
task
main: SUCCESS: setjmp return from longjmp call
pf = 0x13335 (vs 0x13335) PASS
In dummyfunc() -- PASS
End-of-Test.. Exit-ing
```
Built with `install` from BSD rather than GNU, which is what made the
portability fix necessary.
`tools/checkpatch.sh -c -u -m -g` passes.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]