txy-21 opened a new pull request, #18330:
URL: https://github.com/apache/nuttx/pull/18330
# Summary
This PR introduces two enhancements to improve library compatibility and fix
header dependencies in NuttX.
**Why:**
1. The rexec() function requires conditional header inclusion to support
different build configurations (kernel vs. flat builds)
2. ARM64 architecture timer implementation was missing the kmalloc.h header
dependency, causing potential compilation issues
**What changed:**
1. **libc: Add library support for rexec**
- Modified header inclusion logic in lib.h to conditionally include
kmalloc.h for kernel builds and stdlib.h for flat builds
- Added CONFIG_FILE_STREAM guard for fs/fs.h inclusion
- Enhanced netdb functions (getaddrinfo, gethostentbynamer) to support
rexec scenarios
- Updated streams.h for rexec stream support
2. **arm64: Add kmalloc header for arch timer**
- Added missing nuttx/kmalloc.h include to arm64_arch_timer.c
# Impact
**Scope:**
- **libc/netdb**: Enhanced compatibility for remote execution functionality
- **ARM64 architecture**: Fixed header dependency in timer subsystem
- **Build configurations**: Improved support for CONFIG_BUILD_FLAT and
CONFIG_FILE_STREAM configurations
**Affected components:**
- `include/nuttx/lib/lib.h`
- `include/nuttx/streams.h`
- `libs/libc/netdb/lib_getaddrinfo.c`
- `libs/libc/netdb/lib_gethostentbynamer.c`
- `libs/libc/netdb/lib_netdb.h`
- `arch/arm64/src/common/arm64_arch_timer.c`
**Breaking changes:** None
**Backward compatibility:** Fully maintained
# Testing
**Build testing:**
- Configurations tested:
- CONFIG_BUILD_FLAT=y
- CONFIG_BUILD_KERNEL=y
- CONFIG_FILE_STREAM=y/n combinations
- Architectures verified:
- ARM64 builds with arch timer enabled
- Multi-architecture compatibility check
**Functional testing:**
- ARM64 timer functionality verified on target hardware
- Network database functions (getaddrinfo, gethostbyname) tested with rexec
scenarios
- No regression observed in existing functionality
**Compilation:**
```bash
# ARM64 configuration
./tools/configure.sh <board>:<config>
make clean && make
# Build successful with no warnings
--
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]