From 076696cde1516cca5293e65c1e329b29ca3d36aa Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 29 Jul 2015 17:33:06 +0300 Subject: [PATCH] Use Linker cyclic option when deplibs exist --- platformio/builder/tools/platformio.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/platformio/builder/tools/platformio.py b/platformio/builder/tools/platformio.py index 3ea18f9f..a539cf42 100644 --- a/platformio/builder/tools/platformio.py +++ b/platformio/builder/tools/platformio.py @@ -43,12 +43,13 @@ def BuildFirmware(env): ) # enable "cyclic reference" for linker - env.Prepend( - _LIBFLAGS="-Wl,--start-group " - ) - env.Append( - _LIBFLAGS=" -Wl,--end-group" - ) + if deplibs: + env.Prepend( + _LIBFLAGS="-Wl,--start-group " + ) + env.Append( + _LIBFLAGS=" -Wl,--end-group" + ) # Handle SRC_BUILD_FLAGS if getenv("PLATFORMIO_SRC_BUILD_FLAGS", None):