Enable "cyclic reference" for GCC linker only for the embedded dev-platforms // Resolve #3570

This commit is contained in:
Ivan Kravets
2020-08-16 20:26:59 +03:00
parent 808852f4cc
commit 74e27a2edc
2 changed files with 6 additions and 1 deletions

View File

@ -54,6 +54,7 @@ PlatformIO Core 4
* Dump data intended for IDE extensions/plugins using a new `platformio project idedata <https://docs.platformio.org/page/core/userguide/project/cmd_idedata.html>`__ 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) <https://docs.platformio.org/page/librarymanager/ldf.html#dependency-finder-mode>`__ for Arduino library when "library.property" has "depends" field (`issue #3607 <https://github.com/platformio/platformio-core/issues/3607>`_)
* Enable "cyclic reference" for GCC linker only for the embedded dev-platforms (`issue #3570 <https://github.com/platformio/platformio-core/issues/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 <https://github.com/platformio/platformio-core/issues/3523>`_)

View File

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