免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3798 | 回复: 4
打印 上一主题 下一主题

Linux-2.6.32.2内核移植中编译出错问题求教 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-09-09 13:41 |只看该作者 |倒序浏览
Linux-2.6.32.2内核移植中编译出错
1.    我在Vmware 上安装了Federa 9;
2.    从http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.32.2.tar.gz下载了linux-2.6.32.2.tar.gz软件;
3.    将软件拷贝到 /opt/FriendlyARM/mini2440;
4.    解压内核源代码
#cd /opt/FriendlyARM/mini2440
#tar xvzf linux-2.6.32.2.tar.gz
5.    指定交叉编译变量
#cd linux-2.6.32.2
#vim  Makefile
将原文件
Export KBUILD_BUILDHOST := $(SUBARCH)
ARCH  ?= $(SUBARCH)
CROSS_COMPILE ?=
修改为
Export KBUILD_BUILDHOST := $(SUBARCH)
ARCH  ?= arm
CROSS_COMPILE ?=/usr/local/arm/4.3.2/arm-linux
保存退出;
接下来,测试linux的编译能否通过:
执行:
#make s3c2410_defconfig
#make
编译没有通过,出现以下信息:
Expr: syntax error
CHK: include/linux/version.h
Make[1]: ‘include/arm-arm/mach-types.h’ is up to date.
CHK:  include/linux/utsrelease.h
SYMLINK  include/arm->include/arm-arm
CALL  scripts/checksyscalls.sh
CHK   include/linux/compile.h
CC    drivers/usb/core/hcd.o
Drivers/usb/core/hcd.c:144: error: expected expression before ‘>>’ token
Drivers/usb/core/hcd.c:144: error: expected expression before ‘>>’ token
Drivers/usb/core/hcd.c:165: error: expected expression before ‘>>’ token
Drivers/usb/core/hcd.c:165: error: expected expression before ‘>>’ token
Drivers/usb/core/hcd.c:188: error: expected expression before ‘>>’ token
Drivers/usb/core/hcd.c:188: error: expected expression before ‘>>’ token
Make[3]: *** [drivers/usb/core/hcd.o] Error 1
Make[2]: *** [drivers/usb/core] Error 2
Make[1]: *** [drivers/usb] Error 2
Make: *** [drivers]  Error 2
打开hcd.c文件:
# vim drivers/usb/core/hcd.c






请问高手,错误如何修改?

论坛徽章:
0
2 [报告]
发表于 2010-09-09 14:59 |只看该作者
内核版本不同  工具链或许不可以通用

论坛徽章:
0
3 [报告]
发表于 2010-09-09 15:19 |只看该作者
CROSS_COMPILE ?=/usr/local/arm/4.3.2/arm-linux
应该为:
CROSS_COMPILE ?=/usr/local/arm/4.3.2/arm-linux-

论坛徽章:
0
4 [报告]
发表于 2010-09-10 08:21 |只看该作者
我查看了CROSS_COMPILE ?=变量作了如下设置:
CROSS_COMPILE ?= /usr/local/arm/4.3.2/arm-linux-

我认为是 语法错误:
#vim drivers/usb/core/hcd.c

//头文件如下
25 #include <linux/module.h>
26 #include <linux/version.h>
27 #include <linux/kernel.h>
28 #include <linux/slab.h>
29 #include <linux/completion.h>
30  #include <linux/utsname.h>
31  #include <linux/mm.h>
32  #include <asm/io.h>
33 #include <linux/device.h>
34  #include <linux/dma-mapping.h>
35  #include <linux/mutex.h>
36  #include <asm/irq.h>
37  #include <asm/byteorder.h>
38  #include <asm/unaligned.h>
39  #include <linux/platform_device.h>
40  #include <linux/workqueue.h>
41
42  #include <linux/usb.h>
43
44  #include "usb.h"
45  #include "hcd.h"
46  #include "hub.h"
47

142  0x6b,0x1d, /* _le16 idvendor; Linux Founddation */
143  0x02,0x00, /* __le16 idProduct;device 0x0002 */
144  KERNEL_VER, KERNEL_REL, /* __le16 bcdDevice */
145
146  0x03,               /* _u8 iManufacturer; */



163  x06b, 0x1d,    /* __le16 idVendor;Linux Foundation */
164  0x02,0x00, /* __le16 idProduct;device 0x0002 */
165  KERNEL_VER, KERNEL_REL, /* __le16 bcdDevice */
166
167  0x03,               /* _u8 iManufacturer; */
168  0x02,               /* _u8 iProduct;   */

186  x06b, 0x1d,    /* __le16 idVendor;Linux Foundation */
187  0x02,0x00, /* __le16 idProduct;device 0x0002 */
188  KERNEL_VER, KERNEL_REL, /* __le16 bcdDevice */
189
190  0x03,               /* _u8 iManufacturer; */
191  0x02,               /* _u8 iProduct;   */

而我不知道在哪里查找代码KERNEL_VER, KERNEL_REL的宏定义?
当我把144,165, 188行注释掉后,编译便能够通过。

论坛徽章:
0
5 [报告]
发表于 2010-09-10 08:34 |只看该作者
请教KERNEL_VER, KERNEL_REL如何查出其宏定义?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP