Written in front: 2.6.14 version of the kernel with arm-linux-gcc4.4.3 is not compiled successfully, download 2.6.37 version of the kernel is compiled by arm-linux-gcc4.4.3.
First, download the Linux kernel:
linux-2.6.14.tar.bz2:http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.14.tar.bz2
Second, decompression linux-2.6.14.tar.bz2:
TAR-JXVF linux-2.6.14.tar.bz2
Third, configuration makefile file:
1, open source code root directory of makefile file:
Gedit Makefile
To modify the Makefile file:
ARCH? = Arm
Cross_compile? = arm-linux-
2. View the directory structure:
Ls-l linux-2.6.14/arch/arm/
Drwxrwxr-x 4 MLX mlx 4096 Oct 2005 boot
Drwxrwxr-x 2 MLX mlx 4096 OCT-2005 common
Drwxrwxr-x 2 MLX mlx 4096 Oct-2005 Configs
-rw-rw-r--1 MLX mlx 21221 Oct-2005 Kconfig
-rw-rw-r--1 MLX mlx 3845 Oct-2005 Kconfig.debug
Drwxrwxr-x 2 MLX mlx 4096 Oct-2005 kernel
Drwxrwxr-x 2 MLX mlx 4096 Oct 2005 Lib
... ...
Drwxrwxr-x 2 MLX mlx 4096 Oct-2005 mach-s3c2410
... ...
You can see that the kernel supports the s3c2410 chip.
3. View the chip's default configuration file:
Ls-l linux-2.6.14/arch/arm/configs/
-rw-rw-r--1 MLX mlx 18719 Oct-2005 Rpc_defconfig
-rw-rw-r--1 MLX mlx 20543 Oct-2005 S3c2410_defconfig
-rw-rw-r--1 MLX mlx 16901 Oct-2005 Shannon_defconfig
-rw-rw-r--1 MLX mlx 21104 Oct-2005 Shark_defconfig
-rw-rw-r--1 MLX mlx 18173 Oct-2005 Simpad_defconfig
-rw-rw-r--1 MLX mlx 13382 Oct-2005 Smdk2410_defconfig
-rw-rw-r--1 MLX mlx 28956 Oct-2005 Spitz_defconfig
-rw-rw-r--1 MLX mlx 17936 Oct-2005 Versatile_defconfig
Four, compile the kernel:
1. Copy the configuration file:
CD linux-2.6.14
Cp-f arch/arm/configs/s3c2410_defconfig. config
2. Make Menuconfig
Make Menuconfig Error
(1), makefile:450: * * * mixed implicit and normal rules:deprecated syntax
(2), Make: * * * No rule to make target ' menuconfig '. Stop.
for (1), because my system's make tool is too new, make's legacy rules are not compatible with the new version. The problem is resolved in the following manner:
Modify in Makefile:
Config%config:scripts_basic outputmakefile force
Switch
%config:scripts_basic outputmakefile Force
Modified /%/: Prepare scripts Force (wrong)
is:%/: Prepare scripts Force (yes)
If you do not make changes correctly
After the modification, continue make menuconfig, and error occurs:
You must install Ncurses-devel in order
>> ' Make Menuconfig '
Installation:
sudo apt-get install Libncurses5-dev
Execute make Menuconfig once the installation is complete to run
Select Load an Alternate configation File enter
Select. config
Select Save an Alternate configation File enter
Here is the path of the Defconfig file we just selected, deleted, changed to. config (xxxxxx/.config) under the Linux 2.6.26 decompression path.
3. Error occurred: Arch/arm:is a directory. Stop.
Reason: ARCH = arm This sentence of arm after a space appears
Make zimage to start compiling, the compilation will generate Zimage file successfully
Error
arch/arm/mm/alignment.c:in function ' Proc_alignment_write ':
Arch/arm/mm/alignment.c:119:error:read-only variable ' __r2 ' used as ' asm ' output
Arch/arm/mm/alignment.c:119:error:read-only variable ' __r2 ' used as ' asm ' output
Arch/arm/mm/alignment.c:119:error:read-only variable ' __r2 ' used as ' asm ' output
Arch/arm/mm/alignment.c:119:error:read-only variable ' __r2 ' used as ' asm ' output
Scripts/makefile.build:193:recipe for Target ' ARCH/ARM/MM/ALIGNMENT.O ' failed
MAKE[1]: * * * [ARCH/ARM/MM/ALIGNMENT.O] Error 1
Makefile:784:recipe for Target ' arch/arm/mm ' failed
Make: * * * [arch/arm/mm] Error 2
Online is due to the ARM-LINUX-GCC version is too high, with 3.4.1 version.
Download the 2.6.37 kernel and re-make it in the way above:
Error
Can ' t use ' defined (@array) ' (maybe should just omit the defined ()?) at kernel/timeconst.pl Line 373.
/home/mlx/armlinux/linux-2.6.37/kernel/makefile:139:recipe for Target ' kernel/timeconst.h ' failed
MAKE[1]: * * * [kernel/timeconst.h] Error 255
Makefile:914:recipe for target ' kernel ' failed
Make: * * * [kernel] Error 2
Resolution: Remove the defined () from line No. 373 of kernel/timeconst.pl and leave only @val.
Continue make, Error:
drivers/leds/leds-h1940.c:in function ' H1940_greenled_set ':
Drivers/leds/leds-h1940.c:33:error:implicit declaration of function ' H1940_latch_control '
Scripts/makefile.build:250:recipe for Target ' DRIVERS/LEDS/LEDS-H1940.O ' failed
MAKE[2]: * * * [DRIVERS/LEDS/LEDS-H1940.O] Error 1
Scripts/makefile.build:380:recipe for Target ' drivers/leds ' failed
MAKE[1]: * * * [drivers/leds] Error 2
Makefile:914:recipe for target ' drivers ' failed
Make: * * * [drivers] Error 2
The h1940_latch_control() function is directly written off, the specific fix method is not known.
Continue make, and the Vmlinux is generated after completion.
arm-linux-gcc4.4.3 compiling the s3c2410 platform Linux kernel