Skip to content

Commit

Permalink
🔨 Build flag tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Dec 22, 2023
1 parent 2c5468c commit ec7ab5a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
11 changes: 6 additions & 5 deletions Marlin/src/core/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@
#define FORCE_INLINE __attribute__((always_inline)) inline
#define NO_INLINE __attribute__((noinline))
#define _UNUSED __attribute__((unused))
#define __O0 __attribute__((optimize("O0")))
#define __Os __attribute__((optimize("Os")))
#define __O1 __attribute__((optimize("O1")))
#define __O2 __attribute__((optimize("O2")))
#define __O3 __attribute__((optimize("O3")))
#define __O0 __attribute__((optimize("O0"))) // No optimization and less debug info
#define __Og __attribute__((optimize("Og"))) // Optimize the debugging experience
#define __Os __attribute__((optimize("Os"))) // Optimize for size
#define __O1 __attribute__((optimize("O1"))) // Try to reduce size and cycles; nothing that takes a lot of time to compile
#define __O2 __attribute__((optimize("O2"))) // Optimize even more
#define __O3 __attribute__((optimize("O3"))) // Optimize yet more

#define IS_CONSTEXPR(...) __builtin_constant_p(__VA_ARGS__) // Only valid solution with C++14. Should use std::is_constant_evaluated() in C++20 instead

Expand Down
4 changes: 2 additions & 2 deletions ini/avr.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
#
[common_avr8]
platform = atmelavr@~4.0.1
build_flags = ${common.build_flags} -Wl,--relax
build_src_flags = -std=gnu++1z
build_flags = ${common.build_flags} -std=gnu++1z -Wl,--relax
build_unflags = -std=gnu++11
board_build.f_cpu = 16000000L
build_src_filter = ${common.default_src_filter} +<src/HAL/AVR>

Expand Down
2 changes: 1 addition & 1 deletion ini/stm32f1-maple.ini
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ extends = STM32F1_maple
board = marlin_malyanM200
build_flags = ${STM32F1_maple.build_flags}
-DMCU_STM32F103CB -D__STM32F1__=1 -std=c++1y -DSERIAL_USB -ffunction-sections -fdata-sections
-Wl,--gc-sections -DDEBUG_LEVEL=0 -D__MARLIN_FIRMWARE__
-Wl,--gc-sections -DDEBUG_LEVEL=0
lib_ignore = ${STM32F1_maple.lib_ignore}
SoftwareSerialM

Expand Down

0 comments on commit ec7ab5a

Please sign in to comment.