当前位置: 代码迷 >> 驱动开发 >> linux-2.4.27内核编译出错,
  详细解决方案

linux-2.4.27内核编译出错,

热度:83   发布时间:2016-04-28 10:58:39.0
linux-2.4.27内核编译出错,求助。
编译出错提示如下:
/home/gangan/backup/linux-2.4.27-vrs1-ATMEL/include/asm/byteorder.h:29: linux/byteorder/little_endian.h: ?????????
In file included from /home/gangan/backup/linux-2.4.27-vrs1-ATMEL/include/linux/wait.h:13,
  from /home/gangan/backup/linux-2.4.27-vrs1-ATMEL/include/linux/fs.h:12,
  from /home/gangan/backup/linux-2.4.27-vrs1-ATMEL/include/linux/capability.h:17,
  from /home/gangan/backup/linux-2.4.27-vrs1-ATMEL/include/linux/binfmts.h:5,
  from /home/gangan/backup/linux-2.4.27-vrs1-ATMEL/include/linux/sched.h:9,
  from /home/gangan/backup/linux-2.4.27-vrs1-ATMEL/include/linux/mm.h:4,
  from sched.c:23:
/home/gangan/backup/linux-2.4.27-vrs1-ATMEL/include/linux/kernel.h:143: #error "Please fix asm/byteorder.h"
make[2]: *** [sched.o] 错误 1
make[2]: Leaving directory `/home/gangan/backup/linux-2.4.27-vrs1-ATMEL/kernel'
make[1]: *** [first_rule] 错误 2
make[1]: Leaving directory `/home/gangan/backup/linux-2.4.27-vrs1-ATMEL/kernel'
make: *** [_dir_kernel] 错误 2




之前也make clean 和make dep ,make menuconfig 都没出错,最后make 编译时出现上面的错误,不知道是啥原因。

------解决方案--------------------
没有声明大小端?
------解决方案--------------------
从你代码来看,好像没有定义大小端的宏。你查一下__LITTLE_ENDIAN和__BIG_ENDIAN两个宏是不是定了,
------解决方案--------------------
没有声明大小端
------解决方案--------------------
看代码就知道宏__LITTLE_ENDIAN或__BIG_ENDIAN未定义,接着去查看asm/byteorder.h头文件即可。它一般会引用内核源码中的include/linux/byteorder/big_endian.h或include/linux/byteorder/little_endian.h文件,极少可能出现文件缺失的情况,错误很可能出现在解压或配置时。
探讨

嗯,不过“Please fix asm/byteorder.h”在代码里是这样的
#if defined(__LITTLE_ENDIAN)
#define HIPQUAD(addr) \
((unsigned char *)&addr)[3], \
((unsigned char *)&addr)[2], \
((unsigned char *)&addr)[1……