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
This commit is contained in:
Andree Buschmann 2011-09-07 19:21:57 +00:00
parent 28c4f2a84e
commit 6a989b8d4d
3 changed files with 20 additions and 3 deletions

View file

@ -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) \

View file

@ -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) \

View file

@ -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