From 72eda1d3ae64c48eb0a3098caeab35b6b192b333 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 0cff2dac6..237634a45 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 = #