diff --git a/apps/codecs/codecs.make b/apps/codecs/codecs.make index d3525791cd..e18b92c1f0 100644 --- a/apps/codecs/codecs.make +++ b/apps/codecs/codecs.make @@ -201,7 +201,7 @@ $(CODECDIR)/%-pre.map: $(CODEC_CRT0) $(CODECLINK_LDS) $(CODECDIR)/%.o $(CODECLIB $(CODECLIB) \ -lgcc $(subst .map,-pre.map,$(CODECLDFLAGS)) -$(CODECDIR)/%.codec: $(CODECDIR)/%.o $(LIBSETJMP) +$(CODECDIR)/%.codec: $(CODECDIR)/%.o $(LIBSETJMP) $(LIBARMSUPPORT) $(call PRINTS,LD $(@F))$(CC) $(CODECFLAGS) -o $(CODECDIR)/$*.elf \ $(filter %.o, $^) \ $(filter %.a, $+) \ diff --git a/apps/codecs/lib/SOURCES b/apps/codecs/lib/SOURCES index cd38dc1545..257dcb5838 100644 --- a/apps/codecs/lib/SOURCES +++ b/apps/codecs/lib/SOURCES @@ -7,10 +7,6 @@ mdct_lookup.c fft-ffmpeg.c mdct.c -#ifdef CPU_ARM -../../../firmware/target/arm/support-arm.S -#endif - #elif (CONFIG_PLATFORM & PLATFORM_HOSTED) && defined(__APPLE__) osx.dummy.c #endif diff --git a/apps/plugins/imageviewer/imageviewer.make b/apps/plugins/imageviewer/imageviewer.make index d06bbfd571..8f933e3046 100644 --- a/apps/plugins/imageviewer/imageviewer.make +++ b/apps/plugins/imageviewer/imageviewer.make @@ -47,7 +47,7 @@ else endif # rule to create reference map for image decoder -$(IMGVBUILDDIR)/%.refmap: $(APPSDIR)/plugin.h $(IMGVSRCDIR)/imageviewer.h $(PLUGINLINK_LDS) $(PLUGINLIB) $(PLUGINBITMAPLIB) +$(IMGVBUILDDIR)/%.refmap: $(APPSDIR)/plugin.h $(IMGVSRCDIR)/imageviewer.h $(PLUGINLINK_LDS) $(PLUGINLIB) $(LIBARMSUPPORT) $(PLUGINBITMAPLIB) $(call PRINTS,LD $(@F))$(CC) $(IMGDECFLAGS) -o /dev/null \ $(filter %.o, $^) \ $(filter %.a, $+) \ diff --git a/apps/plugins/lib/SOURCES b/apps/plugins/lib/SOURCES index 2c0fc2a611..4b33901088 100644 --- a/apps/plugins/lib/SOURCES +++ b/apps/plugins/lib/SOURCES @@ -41,7 +41,6 @@ playergfx.c #ifdef HAVE_LCD_BITMAP #ifdef CPU_ARM -../../../firmware/target/arm/support-arm.S pluginlib_jpeg_idct_arm.S #endif diff --git a/apps/plugins/plugins.make b/apps/plugins/plugins.make index fca37aa763..1bf78d82c1 100644 --- a/apps/plugins/plugins.make +++ b/apps/plugins/plugins.make @@ -65,7 +65,7 @@ PLUGINFLAGS = -I$(APPSDIR)/plugins -DPLUGIN $(CFLAGS) $(ROCKS1): $(BUILDDIR)/%.rock: $(BUILDDIR)/%.o # dependency for all plugins -$(ROCKS): $(APPSDIR)/plugin.h $(PLUGINLINK_LDS) $(PLUGINLIB) $(PLUGINBITMAPLIB) $(PLUGIN_CRT0) $(LIBSETJMP) +$(ROCKS): $(APPSDIR)/plugin.h $(PLUGINLINK_LDS) $(PLUGINLIB) $(PLUGINBITMAPLIB) $(PLUGIN_CRT0) $(LIBSETJMP) $(LIBARMSUPPORT) $(PLUGINLIB): $(PLUGINLIB_OBJ) $(SILENT)$(shell rm -f $@) @@ -129,7 +129,7 @@ endif $(BUILDDIR)/apps/plugins/%.lua: $(ROOTDIR)/apps/plugins/%.lua $(call PRINTS,CP $(subst $(ROOTDIR)/,,$<))cp $< $(BUILDDIR)/apps/plugins/ -$(BUILDDIR)/%.refmap: $(APPSDIR)/plugin.h $(OVERLAYREF_LDS) $(PLUGINLIB) $(PLUGINBITMAPLIB) $(LIBSETJMP) $(PLUGIN_CRT0) +$(BUILDDIR)/%.refmap: $(APPSDIR)/plugin.h $(OVERLAYREF_LDS) $(PLUGINLIB) $(PLUGINBITMAPLIB) $(LIBSETJMP) $(LIBARMSUPPORT) $(PLUGIN_CRT0) $(call PRINTS,LD $(@F))$(CC) $(PLUGINFLAGS) -o /dev/null \ $(filter %.o, $^) \ $(filter %.a, $+) \ diff --git a/firmware/SOURCES b/firmware/SOURCES index 438c9e6526..f2036734a5 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES @@ -454,7 +454,6 @@ target/coldfire/ata-as-coldfire.S #elif defined(CPU_PP) || defined(CPU_ARM) /* CPU_PP => CPU_ARM, CPU_ARM !=> CPU_PP */ -target/arm/support-arm.S target/arm/memcpy-arm.S target/arm/memmove-arm.S diff --git a/lib/arm_support/arm_support.make b/lib/arm_support/arm_support.make new file mode 100644 index 0000000000..0f6f7683b4 --- /dev/null +++ b/lib/arm_support/arm_support.make @@ -0,0 +1,17 @@ +# __________ __ ___. +# Open \______ \ ____ ____ | | _\_ |__ _______ ___ +# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / +# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < +# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ +# \/ \/ \/ \/ \/ +# + +ARMSUPPORT_DIR = $(ROOTDIR)/lib/arm_support +ARMSUPPORT_SRC = $(ARMSUPPORT_DIR)/support-arm.S +ARMSUPPORT_OBJ := $(call c2obj, $(ARMSUPPORT_SRC)) + +OTHER_SRC += $(ARMSUPPORT_SRC) + +$(LIBARMSUPPORT): $(ARMSUPPORT_OBJ) + $(SILENT)$(shell rm -f $@) + $(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null diff --git a/firmware/target/arm/support-arm.S b/lib/arm_support/support-arm.S similarity index 100% rename from firmware/target/arm/support-arm.S rename to lib/arm_support/support-arm.S diff --git a/tools/root.make b/tools/root.make index dd827d6d3f..3cdee2caf7 100644 --- a/tools/root.make +++ b/tools/root.make @@ -70,9 +70,12 @@ ifeq (,$(findstring checkwps,$(APPSDIR))) endif endif -#included before codecs.make and plugins.make so they see $(LIBSETJMP) +#included before codecs.make and plugins.make so they see them) ifndef APP_TYPE include $(ROOTDIR)/lib/libsetjmp/libsetjmp.make + ifeq (arm,$(ARCH)) + include $(ROOTDIR)/lib/arm_support/arm_support.make + endif endif ifneq (,$(findstring bootloader,$(APPSDIR))) @@ -176,6 +179,13 @@ LINKRAM := $(BUILDDIR)/ram.link ROMLDS := $(FIRMDIR)/rom.lds LINKROM := $(BUILDDIR)/rom.link +ifeq (arm,$(ARCH)) + LIBARMSUPPORT_LINK := -larm_support +else + LIBARMSUPPORT_LINK := +endif + + $(LINKRAM): $(RAMLDS) $(CONFIGFILE) $(call PRINTS,PP $(@F)) @@ -185,19 +195,21 @@ $(LINKROM): $(ROMLDS) $(call PRINTS,PP $(@F)) $(call preprocess2file,$<,$@,-DLOADADDRESS=$(LOADADDRESS)) -$(BUILDDIR)/rockbox.elf : $$(OBJ) $$(FIRMLIB) $$(VOICESPEEXLIB) $$(SKINLIB) $$(LINKRAM) +$(BUILDDIR)/rockbox.elf : $$(OBJ) $$(FIRMLIB) $$(VOICESPEEXLIB) $$(SKINLIB) $$(LIBARMSUPPORT) $$(LINKRAM) $(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJ) \ -L$(BUILDDIR)/firmware -lfirmware \ - -L$(BUILDDIR)/lib -lskin_parser \ + -L$(BUILDDIR)/lib -lskin_parser $(LIBARMSUPPORT_LINK) \ -L$(BUILDDIR)/apps/codecs $(VOICESPEEXLIB:lib%.a=-l%) \ -lgcc $(BOOTBOXLDOPTS) $(GLOBAL_LDOPTS) \ -T$(LINKRAM) -Wl,-Map,$(BUILDDIR)/rockbox.map -$(BUILDDIR)/rombox.elf : $$(OBJ) $$(FIRMLIB) $$(VOICESPEEXLIB) $$(SKINLIB) $$(LINKROM) +$(BUILDDIR)/rombox.elf : $$(OBJ) $$(FIRMLIB) $$(VOICESPEEXLIB) $$(SKINLIB) $$(LIBARMSUPPORT) $$(LINKROM) $(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJ) \ - $(VOICESPEEXLIB) $(FIRMLIB) -lgcc $(GLOBAL_LDOPTS) \ - -L$(BUILDDIR)/lib -lskin_parser \ - -L$(BUILDDIR)/firmware -T$(LINKROM) -Wl,-Map,$(BUILDDIR)/rombox.map + -L$(BUILDDIR)/firmware -lfirmware \ + -L$(BUILDDIR)/lib -lskin_parser $(LIBARMSUPPORT_LINK) \ + -L$(BUILDDIR)/apps/codecs $(VOICESPEEXLIB:lib%.a=-l%) \ + -lgcc $(GLOBAL_LDOPTS) \ + -T$(LINKROM) -Wl,-Map,$(BUILDDIR)/rombox.map $(BUILDDIR)/rockbox.bin : $(BUILDDIR)/rockbox.elf $(call PRINTS,OC $(@F))$(OC) $(if $(filter yes, $(USE_ELF)), -S -x, -O binary) $< $@