Skip to content

Improve C library linking when using gcc #56924

@tejlmand

Description

@tejlmand

Is your enhancement proposal related to a problem? Please describe.
The PR #51949 improve the linking of toolchain C library here:

zephyr/CMakeLists.txt

Lines 598 to 599 in bc53280

get_property(LIBC_LINK_LIBRARIES TARGET zephyr_interface PROPERTY LIBC_LINK_LIBRARIES)
zephyr_link_libraries(${LIBC_LINK_LIBRARIES})

although an improvement, it still has associated risks, see: #51949 (comment)

Describe the solution you'd like

Improve the Zephyr CMake build system, perhaps CMAKE_[C,CXX,ASM]_LINK_EXECUTABLE should be adjusted instead to ensure correct behavior.
This is something generally not needed for gcc, but might be best choice in this particular case.

Describe alternatives you've considered
Nona

Additional context
None

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions