Rockbox Technical Forums

Rockbox Development => Starting Development and Compiling => Topic started by: gama on December 31, 2012, 02:10:45 PM

Title: [QUESTION] How to link -lm to codec properly?
Post by: gama on December 31, 2012, 02:10:45 PM
Hi,

   I'm working on some codec that needs the math library for the simulator build, currently I tryied using the following rule in the makefile:

Code: [Select]
ifdef APP_TYPE
# hosted platforms will use lm
$(CODECDIR)/spc.codec: $(CODECDIR)/spc.o
$(call PRINTS,LD $(@F))$(CC) $(CODECFLAGS) -o $(CODECDIR)/spc.elf \
$(filter %.o, $^) \
$(filter %.a, $+) \
-lgcc -lm $(CODECLDFLAGS)
$(SILENT)$(call objcopy,$(CODECDIR)/spc*.elf,$@)
endif

But I'm getting the following error during make:

Code: [Select]
LD spc.codec
/usr/bin/ld: cannot open map fle /root/rockbox/build-sim/lib/rbcodec/codecs//root/rockbox/build-sim/lib/rbcodec/codecs/spc.map: No such file or directory

It seems the map path is not correct, but how can I fix that?

I took that code from the wmavoice codec makefile, but apparently it's not used anymore.  Could someone please tell me the correct way of  linking the math library for the simulator build (and app builds I guess) in a codec?.

Thanks in advance.