|
本帖最后由 zyp568 于 2012-9-25 15:15 编辑
环境:ubuntu12.04 + arm-linux-gcc-4.3.3
自己写的裸机程序,想利用标准库构造一个Uart打印函数
- int UART_Printf( unsigned int iUARTID, const char *pFmt, ... )
复制代码 Makefile如下:
- objs1:= output/Head.o output/Init.o output/MMU.o output/Nand_K9F2G08U0B.o output/Interrupt.o output/InterruptEX.o output/ADC.o
- objs2:= output/Test.o output/TFTLCD.o output/Common.o output/UART.o
- objs := $(objs1) $(objs2)
- lib1 := /home/long/arm-linux-gcc-4.3.3/arm-none-linux-gnueabi/libc/armv4t/usr/lib/
- Test.bin : $(objs)
- arm-linux-ld -TTest.lds -L$(lib1) -o output/Test.elf $^ -lc
- arm-linux-objcopy -O binary -S output/Test.elf $@
- arm-linux-objdump -D -m arm output/Test.elf > output/Test.dis
-
- output/%.o : source/%.c
- arm-linux-gcc -Wall -nostdlib -O2 -c -o $@ [ DISCUZ_CODE_20 ]lt;
-
- output/%.o : source/%.s
- arm-linux-gcc -Wall -nostdlib -O2 -c -o $@ [ DISCUZ_CODE_20 ]lt;
-
- clean:
- rm -f output/Test.elf output/Test.dis output/*.o Test.bin
复制代码 编译的时候出现错误:
- arm-linux-ld -TTest.lds -L/home/long/arm-linux-gcc-4.3.3/arm-none-linux-gnueabi/libc/armv4t/usr/lib/ -o output/Test.elf output/Head.o output/Init.o output/MMU.o output/Nand_K9F2G08U0B.o output/Interrupt.o output/InterruptEX.o output/ADC.o output/Test.o output/TFTLCD.o output/Common.o output/UART.o -lc
- arm-linux-ld: BFD (Sourcery G++ Lite 2009q1-203) 2.19.51.20090205 assertion fail /scratch/mitchell/builds/4.3-arm-none-linux-gnueabi-respin/lite/obj/binutils-src-2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu/bfd/elf32-arm.c:12507
- make: *** [Test.bin] Segmentation fault (core dumped)
复制代码
|
|