我想交叉編譯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