免费注册 查看新帖 |

Chinaunix

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

linux2.6.13和2.6.15.5一些编译bug [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-09-23 16:38 |只看该作者 |倒序浏览
2.6.13

    在编译2.6.13的时候,发现在kgdb选项打开后,编译不能通过。提示信息如下:
kernel/kgdb.c:130: error: `NUMCRITREGBYTES' undeclared here (not in a function)
kernel/kgdb.c:131: error: storage size of `kgdb_fault_jmp_regs' isn't known
make[1]: *** [kernel/kgdb.o] Error 1
make: *** [kernel] Error 2

    提示NUMCRITREGBYTES没有被定义,这个错误原来是以为2.6.13版本的kgdb patch少了core.patch。后面网上也有遇到类似的毛病,并不是少了core.patch。所以这边把patch贴出来给大家:
--- linux-2.6.13/include/asm-arm/kgdb.h 2006-01-24 06:21:57.644718496 +0530
+++ linux-2.6.13.orig/include/asm-arm/kgdb.h 2006-01-24 04:41:21.000000000 +0530
@@ -65,6 +65,7 @@
#define KGDB_MAX_NO_CPUS 1
#define BUFMAX 400
#define NUMREGBYTES (GDB_MAX_REGS

#define _R0 0
#define _R1 1
    修改后,2.6.13版本的kernel已经可以正常编译通过,kgdb的测试也正常。


2.6.15.5
    2.6.15.5kernel在选上nfs client的支持4个选项后,发现也会出现编译错误,提示信息如下:
> CC [M] fs/nfs/direct.o
> fs/nfs/direct.c: In function ‘nfs_get_user_pages’:
> fs/nfs/direct.c:110: warning: implicit declaration of function ‘nfs_free_user_pages’
> fs/nfs/direct.c: At top level:
> fs/nfs/direct.c:127: warning: conflicting types for ‘nfs_free_user_pages’
> fs/nfs/direct.c:127: error: static declaration of ‘nfs_free_user_pages’ follows non-static declaration
> fs/nfs/direct.c:110: error: previous implicit declaration of ‘nfs_free_user_pages’ was here
> make[3]: *** [fs/nfs/direct.o] Error 1

    主要是函数nfs_get_user_pages声明上出问题,这边把这个patch也贴给大家,希望对大家有点帮助。
--- a/fs/nfs/direct.c
+++ b/fs/nfs/direct.c
@@ -57,6 +57,7 @@
#define NFSDBG_FACILITY NFSDBG_VFS
#define MAX_DIRECTIO_SIZE (4096UL

+static void nfs_free_user_pages(struct page **pages, int npages, int do_dirty);
static kmem_cache_t *nfs_direct_cachep;

@@ -107,6 +108,15 @@ nfs_get_user_pages(int rw, unsigned long
page_count, (rw == READ), 0,
*pages, NULL);
up_read(&current->mm->mmap_sem);
+ /*
+ * If we got fewer pages than expected from get_user_pages(),
+ * the user buffer runs off the end of a mapping; return EFAULT.
+ */
+ if (result >= 0 && result

加上声明后,编译能够正常通过了。但是kernel在启动后,不能正常挂载到ramdisk上。注意这边只是选择了nfs client的支持。至于原因还希望有知道的人帮忙指导指导!!

     

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/40405/showart_388140.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP