主题 : 有没有人编译过mini6410上的aodv-uu?有没有遇到找不到asm/types.h的问题? 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 38877
精华: 0
发帖: 40
金钱: 200 两
威望: 40 点
贡献值: 0 点
综合积分: 80 分
注册时间: 2011-03-02
最后登录: 2013-12-11
楼主  发表于: 2013-04-08 17:38

 有没有人编译过mini6410上的aodv-uu?有没有遇到找不到asm/types.h的问题?

make[1]: Entering directory `/tmp/aodv-uu-0.9.6/lnx'
arm-linux-gcc -Wall -O2 -D__KERNEL__ -DMODULE -nostdinc -I /opt/FriendlyARM/toolschain/4.5.1/lib/gcc/arm-none-linux-gnueabi/4.5.1/include -I/opt/FriendlyARM/mini6410/linux/linux-2.6.38/include -D ARM -c -o kaodv-mod-arm.o kaodv-mod.c
In file included from /opt/FriendlyARM/mini6410/linux/linux-2.6.38/include/linux/list.h:4:0,
                 from /opt/FriendlyARM/mini6410/linux/linux-2.6.38/include/linux/module.h:9,
                 from kaodv-mod.c:29:
/opt/FriendlyARM/mini6410/linux/linux-2.6.38/include/linux/types.h:4:23: fatal error: asm/types.h: No such file or directory


求解!
[ 此帖被philosophy在2013-04-09 20:13重新编辑 ]
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
1楼  发表于: 2013-04-11 12:46
/opt/FriendlyARM/mini6410/linux/linux-2.6.38目录下的内核源代码有正确配置过吗?
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 38877
精华: 0
发帖: 40
金钱: 200 两
威望: 40 点
贡献值: 0 点
综合积分: 80 分
注册时间: 2011-03-02
最后登录: 2013-12-11
2楼  发表于: 2013-04-11 15:58

 回 1楼(kasim) 的帖子

是有按照教程成功make zImage过的
级别: 新手上路
UID: 38877
精华: 0
发帖: 40
金钱: 200 两
威望: 40 点
贡献值: 0 点
综合积分: 80 分
注册时间: 2011-03-02
最后登录: 2013-12-11
3楼  发表于: 2013-04-12 11:13

 回 1楼(kasim) 的帖子

http://blog.csdn.net/fd3246444/article/details/7070388
我是完全按照这篇教程的步骤做的……不知为啥会出现找不到文件的情况……
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
4楼  发表于: 2013-04-12 11:22
我试了一下编译aodv-uu-0.9.6.

1. 需要在内核配置中加入"CONFIG_NETFILTER=y", 否则会出现"aodv-uu-0.9.6/lnx/kaodv-mod.c:397: error: implicit declaration of function 'nf_register_hook'"的错误;
2. 修改lnx/kaodv-debug.c和lnx/kaodv-netlink.c如下,否则会出现找不到"sprintf"和"DECLARE_MUTEX"的错误。
复制代码
  1. Index: aodv-uu-0.9.6/lnx/kaodv-debug.c
  2. ===================================================================
  3. --- aodv-uu-0.9.6.orig/lnx/kaodv-debug.c        2010-05-29 22:12:10.000000000 +0800
  4. +++ aodv-uu-0.9.6/lnx/kaodv-debug.c     2013-04-12 10:54:15.498760657 +0800
  5. @@ -19,6 +19,7 @@
  6.   * Author: Erik Nordström, <erik.nordstrom@it.uu.se>
  7.   *
  8.   *****************************************************************************/
  9. +#include <linux/kernel.h>
  10. #include <asm/uaccess.h>
  11. #include <asm/io.h>
  12. Index: aodv-uu-0.9.6/lnx/kaodv-netlink.c
  13. ===================================================================
  14. --- aodv-uu-0.9.6.orig/lnx/kaodv-netlink.c      2009-06-05 01:09:17.000000000 +0800
  15. +++ aodv-uu-0.9.6/lnx/kaodv-netlink.c   2013-04-12 11:00:16.482778128 +0800
  16. @@ -40,6 +40,10 @@
  17. #include "kaodv-debug.h"
  18. #include "kaodv.h"
  19. +#ifdef DEFINE_MUTEX
  20. +#define DECLARE_MUTEX DEFINE_MUTEX
  21. +#endif
  22. +
  23. static int peer_pid;
  24. static struct sock *kaodvnl;
  25. static DECLARE_MUTEX(kaodvnl_sem);


我用的编译命令行是

make KERNEL_DIR=/opt/disk2/projects/opencsbc/build/linux-2.6.38 ARM_CC=arm-none-linux-gnueabi-gcc ARM_LD=arm-none-linux-gnueabi-ld CROSS_COMPILE=arm-none-linux-gnueabi- V=1

其中KERNEL_DIR指向mini6410的2.6.38源代码目录, ARM_CC和ARM_LD是我用的交叉编译器名称, CROSS_COMPILE是用来告诉内核的Makefile交叉编译器名称。V=1用来输出完整的编译命令行。编译过程的log在附件里,供你参考。
附件: build.log.gz (2 K) 下载次数:3
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 38877
精华: 0
发帖: 40
金钱: 200 两
威望: 40 点
贡献值: 0 点
综合积分: 80 分
注册时间: 2011-03-02
最后登录: 2013-12-11
5楼  发表于: 2013-04-12 16:38

 回 4楼(kasim) 的帖子

非常感谢,我已经编译出来了。不过请问您有没有下载到板子上测试过?我出现了下面的问题……
[root@FriendlyARM /]# aodvd -h                                                  
/bin/aodvd: line 1: syntax error: unexpected "("  
级别: 新手上路
UID: 38877
精华: 0
发帖: 40
金钱: 200 两
威望: 40 点
贡献值: 0 点
综合积分: 80 分
注册时间: 2011-03-02
最后登录: 2013-12-11
6楼  发表于: 2013-04-12 17:29

 回 4楼(kasim) 的帖子

我增加了CC=arm-none-linux-gnueabi-gcc LD=arm-none-linux-gnueabi-ld 就可用了,非常感谢!
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
7楼  发表于: 2013-04-12 17:53

 回 6楼(philosophy) 的帖子

恭喜,期待你分享更多经验
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 128395
精华: 0
发帖: 4
金钱: 20 两
威望: 4 点
贡献值: 0 点
综合积分: 8 分
注册时间: 2016-10-06
最后登录: 2017-03-22
8楼  发表于: 2016-10-06 21:39
您好, 这个问题你是怎么解决的哈  就是找不到asm/types.h的问题
级别: 新手上路
UID: 89149
精华: 0
发帖: 3
金钱: 15 两
威望: 3 点
贡献值: 0 点
综合积分: 6 分
注册时间: 2013-03-22
最后登录: 2017-08-24
9楼  发表于: 2017-08-24 22:32
您好,问题是怎么解决的啊,遇到同样问题