Skip to content

Commit dd7df21

Browse files
facchinmcmaglie
authored andcommitted
[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 080fc7d commit dd7df21

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

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+
"github.com/arduino/arduino-builder/constants"
3334
"github.com/arduino/arduino-builder/json_package_index"
3435
"github.com/arduino/arduino-builder/types"
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

constants/constants.go

+2
Original file line numberDiff line numberDiff line change
@@ -232,3 +232,5 @@ const SKETCH_FOLDER_SRC = "src"
232232
const TOOL_NAME = "name"
233233
const TOOL_URL = "url"
234234
const TOOL_VERSION = "version"
235+
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
236+
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)