build system: add COMPILER_SAVE_RESTORE_LIBCALLS option

Add new Kconfig option to enable -msave-restore flag for RISC-V
targets. This option can be used to reduce binary size by replacing
inlined register save/restore sequences with library calls.
This commit is contained in:
Ivan Grokhotkov
2021-08-18 12:02:20 +05:00
parent bb15aa48a0
commit 95ee8104bf
4 changed files with 19 additions and 0 deletions
+4
View File
@@ -61,6 +61,10 @@ else()
list(APPEND link_options "-fno-rtti") # used to invoke correct multilib variant (no-rtti) during linking
endif()
if(CONFIG_COMPILER_SAVE_RESTORE_LIBCALLS)
list(APPEND compile_options "-msave-restore")
endif()
if(CONFIG_COMPILER_DISABLE_GCC8_WARNINGS)
list(APPEND compile_options "-Wno-parentheses"
"-Wno-sizeof-pointer-memaccess"