CV-Bowen opened a new pull request, #21081:
URL: https://github.com/apache/nuttx/pull/21081
## Summary
`openamp/open-amp.cmake` and `openamp/libmetal.cmake` build open-amp and
libmetal differently from `open-amp.defs`/`libmetal.defs`. Make the CMake
build match:
- `VQ_RX_EMPTY_NOTIFY`: the Make build defines it to 1; CMake left open-amp's
`WITH_VQ_RX_EMPTY_NOTIFY` option at its default OFF.
- `safe_strcpy`: the Make build renames it to `openamp_safe_strcpy` so it
cannot clash with another library's `safe_strcpy`; CMake did not, and
such a link fails with "multiple definition of safe_strcpy".
- default logger: the Make build does not define `DEFAULT_LOGGER_ON`, so
`metal_default_log_handler()` prints nothing; CMake kept libmetal's
`WITH_DEFAULT_LOGGER` at its default ON, which formats into a 1 KiB stack
buffer and `fprintf()`s to stderr.
- `VIRTIO_DEVICE_SUPPORT`/`VIRTIO_DRIVER_SUPPORT`: CMake defined them with
`add_compile_definitions()` while open-amp's own CMake also defines them
from `WITH_VIRTIO_DEVICE`/`WITH_VIRTIO_DRIVER` (default ON), so with
`CONFIG_OPENAMP_VIRTIO_DEVICE_SUPPORT` or `_DRIVER_SUPPORT` off the two
definitions disagreed. Set the open-amp options from Kconfig instead.
Also, for the TASKING toolchain, give libmetal's object files unique names:
its archiver (`artc`) cannot hold two objects with the same name, and
libmetal has several (`log.c`, `io.c`, `init.c`, ... in both `lib/` and
`lib/system/nuttx/`).
## Impact
CMake builds of openamp/libmetal only (`openamp/*.cmake`); the Make build
is unchanged. No Kconfig change.
## Testing
Host: Ubuntu 22.04.5 LTS x86_64, QEMU version 10.2.1, sim: cc (Ubuntu
13.1.0-8ubuntu1~22.04) 13.1.0, qemu-armv8a: aarch64-none-elf-gcc (Arm GNU
Toolchain 12.2.Rel1 (Build arm-12.24)) 12.2.1 20221205
The baseline below builds sim and qemu-armv8a with CMake, so open-amp
and libmetal are compiled with these settings and the rpmsg cases run
on top of them. The `metal_log()` output (for example the
`rpmsg_port queue RX/TX` lines that `rpmsg dump all` prints on
qemu-armv8a) is identical before and after, since NuttX does not route
it through libmetal's default handler.
Baseline (`test.sh`, cases: baseline.yaml):
- host: Ubuntu 22.04.5 LTS x86_64, QEMU version 10.2.1, sim: cc (Ubuntu
13.1.0-8ubuntu1~22.04) 13.1.0, qemu-armv8a: aarch64-none-elf-gcc (Arm GNU
Toolchain 12.2.Rel1 (Build arm-12.24)) 12.2.1 20221205
- tested: nuttx 71f2d2d4078 apps 5f1100d02
- qemu-armv8a built with test-only overlay: disabled LIBC_ENVPATH
BINFMT_CHECKEXEC
- sim:rpserver + sim:rpproxy: PASS
- [x] `uname -a` (server)
- [x] `rpmsg dump all` (server)
- [x] `rpmsg ping all 10 1024 3 0` (server)
- [x] `uname -a` (proxy)
- [x] `rpmsg ping all 10 1024 3 0` (proxy)
- [x] `mount -t rpmsgfs -o cpu=server,fs=/proc /sp` (proxy)
- [x] `cat /sp/version` (proxy)
- [x] `rpmsg dump all` (proxy)
- qemu-armv8a:rpserver + qemu-armv8a:rpproxy: PASS
- [x] `uname -a` (server)
- [x] `uname -a` (proxy)
- [x] `rpmsg dump all` (server)
- [x] `rpmsg ping all 10 1024 3 0` (server)
- [x] `rpmsg ping all 10 1024 3 0` (proxy)
- [x] `mount -t rpmsgfs -o cpu=server,fs=/proc /sp` (proxy)
- [x] `cat /sp/version` (proxy)
--
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]