Linux - KernelThis forum is for all discussion relating to the Linux kernel.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
dear all
i want to transplant the linux kernel into the ARM developed board。
PC :ubuntu 12.04
gcc 4.6.3
arm-linux-gcc 4.4.3
kenerl :linux-2.6.32.63
ARM : mini2440
1. i change the Makefile as below
export KBUILD_BUILDHOST := $(SUBARCH)
ARCH ?= arm
CROSS_COMPILE ?= arm-linux-
2. i change the linux-2.6.32.63/arch/arm/mach-s3c2440/mach-mini2440.c file to fit the ARM developed board
Frequency :12000000
MACH_CODE : MINI2440
3. # make mini2440_defconfig showing as below:
root@ubuntu:/opt/linux-2.6.32.63# make mini2440_defconfig
HOSTCC scripts/basic/fixdep
HOSTCC scripts/basic/docproc
HOSTCC scripts/basic/hash
HOSTCC scripts/kconfig/conf.o
scripts/kconfig/conf.c: In function ‘conf_sym’:
scripts/kconfig/conf.c:159:6: warning: variable ‘type’ set but not used [-Wunused-but-set-variable]
scripts/kconfig/conf.c: In function ‘conf_choice’:
scripts/kconfig/conf.c:231:6: warning: variable ‘type’ set but not used [-Wunused-but-set-variable]
scripts/kconfig/conf.c:307:9: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]
scripts/kconfig/conf.c: In function ‘conf_askvalue’:
scripts/kconfig/conf.c:105:8: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]
HOSTCC scripts/kconfig/kxgettext.o
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
#
# configuration written to .config
#
4. make zImage
root@ubuntu:/opt/linux-2.6.32.63# make zImage
scripts/kconfig/conf -s arch/arm/Kconfig
CHK include/linux/version.h
Generating include/asm-arm/mach-types.h
CHK include/linux/utsrelease.h
SYMLINK include/asm -> include/asm-arm
CC kernel/bounds.s
fixdep: kernel/.bounds.s.d: No such file or directory
make[1]: *** [kernel/bounds.s] Error 2
make: *** [prepare0] Error 2
Well, first of all, "transplantation" is not the proper English word to use. (The word would refer to, say, moving a heart from one body to another.)
The proper term for what you're intending to do, I believe, is "cross-compile."
A better title, and I suggest you change it, is: "How to cross-compile the kernel for an ARM processor target?" I think you'll get more hits that way. Unfortunately, I'm not myself qualified to respond to the question.
Well, first of all, "transplantation" is not the proper English word to use. (The word would refer to, say, moving a heart from one body to another.)
The proper term for what you're intending to do, I believe, is "cross-compile."
A better title, and I suggest you change it, is: "How to cross-compile the kernel for an ARM processor target?" I think you'll get more hits that way. Unfortunately, I'm not myself qualified to respond to the question.
thx , sorry for my poor english....
and do you know how to cross-compile the kernel for ARM board
Yes, the cross compiler is defined. I beieve the make which is being called however is the regular gcc compiler for the bounds.c file not the cross compiler. Am I correct?
Thanks!
QUOTE=Rinndalir;5428472]First make sure your cross compiler tools are in your path first.
Code:
export PATH=/place/crossenv:$PATH
which arm-linux-gcc
make ARCH=arm CROSS_COMPILE="arm-linux-" mini2440_defconfig 2>&1 | tee make.log
You don't need to modify anything usually.[/QUOTE]
I beieve the make which is being called however is the regular gcc compiler for the bounds.c file not the cross compiler. Am I correct?
No, you are not correct.
The command line was `CC kernel/bounds.s`, and CC would invoke the cross-compiler of the toolchain.
HOSTCC would invoke the native compiler of the host.
Yes, that is indeed correct. I took a look at the Makefile.
I ended up using the newest version of Fedora to recompile my custom Kernel.
All seems to be working well now, however, I'm still a little confused as to why
a different flavor of Linux would affect cross compilation for an ARM based device.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.