From 74e27a2edc94e9531eaf81bb7047199f6a7a9296 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sun, 16 Aug 2020 20:26:59 +0300 Subject: [PATCH] Enable "cyclic reference" for GCC linker only for the embedded dev-platforms // Resolve #3570 --- HISTORY.rst | 1 + platformio/builder/tools/platformio.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/HISTORY.rst b/HISTORY.rst index 147c4b5f..7f86e40f 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -54,6 +54,7 @@ PlatformIO Core 4 * Dump data intended for IDE extensions/plugins using a new `platformio project idedata `__ command * Do not generate ".travis.yml" for a new project, let the user have a choice * Automatically enable LDF dependency `chain+ mode (evaluates C/C++ Preprocessor conditional syntax) `__ for Arduino library when "library.property" has "depends" field (`issue #3607 `_) +* Enable "cyclic reference" for GCC linker only for the embedded dev-platforms (`issue #3570 `_) * Updated PIO Unit Testing support for Mbed framework. Added compatibility with Mbed OS 6 * Do not escape compiler arguments in VSCode template on Windows * Fixed an issue with PIO Unit Testing when running multiple environments (`issue #3523 `_) diff --git a/platformio/builder/tools/platformio.py b/platformio/builder/tools/platformio.py index 560cbe37..5d8f8e8b 100644 --- a/platformio/builder/tools/platformio.py +++ b/platformio/builder/tools/platformio.py @@ -66,7 +66,11 @@ def BuildProgram(env): env.Prepend(LINKFLAGS=["-T", env.subst("$LDSCRIPT_PATH")]) # enable "cyclic reference" for linker - if env.get("LIBS") and env.GetCompilerType() == "gcc": + if ( + env.get("LIBS") + and env.GetCompilerType() == "gcc" + and env.PioPlatform().is_embedded() + ): env.Prepend(_LIBFLAGS="-Wl,--start-group ") env.Append(_LIBFLAGS=" -Wl,--end-group")