casaroli opened a new pull request, #21417: URL: https://github.com/apache/nuttx/pull/21417
## Summary net/socket builds `getsockopt.c` and `setsockopt.c` only with `CONFIG_NET_SOCKOPTS`, but `include/sys/syscall_lookup.h` lists both system calls with `CONFIG_NET`, and `syscall/syscall.csv` makes the `getsockopt()` stub and proxy with `CONFIG_NET` (`setsockopt()` already has `CONFIG_NET_SOCKOPTS` there). So a protected or a kernel build with `CONFIG_NET` and without `CONFIG_NET_SOCKOPTS` does not link: ``` syscall/stubs/STUB_getsockopt.c:14: undefined reference to `getsockopt' staging/libstubs.a(syscall_stublookup.o):(.rodata.g_stublookup+0x4a8): undefined reference to `STUB_setsockopt' ``` This PR lists both system calls only with `CONFIG_NET_SOCKOPTS`, as the flat build has the two functions only with that option. ## Impact Protected and kernel builds with `CONFIG_NET` and without `CONFIG_NET_SOCKOPTS` link now. Builds with `CONFIG_NET_SOCKOPTS` do not change. A user program of such a build that calls `getsockopt()` or `setsockopt()` fails to link, as in a flat build; before this PR the whole build failed. Flat builds do not change. No documentation describes this. ## Testing Builds with `EXTRAFLAGS="-Wno-cpp -Werror"`, each with `CONFIG_NET`, `CONFIG_NET_TCP`, `CONFIG_NET_UDP`, `CONFIG_NET_IPv4`, `CONFIG_NET_LOOPBACK`, `CONFIG_NETDEV_LATEINIT`, `CONFIG_SCHED_HPWORK`: | Config | `NET_SOCKOPTS` | master 6569424cfa6 | this PR | |---|---|---|---| | qemu-armv8a:knsh (kernel, arm64) | n | link FAIL (the two errors above) | OK | | rv-virt:pnsh64 (protected, rv64) | n | link FAIL (the same) | OK | | qemu-armv8a:knsh | y | | OK | | rv-virt:pnsh64 | y | | OK | | qemu-armv8a:nsh (flat) | n | | OK | `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]
