From 6a989b8d4dec4750ad474598bd52897381d2f3cb Mon Sep 17 00:00:00 2001 From: Andree Buschmann Date: Wed, 7 Sep 2011 19:21:57 +0000 Subject: [PATCH] Submit FS#12258. Do not use '-ffunction-sections' and '-fdata-sections' when compiling. Fixes compiler warnings for mingw and cygwin simulatior builds. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30468 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/lib/libcodec.make | 7 ++++++- apps/codecs/lib/tlsf/libtlsf.make | 7 ++++++- apps/plugins/plugins.make | 9 ++++++++- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/apps/codecs/lib/libcodec.make b/apps/codecs/lib/libcodec.make index c1858dcd6c..ca9b2c4fe2 100644 --- a/apps/codecs/lib/libcodec.make +++ b/apps/codecs/lib/libcodec.make @@ -16,7 +16,7 @@ $(CODECLIB): $(CODECLIB_OBJ) $(SILENT)$(shell rm -f $@) $(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null -CODECLIBFLAGS = $(filter-out -O%,$(CODECFLAGS)) -ffunction-sections +CODECLIBFLAGS = $(filter-out -O%,$(CODECFLAGS)) ifeq ($(MEMORYSIZE),2) CODECLIBFLAGS += -Os @@ -26,6 +26,11 @@ else CODECLIBFLAGS += -O1 endif +# Do not use '-ffunction-sections' when compiling sdl-sim +ifneq ($(findstring sdl-sim, $(APP_TYPE)), sdl-sim) + CODECLIBFLAGS += -ffunction-sections +endif + $(CODECDIR)/lib/%.o: $(ROOTDIR)/apps/codecs/lib/%.c $(SILENT)mkdir -p $(dir $@) $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) \ diff --git a/apps/codecs/lib/tlsf/libtlsf.make b/apps/codecs/lib/tlsf/libtlsf.make index 7d37d29b21..2072a4566e 100644 --- a/apps/codecs/lib/tlsf/libtlsf.make +++ b/apps/codecs/lib/tlsf/libtlsf.make @@ -16,12 +16,17 @@ $(TLSFLIB): $(TLSFLIB_OBJ) $(SILENT)$(shell rm -f $@) $(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null -TLSFLIBFLAGS = $(CODECFLAGS) -ffunction-sections +TLSFLIBFLAGS = $(CODECFLAGS) ifdef APP_TYPE TLSFLIBFLAGS += -DTLSF_STATISTIC=1 endif +# Do not use '-ffunction-sections' when compiling sdl-sim +ifneq ($(findstring sdl-sim, $(APP_TYPE)), sdl-sim) + TLSFLIBFLAGS += -ffunction-sections +endif + $(CODECDIR)/lib/tlsf/src/%.o: $(APPSDIR)/codecs/lib/tlsf/src/%.c $(SILENT)mkdir -p $(dir $@) $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) \ diff --git a/apps/plugins/plugins.make b/apps/plugins/plugins.make index 0c667aaf24..41d2307682 100644 --- a/apps/plugins/plugins.make +++ b/apps/plugins/plugins.make @@ -87,10 +87,17 @@ $(BUILDDIR)/credits.raw credits.raw: $(DOCSDIR)/CREDITS # special dependencies $(BUILDDIR)/apps/plugins/wav2wv.rock: $(BUILDDIR)/apps/codecs/libwavpack.a $(PLUGINLIB) +# Do not use '-ffunction-sections' and '-fdata-sections' when compiling sdl-sim +ifeq ($(findstring sdl-sim, $(APP_TYPE)), sdl-sim) + PLUGINLIBFLAGS = $(PLUGINFLAGS) +else + PLUGINLIBFLAGS = $(PLUGINFLAGS) -ffunction-sections -fdata-sections +endif + # special pattern rule for compiling plugin lib (with function and data sections) $(BUILDDIR)/apps/plugins/lib/%.o: $(ROOTDIR)/apps/plugins/lib/%.c $(SILENT)mkdir -p $(dir $@) - $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) -I$(dir $<) $(PLUGINFLAGS) -ffunction-sections -fdata-sections -c $< -o $@ + $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) -I$(dir $<) $(PLUGINLIBFLAGS) -c $< -o $@ # special pattern rule for compiling plugins with extra flags $(BUILDDIR)/apps/plugins/%.o: $(ROOTDIR)/apps/plugins/%.c