Problem in linking std libraries using arm-linux-ld

Hi Guys,

Problem in linking my source code which uses std libraries like stdio, string, stdlib using arm-linux-ld

my make file looks like this

------------------------------------------------------------------------------ TOPDIR := $(shell /bin/pwd) export TOPDIR

export CC=arm-linux-gcc export LD=arm-linux-ld OBJCOPY=arm-linux-objcopy OBJDUMP=arm-linux-objdump

export TOP_CFLAGS= -O2 -Wall -fPIC -mcpu=arm9tdmi -I../include

export LDFLAGS = -T SDcard_bootloader_fat16.lnk -Map SDcard_bootloader_fat16.map -L/usr/local/arm/4.1.1-920t/lib -lc

ASFLAGS =

SDcard_bootloader: make -C main $(LD) $(LDFLAGS) -o SDcard_bootloader_fat16.elf main/mainrom.o $(OBJCOPY) -j rom -O binary SDcard_bootloader_fat16.elf SDcard_bootloader_fat16.bin

$(OBJDUMP) -D SDcard_bootloader_fat16.elf > SDcard_bootloader_fat16.diss

clean: make clean -C main rm -f $(OBJS) SDcard_bootloader_fat16.bin SDcard_bootloader_fat16.elf SDcard_bootloader_fat16.diss SDcard_bootloader_fat16.map

------------------------------------------------------------------------------

if i remove -lc flag then it complains that it cannot find

main/mainrom.o: In function `start_C': sd_raw.c:(rom+0x208): undefined reference to `puts' main/mainrom.o: In function `myputhex': sd_raw.c:(rom+0x338): undefined reference to `memcpy' make: *** [SDcard_bootloader] Error 1

Can any one please tell me how to link to standard libraries.

I tried tow different version of tool chains arm-linux-gcc 3.4.3 arm-linux-gcc 4.1.1

But no luck with any one of thoes.

Can some one please help.

--------------------------------------- Posted through

formatting link

Reply to
tamamontu
Loading thread data ...

--snip--

--snip--

--snip--

The -lc flag tells the linker to search the standard libraries.

Reply to
d_s_klein

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.