diff --git a/tools/platformio-build.py b/tools/platformio-build.py
index 56d5e84643..0a0d53c6a5 100644
--- a/tools/platformio-build.py
+++ b/tools/platformio-build.py
@@ -84,7 +84,6 @@ def scons_patched_match_splitext(path, suffixes=None):
         "-mtext-section-literals",
         "-falign-functions=4",
         "-U__STRICT_ANSI__",
-        "-D_GNU_SOURCE",
         "-ffunction-sections",
         "-fdata-sections",
         "-Wall",
@@ -125,6 +124,7 @@ def scons_patched_match_splitext(path, suffixes=None):
         ("F_CPU", "$BOARD_F_CPU"),
         "__ets__",
         "ICACHE_FLASH",
+        "_GNU_SOURCE",
         ("ARDUINO", 10805),
         ("ARDUINO_BOARD", '\\"PLATFORMIO_%s\\"' % env.BoardConfig().id.upper()),
         "FLASHMODE_${BOARD_FLASH_MODE.upper()}",