From 271f4175f7004d1278bd5bbd96ff84921b2d0b2a Mon Sep 17 00:00:00 2001 From: Alastair D'Silva Date: Wed, 20 Mar 2024 23:59:09 +1100 Subject: [PATCH] Use GCC wrapped ar & ranlib to enable LTO (#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 --- builder/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builder/main.py b/builder/main.py index 0acd134..98ae155 100644 --- a/builder/main.py +++ b/builder/main.py @@ -250,7 +250,7 @@ env.Replace( __get_board_flash_mode=_get_board_flash_mode, __get_board_memory_type=_get_board_memory_type, - AR="%s-elf-ar" % toolchain_arch, + AR="%s-elf-gcc-ar" % toolchain_arch, AS="%s-elf-as" % toolchain_arch, CC="%s-elf-gcc" % toolchain_arch, CXX="%s-elf-g++" % toolchain_arch, @@ -266,7 +266,7 @@ env.Replace( ) if env.get("PIOFRAMEWORK") == ["espidf"] else "%s-elf-gdb" % toolchain_arch, OBJCOPY=join( platform.get_package_dir("tool-esptoolpy") or "", "esptool.py"), - RANLIB="%s-elf-ranlib" % toolchain_arch, + RANLIB="%s-elf-gcc-ranlib" % toolchain_arch, SIZETOOL="%s-elf-size" % toolchain_arch, ARFLAGS=["rc"],