hdliuguanqun / openwrt-for-embedded

Automatically exported from code.google.com/p/openwrt-for-embedded
0 stars 0 forks source link

在编译s3c64xx时,target/linux/编译出错 #8

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
在编译s3c64xx时,target/linux/编译出错:(minimal,packages已经编
译通过)
make -C 
/home/richardnee/2.OpenWRT/0-OpenWRT-for-Embedded/trunk-10.03.1/build_dir/linux-
s3c64xx_mini6410/linux-2.6.36.4 CROSS_COMPILE="arm-openwrt-linux-gnueabi-" 
ARCH="arm" KBUILD_HAVE_NLS=no CONFIG_SHELL="/bin/bash" 
CC="arm-openwrt-linux-gnueabi-gcc" 
make[4]: Entering directory 
`/home/richardnee/2.OpenWRT/0-OpenWRT-for-Embedded/trunk-10.03.1/build_dir/linux
-s3c64xx_mini6410/linux-2.6.36.4'
  CHK     include/linux/version.h
  CHK     include/generated/utsrelease.h
make[5]: `include/generated/mach-types.h' is up to date.
  CALL    scripts/checksyscalls.sh
  CHK     include/generated/compile.h
  CC      drivers/char/gpio_dev.o
drivers/char/gpio_dev.c:126: error: unknown field 'ioctl' specified in 
initializer
drivers/char/gpio_dev.c:126: warning: initialization from incompatible pointer 
type
make[6]: *** [drivers/char/gpio_dev.o] Error 1
make[5]: *** [drivers/char] Error 2
make[4]: *** [drivers] Error 2
make[4]: Leaving directory 
`/home/richardnee/2.OpenWRT/0-OpenWRT-for-Embedded/trunk-10.03.1/build_dir/linux
-s3c64xx_mini6410/linux-2.6.36.4'
make[3]: *** 
[/home/richardnee/2.OpenWRT/0-OpenWRT-for-Embedded/trunk-10.03.1/build_dir/linux
-s3c64xx_mini6410/linux-2.6.36.4/.image] Error 2
make[3]: Leaving directory 
`/home/richardnee/2.OpenWRT/0-OpenWRT-for-Embedded/trunk-10.03.1/target/linux/s3
c64xx'
make[2]: *** [install] Error 2
make[2]: Leaving directory 
`/home/richardnee/2.OpenWRT/0-OpenWRT-for-Embedded/trunk-10.03.1/target/linux'

Original issue reported on code.google.com by richard....@gmail.com on 1 Jun 2012 at 7:27

GoogleCodeExporter commented 9 years ago
原因是:generic-2.6/filesdrivers/char/gpio_dev.c中有如下的引用,使�
��到了ioctl项!
struct file_operations gpio_fops = { 
        ioctl:          gpio_ioctl,
        open:           gpio_open,
        release:        gpio_close
};

struct file_operations的定义在linux-2.6.36/include/linux/fs.h
对比了一下linux-2.6.36内核和linux-2.6.35,linux-2.6.32内核,
linux-2.6.36中include/linux/fs.h的struct 
file_operations缺少了对ioctl的定义:
--- linux-2.6.36/include/linux/fs.h.orig   2012-06-02 12:07:04.276202387 +0800
+++ linux-2.6.36/include/linux/fs.h        2012-06-02 11:40:57.968201665 +0800
@@ -1494,6 +1494,7 @@ struct file_operations {
  ssize_t (*aio_write) (struct kiocb *, const struct iovec *, unsigned long, loff_t);
  int (*readdir) (struct file *, void *, filldir_t);
  unsigned int (*poll) (struct file *, struct poll_table_struct *); 
+ int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long);
  long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
  long (*compat_ioctl) (struct file *, unsigned int, unsigned long);
  int (*mmap) (struct file *, struct vm_area_struct *);

解决方法:加入int (*ioctl)的定义!

Original comment by richard....@gmail.com on 2 Jun 2012 at 4:15

GoogleCodeExporter commented 9 years ago
1 openwrt-dreambox也有同样问题!

2 uClibc和eglibc都有这样的问题(可预见glibc也有该问题)!

Original comment by richard....@gmail.com on 2 Jun 2012 at 8:36

GoogleCodeExporter commented 9 years ago
从Linux 
2.6.36开始,基于BKL(大内核锁)的ioctl已经被抛弃,取而代之的�
��unlocked_ioctl。这个在内核文档里面有提及到。
详见:https://dev.openwrt.org.cn/ticket/49
已经修复:https://dev.openwrt.org.cn/changeset/478

Original comment by richard....@gmail.com on 2 Jun 2012 at 10:12