casaroli opened a new pull request, #21523: URL: https://github.com/apache/nuttx/pull/21523
## Summary `libs/libc/dlfcn/Make.defs` builds `lib_dladdr.c` with `CONFIG_LIBC_DLFCN`. `CMakeLists.txt` does not list it. A program that calls `dladdr()` links with make, and the CMake build fails: ``` apps/examples/hello/hello_main.c:15:(.text.hello_main+0x2c): undefined reference to `dladdr' collect2: error: ld returned 1 exit status ``` This PR adds the file to the list. ## Impact Only CMake builds with `CONFIG_LIBC_DLFCN`. libc gets one more function, which is a stub: it returns 0 and sets `ENOTSUP`, as in the make build. No change for make builds. No architecture code. No flat-build API change. Documentation: `Documentation/standards/posix.rst` already says `dladdr` is supported, so no change. ## Testing CMake builds on master bf029a2ef5d and on this branch. The test program calls `dladdr()` and replaces `examples/hello/hello_main.c` for the run; it is not in apps. | Config | master bf029a2ef5d | this branch | |---|---|---| | `qemu-armv8a:nsh` (flat, aarch64 GCC 14.2), HVF | link fails: `undefined reference to dladdr` | builds; run: `dladdr() = 0 errno 138` (`ENOTSUP`) | | `qemu-armv8a:knsh` (kernel) | builds; `libc.a` has no `dladdr` | builds; `libc.a` has `dladdr`; not run | | `rv-virt:pnsh64` (protected, RISC-V GCC 14.3) | builds; `libc.a` has no `dladdr` | builds; `libc.a` has `dladdr`; not run | The kernel and protected builds show the change with `nm` on `libc.a`. These two builds did not show the link failure on master, and I did not run them. `mps2-an500:knsh` does not configure with CMake on master or on this branch, because the board has no `kernel/CMakeLists.txt`. Other compilers: not built; the change is a file list. This is a build fix, so no new test in apps. `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]
