-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Changes to allow different compiler optimizations per board #3190
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
Changes from 6 commits
ac5ad03
49decf9
db5c3c9
39e01c3
2aef9b0
d83a4ac
778e8bf
c937fa1
ce37a44
204cdad
b9cdf19
a14101c
739981b
3dfed3c
d9503e5
c481796
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
+ − | font/font.bmp | |
+88 −9 | pewpew_m4/pew.py | |
+2 −2 | pybadge/ugame.py | |
+119 −117 | stage.py |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,4 @@ LONGINT_IMPL = MPZ | |
CIRCUITPY_AUDIOBUSIO = 0 | ||
|
||
CIRCUITPY_BITBANG_APA102 = 1 | ||
OPTIMIZATION_LEVEL = 2 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of adding this flag for individual boards, I think it would make sense to do -O2 by default for all SAMD51 and nRF52 Express boards. There may be space problems on non-Express boards. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dhalbert See comment below. I think we will need to implement this on a board-by-board basis. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we can always use INTERNAL_FLASH_FILESYSTEM = 1 as a guide. There is at least one board (sam32) that has that set but has 1M of flash (i.e. plenty for the 10% size increase). And,as future chips may well fall into that same category. I would consider it safer to have a separate flag. Also, the non_SAMD chips need to be considered as well. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,6 +109,11 @@ else | |
### CFLAGS += -flto | ||
endif | ||
|
||
# option to override compiler optimization level, set in boards/$(BOARD)/mpconfigboard.mk | ||
ifdef OPTIMIZATION_LEVEL | ||
CFLAGS += -O$(OPTIMIZATION_LEVEL) | ||
endif | ||
|
||
CFLAGS += $(INC) -Werror -Wall -mlongcalls -std=gnu11 -Wl,--gc-sections $(BASE_CFLAGS) $(C_DEFS) $(CFLAGS_MOD) $(COPT) | ||
|
||
LDFLAGS = $(CFLAGS) -Wl,-nostdlib -Wl,[email protected] -Wl,-cref | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,4 @@ CIRCUITPY_ESP_FLASH_FREQ=40m | |
CIRCUITPY_ESP_FLASH_SIZE=4MB | ||
|
||
CIRCUITPY_MODULE=wroom | ||
OPTIMIZATION_LEVEL = 2 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,5 @@ EXTERNAL_FLASH_DEVICES = "GD25Q16C" | |
# We use a CFLAGS define here because there are include order issues | ||
# if we try to include "mpconfigport.h" into nrfx_config.h . | ||
CFLAGS += -DCIRCUITPY_NRF_NUM_I2C=2 | ||
|
||
OPTIMIZATION_LEVEL = 2 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe this is left-over from the first version of this PR and can be removed. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,5 @@ LD_COMMON = boards/common_default.ld | |
LD_DEFAULT = boards/STM32F405_default.ld | ||
LD_BOOT = boards/STM32F405_boot.ld # UF2 boot option | ||
UF2_OFFSET = 0x8010000 | ||
|
||
OPTIMIZATION_LEVEL = 2 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Leftover? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't the CFLAGS from lines 90, 97 and 104 interfere with this?