Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ROM size: misc gcc flags #205

Open
keepkeyjon opened this issue Jan 7, 2020 · 0 comments
Open

ROM size: misc gcc flags #205

keepkeyjon opened this issue Jan 7, 2020 · 0 comments
Labels
ROM size Issues pertaining to ROM size optimizations

Comments

@keepkeyjon
Copy link
Contributor

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.

@keepkeyjon keepkeyjon added the ROM size Issues pertaining to ROM size optimizations label Jan 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ROM size Issues pertaining to ROM size optimizations
Projects
None yet
Development

No branches or pull requests

1 participant