A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd

build: Allow LTO to work globally, not just codecs/plugins

IMPORTANT: There is no guarantee this will compile cleanly much less
_work_ on any given target. This is purely to enable future hackery.

Change-Id: Ib58f21b717719fd4325622b446a60779406ae035

+10 -5
+2 -2
apps/plugins/plugins.make
··· 154 154 PLUGINLDFLAGS += $(GLOBAL_LDOPTS) 155 155 156 156 ifdef USE_LTO 157 - PLUGINFLAGS += -flto -fno-builtin -ffreestanding 158 - PLUGINLDFLAGS += -flto -fno-builtin -ffreestanding 157 + PLUGINFLAGS += -fno-builtin -ffreestanding 158 + PLUGINLDFLAGS += -fno-builtin -ffreestanding 159 159 PLUGINLDFLAGS += -e plugin_start 160 160 endif 161 161
+5
firmware/firmware.make
··· 47 47 $(call PRINTS,CONVBDF $(subst $(ROOTDIR)/,,$<))$(TOOLSDIR)/convbdf -l $(MAXCHAR) -c -o $(BUILDDIR)/sysfont.c $< 48 48 $(call PRINTS,CC $(subst $(ROOTDIR)/,,$(BUILDDIR)/sysfont.c))$(CC) $(CFLAGS) -c $(BUILDDIR)/sysfont.c -o $@ 49 49 50 + ifdef USE_LTO 51 + $(BUILDDIR)/firmware/asm/%.o: CFLAGS += -fno-lto 52 + $(BUILDDIR)/firmware/kernel/%.o: CFLAGS += -fno-lto 53 + endif 54 + 50 55 # GNU make (at least) has a bug/feature that exported variable are not available 51 56 # in the shell function (but are in recipe). Thus we need to explicitely pass 52 57 # the VERSION environement variable
+2 -2
lib/rbcodec/codecs/codecs.make
··· 34 34 CODECLDFLAGS += $(GLOBAL_LDOPTS) 35 35 36 36 ifdef USE_LTO 37 - CODECLDFLAGS += -flto -fno-builtin -ffreestanding 38 - CODECFLAGS += -flto -fno-builtin -ffreestanding 37 + CODECLDFLAGS += -fno-builtin -ffreestanding 38 + CODECFLAGS += -fno-builtin -ffreestanding 39 39 CODECLDFLAGS += -e __header 40 40 endif 41 41
+1 -1
tools/configure
··· 1079 1079 [Xx]) 1080 1080 echo "LTO build enabled" 1081 1081 LTO_ARG="export USE_LTO=y" 1082 - # GCCOPTS="$GCCOPTS -flto" 1082 + GCCOPTS="$GCCOPTS -flto" 1083 1083 ;; 1084 1084 [Ee]) 1085 1085 echo "Treating all warnings as errors"