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
parent
f8080bc73b
commit
a2df917974
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -166,3 +166,9 @@ int main() {
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// make lto happy...
|
||||
extern "C" void __cxa_pure_virtual() {
|
||||
while (1)
|
||||
;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue