Skip to content

ROM size: misc gcc flags #205

@keepkeyjon

Description

@keepkeyjon

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ROM sizeIssues pertaining to ROM size optimizations

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions