diff --git a/build/arm-tools.mk b/build/arm-tools.mk index 2f33ea2414..8c778d41c8 100644 --- a/build/arm-tools.mk +++ b/build/arm-tools.mk @@ -112,9 +112,9 @@ endif # We are using newlib-nano for all the platforms CFLAGS += --specs=nano.specs -ifneq ($(CFLAGS_USE_IPA_PTA),) -CFLAGS += -fipa-pta -LDFLAGS += -fipa-pta +ifneq ($(LTO_EXTRA_OPTIMIZATIONS),) +CFLAGS += -fipa-pta -fdevirtualize-at-ltrans +LDFLAGS += -fipa-pta -fdevirtualize-at-ltrans endif # Check if the compiler version is the minimum required diff --git a/modules/tracker/system-part1/makefile b/modules/tracker/system-part1/makefile index d02cca21e7..0eac8cef87 100644 --- a/modules/tracker/system-part1/makefile +++ b/modules/tracker/system-part1/makefile @@ -5,8 +5,8 @@ BUILD_PATH_EXT = $(BUILD_TARGET_PLATFORM) HAL_LINK := PLATFORM_DFU = 0x30000 -# Add -fipa-pta to CFLAGS/LDFLAGS (interprocedural pointer analysis) -export CFLAGS_USE_IPA_PTA=1 +# Add -fipa-pta and -fdevirtualize-at-ltrans to CFLAGS/LDFLAGS (interprocedural pointer analysis) + more aggressive virtual call optimizations +export LTO_EXTRA_OPTIMIZATIONS=1 DEPENDENCIES = newlib_nano modules/tracker/user-part modules/tracker/system-part1 dynalib services hal platform system wiring communication rt-dynalib crypto proto_defs wiring_globals LIB_DEPENDENCIES = services system wiring communication hal platform crypto proto_defs wiring_globals