Skip to content

Commit 6e47e71

Browse files
deecejonathandreyer
authored andcommitted
Use GCC wrapped ar & ranlib to enable LTO (platformio#1329)
LTO shifts compilation to the final link, allowing for more aggressive optimisations. AR & RANLIB need to use their gcc equivalents to enable this, and will otherwise behave identically if LTO data is not in the objects. Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
1 parent b65d0d5 commit 6e47e71

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

builder/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ def __fetch_fs_size(target, source, env):
250250
__get_board_flash_mode=_get_board_flash_mode,
251251
__get_board_memory_type=_get_board_memory_type,
252252

253-
AR="%s-elf-ar" % toolchain_arch,
253+
AR="%s-elf-gcc-ar" % toolchain_arch,
254254
AS="%s-elf-as" % toolchain_arch,
255255
CC="%s-elf-gcc" % toolchain_arch,
256256
CXX="%s-elf-g++" % toolchain_arch,
@@ -266,7 +266,7 @@ def __fetch_fs_size(target, source, env):
266266
) if env.get("PIOFRAMEWORK") == ["espidf"] else "%s-elf-gdb" % toolchain_arch,
267267
OBJCOPY=join(
268268
platform.get_package_dir("tool-esptoolpy") or "", "esptool.py"),
269-
RANLIB="%s-elf-ranlib" % toolchain_arch,
269+
RANLIB="%s-elf-gcc-ranlib" % toolchain_arch,
270270
SIZETOOL="%s-elf-size" % toolchain_arch,
271271

272272
ARFLAGS=["rc"],

0 commit comments

Comments
 (0)