开发者

Errors when building the cross compiler on debian

开发者 https://www.devze.com 2023-02-16 23:19 出处:网络
I want to cross compile the kernel for powerpc. I\'ve tried doing it on a x86_64 Ubuntu 10.04, and on a i386 Debian Lenny, and I get exactly the same problem. I follow the instructions at http://wiki.

I want to cross compile the kernel for powerpc. I've tried doing it on a x86_64 Ubuntu 10.04, and on a i386 Debian Lenny, and I get exactly the same problem. I follow the instructions at http://wiki.debian.org/BuildingCrossCompilers, and when I try to build the binutils by giving the following command:

fakeroot debian/rules binary-cross

I get this result:

[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 decl开发者_运维技巧aration specifiers
make[3]: *** [regex.o] Error 1
[snip] 

(This is because types.h attempts to typedef pid_t, which, however, has been #defined to int. If I hack around this problem by #undef pid_t inside types.h, I get a similar problem elsewhere with intptr_t, and so on and so on.)


If all you need to do is cross-compile the kernel, you should be able to do the following:

CROSS_COMPILE=<portion of command before gcc> make ARCH=powerpc menuconfig
make ARCH=powerpc all
#...other for modules, docs, etc.

Make sure you have the cross-compiler in your path. For setting the CROSS_COMPILE variable, if your cross-compiler command for gcc is ppc_74xx-gcc you'd set CROSS_COMPILE=ppc_74xx-

You can take a look at this link for more info http://wiki.ppckernel.org/w/Cross_compiling_a_64-bit_PowerPC_Linux_Kernel

If you're looking at building your own cross-toolchain from scratch, check out http://trac.cross-lfs.org/ This site shows you how to cross-compile Linux from scratch, including building your own toolchain, kernel, user space, etc.

0

精彩评论

暂无评论...
验证码 换一张
取 消