Enable LTO

shaves off ~10% of the code size which is very nice ... also some RAM, but we are not short on RAM in this case.
pull/185/head
D.R.racer 2022-06-18 01:33:25 +02:00
parent f8080bc73b
commit a2df917974
2 changed files with 7 additions and 0 deletions

View File

@ -143,6 +143,7 @@ if(CMAKE_CROSSCOMPILING)
#]]
# limit the text section to 28K (32K - 4k reserved for the bootloader)
set_target_properties(firmware PROPERTIES INTERPROCEDURAL_OPTIMIZATION True)
target_link_options(firmware PUBLIC -Wl,--defsym=__TEXT_REGION_LENGTH__=28K)
# generate firmware.bin file

View File

@ -166,3 +166,9 @@ int main() {
}
return 0;
}
// make lto happy...
extern "C" void __cxa_pure_virtual() {
while (1)
;
}