最近公司用MIPS编译器,需要支持smartmips扩展指令集。芯片供应商提供的GCC编译器是3.4.6的,不支持smartmips内核编译选项(打开了导致build不过)。而编译内核供应商提供的SDE,NND,真折腾,编译application一个编译器,编译内核一个编译器,烦哪!经过一翻折腾,在借助buildroot的基础上,制作了一款mipsel-linux-交叉编译器(4.3.4)。具体怎么制作,这里不“折腾”了,只讲讲使用的是buildroot-11月版本,在配置的时候手动指定2.6.20的内核。其他都是defualt。制作好之后,编译2.6.20的讲讲遇到的两个问题。
问题一:
arch/mips/kernel/asm-offsets.c: In function 'output_mm_defines':
arch/mips/kernel/asm-offsets.c:230: error: invalid 'asm': invalid use of '%X'
arch/mips/kernel/asm-offsets.c:231: error: invalid 'asm': invalid use of '%X'
arch/mips/kernel/asm-offsets.c:232: error: invalid 'asm': invalid use of '%X'
解决方法:
打开arch/mips/kernel/asm-offsets.c
#define constant(string, member) \
__asm__("\n@@@" string "%X0" : : "ri" (member))
=>
#define constant(string, member) \
__asm__("\n@@@" string "%0" : : "ri" (member))
问题二:
arch/mips/math-emu/built-in.o: In function `ieee754dp_format':
(.text+0x2f24): undefined reference to `__ucmpdi2'
arch/mips/math-emu/built-in.o: In function `ieee754dp_format':
(.text+0x2f24): relocation truncated to fit: R_MIPS_26 against `__ucmpdi2'
arch/mips/math-emu/built-in.o: In function `ieee754dp_mul':
(.text+0x495c): undefined reference to `__ucmpdi2'
arch/mips/math-emu/built-in.o: In function `ieee754dp_mul':
(.text+0x495c): relocation truncated to fit: R_MIPS_26 against `__ucmpdi2'
arch/mips/math-emu/built-in.o: In function `ieee754dp_mul':
(.text+0x4eb0): undefined reference to `__ucmpdi2'
arch/mips/math-emu/built-in.o: In function `ieee754dp_mul':
(.text+0x4eb0): relocation truncated to fit: R_MIPS_26 against `__ucmpdi2'
arch/mips/math-emu/built-in.o: In function `ieee754dp_sub':
(.text+0x539c): undefined reference to `__ucmpdi2'
arch/mips/math-emu/built-in.o: In function `ieee754dp_sub':
(.text+0x539c): relocation truncated to fit: R_MIPS_26 against `__ucmpdi2'
arch/mips/math-emu/built-in.o: In function `ieee754dp_sub':
(.text+0x5690): undefined reference to `__ucmpdi2'
arch/mips/math-emu/built-in.o: In function `ieee754dp_sub':
(.text+0x5690): relocation truncated to fit: R_MIPS_26 against `__ucmpdi2'
arch/mips/math-emu/built-in.o:(.text+0x5c0c): more undefined references to
`__ucmpdi2' follow
arch/mips/math-emu/built-in.o: In function `ieee754dp_add':
(.text+0x5c0c): relocation truncated to fit: R_MIPS_26 against `__ucmpdi2'
arch/mips/math-emu/built-in.o: In function `ieee754dp_add':
(.text+0x5fc8): relocation truncated to fit: R_MIPS_26 against `__ucmpdi2'
解决方法:
在最新的linux内核(我是从2.6.30)上找到arch/mips/lib/ucmpdi2.c 把它copy到我编译的版本的一致路径下,而后修改arch/mips/lib/Makefile,附件是这个ucmpdi2.c.
|
文件: | ucmpdi2.rar |
大小: | 0KB |
下载: | 下载 |
|
阅读(3297) | 评论(1) | 转发(3) |