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")