我想交叉编译powerpc的内核。我已经尝试在x86_64 Ubuntu 10.04和i386 Debian Lenny上做这件事,并且我遇到了完全相同的问题。我按照说明在http://wiki.debian.org/BuildingCrossCompilers,当我试图通过给下面的命令来构建的binutils:在debian上构建交叉编译器时出错
fakeroot debian/rules binary-cross
我得到这样的结果:
[snip]
make[3]: Entering directory `/home/anthony/cross-toolchain/binutils-2.20.1/builddir-powerpc-linux-gnu/libiberty'
if [ x"-fpic" != x ]; then \
gcc -c -DHAVE_CONFIG_H -g -O2 -Wno-format-security -I. -I../../libiberty/../include -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -pedantic -fpic ../../libiberty/regex.c -o pic/regex.o; \
else true; fi
In file included from /usr/include/stdlib.h:320,
from ../../libiberty/regex.c:128:
/usr/include/sys/types.h:100: error: two or more data types in declaration specifiers
make[3]: *** [regex.o] Error 1
[snip]
(这是因为types.h中尝试的typedef然而,它已经被定义为int了,如果我在types.h中通过#undef pid_t来解决这个问题,那么在intptr_t的其他地方我会遇到类似的问题,等等等等。)
谢谢,但我对debian特定的解决方案感兴趣,而不是通用的解决方案。 Debian包含了诸如dpkg-cross这样的工具,但我找不到任何实际工作的分步说明。 – 2011-03-24 19:13:10
你能发布完整的错误日志吗? – 2011-03-24 23:31:23