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