summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2024-11-30 13:49:42 -0500
committerSolomon Peachy <pizza@shaftnet.org>2024-11-30 13:49:42 -0500
commitfdc17096b54d45e283adb89ccdeeeb974c2ae43c (patch)
tree3f088d48c6d120b6c0ae837d286dd70fba117e43
parenta41cad64589ac01e34baba06e22c559be94dc434 (diff)
downloadrockbox-fdc17096b5.tar.gz
rockbox-fdc17096b5.zip
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
-rw-r--r--apps/apps.make5
-rw-r--r--apps/features.txt4
-rwxr-xr-xtools/configure2
3 files changed, 11 insertions, 0 deletions
diff --git a/apps/apps.make b/apps/apps.make
index 47b015bc92..33ca5d6c24 100644
--- a/apps/apps.make
+++ b/apps/apps.make
@@ -18,6 +18,11 @@ SRC += $(call preprocess, $(APPSDIR)/SOURCES)
# Kludge: depends on config.o which only depends on config-*.h to have config.h
# 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
$(SILENT)mkdir -p $(BUILDDIR)/apps
$(SILENT)mkdir -p $(BUILDDIR)/lang
diff --git a/apps/features.txt b/apps/features.txt
index 71fc9d63fc..523db8b073 100644
--- a/apps/features.txt
+++ b/apps/features.txt
@@ -308,3 +308,7 @@ perceptual_volume
#if defined(CODEC_AAC_SBR_DEC)
codec_aac_he
#endif
+
+#if defined(USE_LTO)
+lto
+#endif
diff --git a/tools/configure b/tools/configure
index 8800d0d924..aa905a3203 100755
--- a/tools/configure
+++ b/tools/configure
@@ -1079,7 +1079,9 @@ S(m)all C lib, Logf to Ser(i)al port, LTO Build(X), (E)rror on warnings"
[Xx])
echo "LTO build enabled"
LTO_ARG="export USE_LTO=y"
+# GCCOPTS=`echo $GCCOPTS | sed -e s/-funit-at-a-time/-flto/`
GCCOPTS="$GCCOPTS -flto"
+ GLOBAL_LDOPTS="-flto $GLOBAL_LDOPTS"
;;
[Ee])
echo "Treating all warnings as errors"