From 1a04c8c7bb65a4802bc5fedad442b4d1bfc41a89 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Sun, 6 Dec 2020 17:36:36 -0300 Subject: [PATCH] Avoid invalid memory optimizations (#20389) When building for AVR, merge-all-constants can incorrectly combine constants stored in flash with constants stored in RAM. These have different access requirements, leading to undefined behavior during execution. Co-authored-by: ellensp --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 0cff2dac60..237634a454 100644 --- a/platformio.ini +++ b/platformio.ini @@ -203,7 +203,7 @@ extra_scripts = pre:buildroot/share/PlatformIO/scripts/common-dependencies.py pre:buildroot/share/PlatformIO/scripts/common-cxxflags.py post:buildroot/share/PlatformIO/scripts/common-dependencies-post.py -build_flags = -fmax-errors=5 -g -D__MARLIN_FIRMWARE__ -fmerge-all-constants +build_flags = -fmax-errors=5 -g -D__MARLIN_FIRMWARE__ -fmerge-constants lib_deps = #