8000 {bare-arm,minimal,stm32}/mpconfigport.h: Disable super-optimisations. · micropython/micropython@62fbbe0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 62fbbe0

Browse files
committed
{bare-arm,minimal,stm32}/mpconfigport.h: Disable super-optimisations.
bare-arm, minimal, and stm32-on-CM0 used to disable `CSUPEROPT`. This re-instates this behavior by disabling `MICROPY_APPLY_COMPILER_OPTIMISATIONS` instead. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
1 parent 548187f commit 62fbbe0

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

ports/bare-arm/mpconfigport.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
// Python internal features
3838
#define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_NONE)
3939

40+
// Just use -Os for everything to generate the smallest possible binary.
41+
#define MICROPY_APPLY_COMPILER_EXTRA_OPTIMISATIONS(f) f
42+
4043
// Type definitions for the specific machine
4144

4245
typedef int32_t mp_int_t; // must be pointer size

ports/minimal/mpconfigport.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
// Use the minimum headroom in the chunk allocator for parse nodes.
2222
#define MICROPY_ALLOC_PARSE_CHUNK_INIT (16)
2323

24+
// Just use -Os for everything to generate the smallest possible binary.
25+
#define MICROPY_APPLY_COMPILER_EXTRA_OPTIMISATIONS(f) f
26+
2427
// type definitions for the specific machine
2528

2629
typedef intptr_t mp_int_t; // must be pointer size

ports/stm32/mpconfigport.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@
5555
#define MICROPY_OPT_MAP_LOOKUP_CACHE (__CORTEX_M > 0)
5656
#endif
5757

58+
#if __CORTEX_M == 0
59+
// Just use -Os for everything to avoid using extra flash. Using M0 as a stand-in
60+
// for "likely has small flash", this could be moved to the board config instead.
61+
#define MICROPY_APPLY_COMPILER_EXTRA_OPTIMISATIONS(f) f
62+
#endif
63+
5864
// emitters
5965
#define MICROPY_PERSISTENT_CODE_LOAD (1)
6066
#ifndef MICROPY_EMIT_THUMB

0 commit comments

Comments
 (0)
0