keepkey/keepkey-firmware

ROM size: misc gcc flags

Opened this issue · 0 comments

Some misc gcc flags that save around 2k:

diff --git a/cmake/caches/device.cmake b/cmake/caches/device.cmake
index 436a23bc..9f4014b5 100644
--- a/cmake/caches/device.cmake
+++ b/cmake/caches/device.cmake
@@ -22,7 +22,13 @@ set(ARCH_FLAGS
     -msoft-float \
     -ffunction-sections \
     -fdata-sections \
-    -fno-common \
+    -fno-exceptions \
+    -fno-unwind-tables \
+    -fno-math-errno \
+    -fcommon \
+    -fno-zero-initialized-in-bss \
+    -fmerge-constants \
+    -fmerge-all-constants \
     -fstack-protector-all" CACHE STRING "")
 
 set(WARN_FLAGS

TODO: check validity on each of these. -fno-zero-initialized-in-bss could, for example, change behavior if assumptions are violated.