boards: native: add support for static linking
Add support for static linking of the final native simulator runner. Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This commit is contained in:
committed by
Alberto Escolar
parent
c11ae6b6b2
commit
9186d6864a
@@ -13,6 +13,10 @@ if(SYSROOT_DIR)
|
||||
target_link_options(native_simulator INTERFACE "--sysroot=${SYSROOT_DIR}")
|
||||
endif()
|
||||
|
||||
if(CONFIG_NATIVE_SIMULATOR_STATIC_LINKING)
|
||||
target_link_options(native_simulator INTERFACE "-static")
|
||||
endif()
|
||||
|
||||
if("${LINKER}" STREQUAL "lld")
|
||||
target_link_options(native_simulator INTERFACE "-fuse-ld=lld")
|
||||
endif()
|
||||
|
||||
@@ -48,4 +48,11 @@ config NATIVE_SIMULATOR_AUTOSTART_MCU
|
||||
If that MCU was, by HW design, going to start at HW boot anyhow, this option does nothing.
|
||||
This option is meant to facilitate development.
|
||||
|
||||
config NATIVE_SIMULATOR_STATIC_LINKING
|
||||
bool "Attempt to use static linking"
|
||||
help
|
||||
Do not link the final native simulator runner with shared libraries.
|
||||
|
||||
Static linking depends on all required libraries being available as static libraries.
|
||||
|
||||
endif # SOC_POSIX
|
||||
|
||||
Reference in New Issue
Block a user