Skip to content

Commit

Permalink
Use GCC wrapped ar & ranlib to enable LTO (#1329)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
deece committed Mar 20, 2024
1 parent 141b048 commit 271f417
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions builder/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def __fetch_fs_size(target, source, env):
__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,
Expand All @@ -266,7 +266,7 @@ def __fetch_fs_size(target, source, env):
) 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"],
Expand Down

0 comments on commit 271f417

Please sign in to comment.