# very old gcc toolchains may not have these options
CFLAGS += $(call chkCCflag, -fno-tree-loop-if-convert -fipa-pta -fno-ipa-cp)
endif
+else
+CFLAGS += $(call chkCCflag, -flto)
endif
# revision info from repository if this not a tagged release
endif
endif
-ifneq (,$(filter %mips32r2, $(CFLAGS)))
-CFLAGS += -DMIPS_USE_SYNCI # mips32r2 clear_cache uses SYNCI instead of a syscall
-endif
-
OBJS += platform/opendingux/inputmap.o
use_inputmap ?= 1
# to avoid saving and reloading it. However, this collides with the use of LTO.
pico/32x/memory.o: CFLAGS += -fno-lto
pico/32x/sh2soc.o: CFLAGS += -fno-lto
+cpu/sh2/compiler.o: CFLAGS += -fno-lto
+endif
+ifneq (,$(filter mips64%, $(ARCH))$(filter %mips32r2, $(CFLAGS)))
+CFLAGS += -DMIPS_USE_SYNCI # mips32r2 clear_cache uses SYNCI instead of a syscall
endif
endif