cmake: only allow gold linker for posix builds

- the gold linker doesn't currently work for NuttX builds
 - NuttX skip --print-memory-usage if using the GOLD linker
 - fixes #15400
This commit is contained in:
Daniel Agar
2020-07-22 10:23:37 -04:00
parent 7ac66bae4f
commit 9426c68a13
2 changed files with 19 additions and 14 deletions

View File

@@ -124,7 +124,6 @@ target_link_libraries(px4 PRIVATE
-Wl,-Map=${PX4_CONFIG}.map
-Wl,--warn-common
-Wl,--gc-sections
-Wl,--print-memory-usage
-Wl,--start-group
${nuttx_libs}
@@ -134,6 +133,10 @@ target_link_libraries(px4 PRIVATE
gcc
)
if(NOT USE_LD_GOLD)
target_link_libraries(px4 PRIVATE -Wl,--print-memory-usage)
endif()
target_link_libraries(px4 PRIVATE ${module_libraries})
if (config_romfs_root)