解决undefine reference to '__aeabi_idiv' undefine reference to '__aeabi_idivmod'错误
undefine reference to '__aeabi_idiv'undefine reference to '__aeabi_idivmod'我的交叉编译器的版本是arm-none-linux-gnueabi/4.3.2makefile如下CC = arm-linux-gccLD = arm-linux-ldAR = a
undefine reference to '__aeabi_idiv'
undefine reference to '__aeabi_idivmod'
我的交叉编译器的版本是arm-none-linux-gnueabi/4.3.2
makefile如下
CC = arm-linux-gcc
LD = arm-linux-ld
AR = arm-linux-ar
OBJCOPY = arm-linux-objcopy
OBJDUMP = arm-linux-objdump
LIB :=-lgcc -L/usr/local/arm/4.3.2/lib/gcc/arm-none-linux-gnueabi/4.3.2
INCLUDEDIR := $(shell pwd)/include
CFLAGS := -w
CPPFLAGS := -nostdinc -I$(INCLUDEDIR)
export CC AR LD OBJCOPY OBJDUMP INCLUDEDIR CFLAGS CPPFLAGS
objs := start.o clock.o main.o sdram.o nand.o huitu_main.o lib/libc.a malloc/memory.a dev/dev.a chinesechess/chinesechess.a
lcd.bin: $(objs)
${LD} -Tlcd.lds -o lcd.elf $^ $(LIB)
${OBJCOPY} -O binary -S lcd.elf $@
${OBJDUMP} -D lcd.elf > lcd.dis
.PHONY : lib/libc.a
lib/libc.a:
cd lib; make; cd ..
chinesechess/chinesechess.a:
make -C chinesechess all
malloc/memory.a:
make -C malloc all
dev/dev.a:
make -C dev all
%.o:%.c
${CC} $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
%.o:%.S
${CC} $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
clean:
make clean -C chinesechess
make clean -C lib
make clean -C dev
make clean -C malloc
rm -f *.elf *.dis *.o *.bak *.a
解决方法:
需要在连接的时候链接这个LIB :=-lgcc -L/usr/local/arm/4.3.2/lib/gcc/arm-none-linux-gnueabi/4.3.2
然后进行编译的时候会提醒没有raise函数,自己写个这个函数like this
int raise(int signum)
{
return 0//什么都不干
}
再次编译就会通过了
更多推荐
所有评论(0)