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 <ellensp@hotmail.com>
This commit is contained in:
Victor Oliveira 2020-12-06 17:36:36 -03:00 committed by GitHub
parent 6f4589b375
commit 1a04c8c7bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 =
#