-
Notifications
You must be signed in to change notification settings - Fork 241
Open
Labels
CCB:ReadyPull request is ready for discussion at the Configuration Control Board (CCB)Pull request is ready for discussion at the Configuration Control Board (CCB)
Description
Describe the bug
The lwIP network stack, compatible with RTEMS, does not support either gethostid() and gethostname() calls. If the OSAL networking module is included then the build will fail to link the module with undefined reference to gethostname and gethostid errors.
To Reproduce
Steps to reproduce the behavior:
- Build cFS and link with rtems-lwip (-llwip) network library
Expected behavior
To mitigate the undefined reference build errors:
- Replace the the default os-impl-network.c module with '../portable/os-impl-no-network-gethostid.c' and '../portable/os-impl-no-network-gethostid.c'
- Comment out linking the RTEMS networking library
FROM:
osal/src/os/rtems/CMakeLists.txt
Lines 58 to 83 in 3bcb137
# Leverage the "standard" BSD socket code if network is enabled if (OSAL_CONFIG_INCLUDE_NETWORK) list(APPEND RTEMS_IMPL_SRCLIST src/os-impl-network.c ../portable/os-impl-bsd-sockets.c ../portable/os-impl-bsd-select.c ) # In RTEMS 6+ the networking subsystem is not included with the default libs, # it needs to be explicitly added to the final link. Note the "VERSION_GREATER_EQUAL" # operation was not added until CMake 3.7, so this uses not "VERSION_LESS" instead. if(NOT CMAKE_SYSTEM_VERSION VERSION_LESS 6.0) target_link_libraries(osal_public_api INTERFACE networking ) endif() else() list(APPEND RTEMS_IMPL_SRCLIST ../portable/os-impl-no-network.c ../portable/os-impl-no-sockets.c ../portable/os-impl-no-select.c ) endif () # Defines an OBJECT target named "osal_rtems_impl" with selected source files add_library(osal_rtems_impl OBJECT
TO:
# Leverage the "standard" BSD socket code if network is enabled
if (OSAL_CONFIG_INCLUDE_NETWORK)
list(APPEND RTEMS_IMPL_SRCLIST
../portable/os-impl-no-network-gethostid.c
../portable/os-impl-no-network-gethostname.c
../portable/os-impl-bsd-sockets.c
../portable/os-impl-bsd-select.c
)
# In RTEMS 6+ the networking subsystem is not included with the default libs,
# it needs to be explicitly added to the final link. Note the "VERSION_GREATER_EQUAL"
# operation was not added until CMake 3.7, so this uses not "VERSION_LESS" instead.
if(NOT CMAKE_SYSTEM_VERSION VERSION_LESS 6.0)
target_link_libraries(osal_public_api INTERFACE
# networking
)
endif()
else()
list(APPEND RTEMS_IMPL_SRCLIST
../portable/os-impl-no-network-gethostid.c
../portable/os-impl-no-network-gethostname.c
../portable/os-impl-no-sockets.c
../portable/os-impl-no-select.c
)
endif ()
System observed on:
- Hardware: VirtualBox
- OS: Ubuntu 24.04, GCC 13.3
- Versions: cFS equulues-rc1, rtems 6.1, rtems-lwip 6.1
Reporter Info
Mark Foster
NASA / Johnson Space Center / ER6
Metadata
Metadata
Assignees
Labels
CCB:ReadyPull request is ready for discussion at the Configuration Control Board (CCB)Pull request is ready for discussion at the Configuration Control Board (CCB)