build: add 'lto' to features.txt if built with it

This makes it easy to tell at a glance if a build was with LTO or not.

Change-Id: I7ba9b412f7b74d300a0c55e36ea4cf522d46e6f2
This commit is contained in:
Solomon Peachy 2024-11-30 13:49:42 -05:00
parent a41cad6458
commit fdc17096b5
3 changed files with 11 additions and 0 deletions

View file

@ -18,6 +18,11 @@ SRC += $(call preprocess, $(APPSDIR)/SOURCES)
# Kludge: depends on config.o which only depends on config-*.h to have config.h # Kludge: depends on config.o which only depends on config-*.h to have config.h
# changes trigger a genlang re-run # changes trigger a genlang re-run
# #
ifneq (,$(USE_LTO))
$(BUILDDIR)/apps/features: PPCFLAGS += -DUSE_LTO
endif
$(BUILDDIR)/apps/features: $(APPSDIR)/features.txt $(BUILDDIR)/firmware/common/config.o $(BUILDDIR)/apps/features: $(APPSDIR)/features.txt $(BUILDDIR)/firmware/common/config.o
$(SILENT)mkdir -p $(BUILDDIR)/apps $(SILENT)mkdir -p $(BUILDDIR)/apps
$(SILENT)mkdir -p $(BUILDDIR)/lang $(SILENT)mkdir -p $(BUILDDIR)/lang

View file

@ -308,3 +308,7 @@ perceptual_volume
#if defined(CODEC_AAC_SBR_DEC) #if defined(CODEC_AAC_SBR_DEC)
codec_aac_he codec_aac_he
#endif #endif
#if defined(USE_LTO)
lto
#endif

2
tools/configure vendored
View file

@ -1079,7 +1079,9 @@ S(m)all C lib, Logf to Ser(i)al port, LTO Build(X), (E)rror on warnings"
[Xx]) [Xx])
echo "LTO build enabled" echo "LTO build enabled"
LTO_ARG="export USE_LTO=y" LTO_ARG="export USE_LTO=y"
# GCCOPTS=`echo $GCCOPTS | sed -e s/-funit-at-a-time/-flto/`
GCCOPTS="$GCCOPTS -flto" GCCOPTS="$GCCOPTS -flto"
GLOBAL_LDOPTS="-flto $GLOBAL_LDOPTS"
;; ;;
[Ee]) [Ee])
echo "Treating all warnings as errors" echo "Treating all warnings as errors"