arm-linux-gcc4.4.3编译s3c2410平台linux内核
写在前面:2.6.14版本的内核用arm-linux-gcc4.4.3没有编译成功,下载2.6.37版本的内核用arm-linux-gcc4.4.3编译通过。
一、首先下载linux内核:
linux-2.6.14.tar.bz2 下载地址:http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.14.tar.bz2
二、解压linux-2.6.14.tar.bz2:
tar -jxvf linux-2.6.14.tar.bz2
三、配置Makefile文件:
1、打开源码根目录下的Makefile文件:
gedit Makefile
修改Makefile文件:
ARCH ?= arm
CROSS_COMPILE ?= arm-linux-
2、查看目录结构:
ls -l linux-2.6.14/arch/arm/
drwxrwxr-x 4 mlx mlx 4096 Oct 28 2005 boot
drwxrwxr-x 2 mlx mlx 4096 Oct 28 2005 common
drwxrwxr-x 2 mlx mlx 4096 Oct 28 2005 configs
-rw-rw-r-- 1 mlx mlx 21221 Oct 28 2005 Kconfig
-rw-rw-r-- 1 mlx mlx 3845 Oct 28 2005 Kconfig.debug
drwxrwxr-x 2 mlx mlx 4096 Oct 28 2005 kernel
drwxrwxr-x 2 mlx mlx 4096 Oct 28 2005 lib
... ...
drwxrwxr-x 2 mlx mlx 4096 Oct 28 2005 mach-s3c2410
... ...
可以看到该内核支持s3c2410芯片。
3、查看芯片的默认配置文件:
ls -l linux-2.6.14/arch/arm/configs/
-rw-rw-r-- 1 mlx mlx 18719 Oct 28 2005 rpc_defconfig
-rw-rw-r-- 1 mlx mlx 20543 Oct 28 2005 s3c2410_defconfig
-rw-rw-r-- 1 mlx mlx 16901 Oct 28 2005 shannon_defconfig
-rw-rw-r-- 1 mlx mlx 21104 Oct 28 2005 shark_defconfig
-rw-rw-r-- 1 mlx mlx 18173 Oct 28 2005 simpad_defconfig
-rw-rw-r-- 1 mlx mlx 13382 Oct 28 2005 smdk2410_defconfig
-rw-rw-r-- 1 mlx mlx 28956 Oct 28 2005 spitz_defconfig
-rw-rw-r-- 1 mlx mlx 17936 Oct 28 2005 versatile_defconfig
四、编译内核:
1、拷贝配置文件:
cd linux-2.6.14
cp -f arch/arm/configs/s3c2410_defconfig .config
2、make menuconfig
make menuconfig出错
(1)、Makefile:450: *** mixed implicit and normal rules: deprecated syntax
(2)、make: *** No rule to make target 'menuconfig'. Stop.
针对(1),是由于我的系统的make工具太新,make的旧版规则已经无法兼容新版。按照以下方式,问题得到解决:
在makefile中修改:
config %config: scripts_basic outputmakefile FORCE
改为:
%config: scripts_basic outputmakefile FORCE
修改/ %/: prepare scripts FORCE(错)
为:%/: prepare scripts FORCE(对)
如果正确不做修改
修改后继续make menuconfig,又出现错误:
You must install ncurses-devel in order
>> to use 'make menuconfig'
安装:
sudo apt-get install libncurses5-dev
安装完毕后再次执行make menuconfig即可运行
选择 Load an Alternate Configation File 回车
选择.config
选择 save an Alternate Configation File 回车
此处显示的是我们刚选择的defconfig文件路径,删除掉,改为linux 2.6.26 解压路径下的.config(XXXXXX/.config)
3、出现错误:arch/arm: Is a directory. Stop.
原因:ARCH ?= arm这句话的arm后出现了空格
make zImage 开始编译,编译成功会生成zImage文件
出错
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
网上说是因为arm-linux-gcc版本过高导致的,用3.4.1版本。
五、下载2.6.37内核,按照上面的方式重新make:
报错
Can't use 'defined(@array)' (Maybe you 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
解决:将kernel/timeconst.pl中第373行的defined()去掉只留下@val就可以了
继续make,报错:
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
直接把h1940_latch_control()函数注销掉,具体修解决方法还不知道。
继续make,完成后生成了vmlinux。
arm-linux-gcc4.4.3编译s3c2410平台linux内核的更多相关文章
- Linux下编译静态MinGW环境,编译windows平台Qt程序(使用MXE)
参考链接: MXE.>大多数程序都是在windows平台下开发的程序.windows 在现实中也是绕不过的一个系统平台,做为受过几年VC,MFC”虐待”的程序员,在做为一个程序员之前是一位Lin ...
- 驱动开发学习笔记. 0.04 linux 2.6 platform device register 平台设备注册 1/2 共2篇
驱动开发读书笔记. 0.04 linux 2.6 platform device register 平台设备注册 1/2 共2篇下面这段摘自 linux源码里面的文档 : Documentatio ...
- Linux就这个范儿 第16章 谁都可以从头再来--从头开始编译一套Linux系统 nsswitch.conf配置文件
Linux就这个范儿 第16章 谁都可以从头再来--从头开始编译一套Linux系统 nsswitch.conf配置文件 朋友们,今天我对你们说,在此时此刻,我们虽然遭受种种困难和挫折,我仍然有一个梦 ...
- <摘录>Linux 环境下编译 0.11版本内核 kernel
系统环境:Fedora 13 + gcc-4.4.5 最近在看<linux内核0.11完全注释>一书,由于书中涉及汇编语言的地方众多,本人在大学时汇编语言学得一塌糊涂,所以实在看不下去了, ...
- GCC-4.6.3编译linux2.6.32.12内核出现“重复的成员‘page’”错误的解决方法
使用gcc4.6.3编译linux2.6.32.12内核出现错误如下: In file included from drivers/net/igbvf/ethtool.c:36:0: drivers/ ...
- 【转】Linux(ubuntu14.04)上编译Android4.4源码的环境搭建及编译全过程
原文网址:http://jileniao.net/linux-android-building.html sublime text让我伤心.本来很信任sublime text的自动保存功能,之前使用一 ...
- 用VS2013+VELT-0.1.4进行海思平台 Linux内核 的开发
快乐虾 http://blog.csdn.net/lights_joy/(QQ群:Visual EmbedLinux Tools 375515651) 欢迎转载,但请保留作者信息 本文仅适用于vs20 ...
- [转载]Linux 环境下编译 0.11版本内核 kernel
最近在看<.如果Clobber/Modify 为空,则其前面的冒号(:)必须省略. 2.如果Output,Input,Clobber/Modify都为空,Output,Input之前的冒号(:) ...
- linux下使用gcc编译运行C程序
gcc(GNU Compiler Collection)是Linux下最常用的C语言编译器,是GNU项目中符合ANSI C标准的编译系统,能够编译用C.C++和Object C等语言编写的程序. 在 ...
随机推荐
- H5和CSS3新增内容总结
CSS3选择器有哪些?答:属性选择器.伪类选择器.伪元素选择器.CSS3新特性有哪些?答:1.颜色:新增RGBA,HSLA模式 文字阴影(text-shadow.) 边框: 圆角(border-rad ...
- FileUpload控件预览图片
HTML代码: <tr> <td class="auto-style1">上传图片:</td> <td> <asp:FileU ...
- 一种调用dll的巧妙方法
直接上代码,后面说应用场景 新建一个项目,引入需要调用的dll,如下 class Program { [DllImport( "soft.dll" )] static extern ...
- Django之forms表单类
Form表单的功能 自动生成HTML表单元素 检查表单数据的合法性 如果验证错误,重新显示表单(数据不会重置) 数据类型转换(字符类型的数据转换成相应的Python类型) 1.创建Form类 from ...
- 看完这篇再不会 View 的动画框架,我跪搓衣板
引言 众所周知,一款没有动画的 app,就像没有灵魂的肉体,给用户的体验性很差.现在的 android 在动画效果方面早已空前的发展,1.View 动画框架 2.属性动画框架 3.Drawable 动 ...
- Codeforces 467D Fedor and Essay bfs
题目链接: 题意: 给定n个单词. 以下有m个替换方式.左边的单词能变成右边的单词. 替换随意次后使得最后字母r个数最少,在r最少的情况下单词总长度最短 输出字母r的个数和单词长度. 思路: 我们觉得 ...
- redis数据迁移操作
redis客户端连接命令,分别连接旧环境中的主从redis Src目录下./redis-cli -h IP -p PORT 使用info replication 命令找出主redis使用客户端命令连接 ...
- C语言补漏(1)--- char到int赋值的一个陷阱
作为一个C的新手(虽然学的第一门语言就是C,可是用C实际开发项目却是最近的事情),对使用C过程中遇到的各类问题.疑惑.知识漏洞进行弥补无疑是非常有必要的,于是决定将每次遇到的知识漏洞写到博客上. 今天 ...
- Navicat Premium创建事件计划调用MySql存储过程
1.检查事件计划,操作:工具——命令行界面——执行命令 show variables like '%event_scheduler%'; (分号不能丢)—— event_scheduler ON 表 ...
- 【BZOJ2229】[Zjoi2011]最小割 最小割树
[BZOJ2229][Zjoi2011]最小割 Description 小白在图论课上学到了一个新的概念——最小割,下课后小白在笔记本上写下了如下这段话: “对于一个图,某个对图中结点的划分将图中所有 ...