LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   how to make the Kernel transplantation? (https://www.linuxquestions.org/questions/linux-kernel-70/how-to-make-the-kernel-transplantation-4175508754/)

su_seven 06-21-2014 09:23 PM

how to make the Kernel transplantation?
 
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

what was the wrong ? how can i can do for this?

sundialsvcs 06-22-2014 08:05 AM

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.

su_seven 06-24-2014 09:26 AM

Quote:

Originally Posted by sundialsvcs (Post 5192030)
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

tasdvl9 10-01-2015 02:29 PM

bounds.c compilation..
 
Hello,

Was this ever resolved? I am experiencing something similar using Ubuntu 14.04..

CC kernel/bounds.s
> fixdep: kernel/.bounds.s.d: No such file or directory
> make[2]: *** [kernel/bounds.s] Error 2

Rinndalir 10-01-2015 04:06 PM

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.

tasdvl9 10-01-2015 04:21 PM

Hi,

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]

blue_z 10-02-2015 03:39 AM

Quote:

Originally Posted by tasdvl9 (Post 5428483)
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.

Regards

tasdvl9 10-02-2015 08:33 AM

Thanks, guys.

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.


All times are GMT -5. The time now is 01:12 PM.