cmake: linker: ld: fix duplicate LINK_FLAGS
Original implementation of `toolchain_linker_finalize` duplicates the `LINK_FLAGS` in the link command. This can cause some problems like duplicate definitions when using link options like `--whole-archive`. This commit fixes it by removing the duplicate `LINK_FLAGS`. Fixes #82281 Signed-off-by: Axel Le Bourhis <axel.lebourhis@nxp.com>
This commit is contained in:
parent
1a0c852e0d
commit
841311330b
1 changed files with 1 additions and 1 deletions
|
@ -156,7 +156,7 @@ macro(toolchain_linker_finalize)
|
|||
endforeach()
|
||||
string(REPLACE ";" " " zephyr_std_libs "${zephyr_std_libs}")
|
||||
|
||||
set(link_libraries "<LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES> ${zephyr_std_libs}")
|
||||
set(link_libraries "<OBJECTS> -o <TARGET> <LINK_LIBRARIES> ${zephyr_std_libs}")
|
||||
set(common_link "<LINK_FLAGS> ${link_libraries}")
|
||||
|
||||
set(CMAKE_ASM_LINK_EXECUTABLE "<CMAKE_ASM_COMPILER> <FLAGS> <CMAKE_ASM_LINK_FLAGS> ${common_link}")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue