Skip to content

Commit 3192798

Browse files
committed
[UGLY HACK] replace older compiler with the new one if it exists
To overcome https://github.com/arduino/Arduino/issues/5168, find a better way please :)
1 parent cf165a9 commit 3192798

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/arduino.cc/builder/add_missing_build_properties_from_parent_platform_txt_files.go

+8
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
package builder
3131

3232
import (
33+
"arduino.cc/builder/constants"
3334
"arduino.cc/builder/types"
3435
"arduino.cc/json_package_index"
3536
)
@@ -68,6 +69,13 @@ func (s *OverridePropertiesWithJsonInfo) Run(ctx *types.Context) error {
6869

6970
buildProperties.Merge(newBuildProperties)
7071

72+
// HACK!!! To overcome AVR core 1.6.12 lto problems, replace avr-gcc-4.8.1-arduino5 with
73+
// 4.9.2-atmel3.5.3-arduino2 if it exists
74+
if buildProperties[constants.HACK_PROPERTIES_AVR_GCC_NEW] != "" {
75+
buildProperties[constants.HACK_PROPERTIES_AVR_GCC_OLD] =
76+
"{" + constants.HACK_PROPERTIES_AVR_GCC_NEW + "}"
77+
}
78+
7179
ctx.BuildProperties = buildProperties
7280
}
7381

src/arduino.cc/builder/constants/constants.go

+2
Original file line numberDiff line numberDiff line change
@@ -210,3 +210,5 @@ const SKETCH_FOLDER_SRC = "src"
210210
const TOOL_NAME = "name"
211211
const TOOL_URL = "url"
212212
const TOOL_VERSION = "version"
213+
const HACK_PROPERTIES_AVR_GCC_NEW = BUILD_PROPERTIES_RUNTIME_TOOLS_PREFIX + "avr-gcc-arduino-4.9.2-atmel3.5.3-arduino2" + BUILD_PROPERTIES_RUNTIME_TOOLS_SUFFIX
214+
const HACK_PROPERTIES_AVR_GCC_OLD = BUILD_PROPERTIES_RUNTIME_TOOLS_PREFIX + "avr-gcc-arduino-4.8.1-arduino5" + BUILD_PROPERTIES_RUNTIME_TOOLS_SUFFIX

0 commit comments

Comments
 (0)