diff --git a/CMakeLists.txt b/CMakeLists.txt index 8aca20e..c18db27 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 diff --git a/src/main.cpp b/src/main.cpp index b37af1b..44a4f75 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -166,3 +166,9 @@ int main() { } return 0; } + +// make lto happy... +extern "C" void __cxa_pure_virtual() { + while (1) + ; +}