大佬们,我使用的是openEuler24.03系统, 看了binder驱动安装指导,到了make编译的时候就报一堆错误。
/mapp/communication_ipc/binder/external_symbols.c:33:30: 警告:‘enum task_work_notify_mode’ declared inside parameter list will not be visible outside of this definition or declaration
33 | enum task_work_notify_mode mode) = NULL;
| ^~~~~~~~~~~~~~~~~~~~~
/mapp/communication_ipc/binder/external_symbols.c:75:30: 警告:‘enum task_work_notify_mode’ declared inside parameter list will not be visible outside of this definition or declaration
75 | enum task_work_notify_mode mode)
| ^~~~~~~~~~~~~~~~~~~~~
/mapp/communication_ipc/binder/external_symbols.c:75:52: 错误:形参 3 (‘mode’) 的类型不完全
75 | enum task_work_notify_mode mode)
| ~~~~~~~~^~
/mapp/communication_ipc/binder/external_symbols.c:74:5: 错误:函数声明不是一个原型 [-Werror=strict-prototypes]
74 | int task_work_add(struct task_struct *task, struct callback_head *twork,
| ^
/mapp/communication_ipc/binder/external_symbols.c: 在函数‘task_work_add’中:
/mapp/communication_ipc/binder/external_symbols.c:78:47: 错误:实参 3 的类型不完全
78 | return task_work_add_ptr(task, twork, mode);
| ^
/mapp/communication_ipc/binder/external_symbols.c: 在文件作用域:
/mapp/communication_ipc/binder/external_symbols.c:81:5: 错误:conflicting types for ‘close_fd_get_file’; have ‘int(unsigned int, struct file **)’
81 | int close_fd_get_file(unsigned int fd, struct file **res)
| ^
In file included from /mapp/communication_ipc/binder/external_symbols.c:3:
./include/linux/fdtable.h:134:21: 附注:previous declaration of ‘close_fd_get_file’ with type ‘struct file *(unsigned int)’
134 | extern struct file *close_fd_get_file(unsigned int fd);
| ^~~~~~~~~~~~~~~~~
/mapp/communication_ipc/binder/external_symbols.c: 在函数‘task_work_add’中:
/mapp/communication_ipc/binder/external_symbols.c:79:1: 错误:在有返回值的函数中,控制流程到达函数尾 [-Werror=return-type]
79 | }
| ^
cc1:有些警告被当作是错误
make[3]: *** [scripts/Makefile.build:243:/mapp/communication_ipc/binder/external_symbols.o] 错误 1
make[3]: *** 正在等待未完成的任务…
/mapp/communication_ipc/binder/binder_alloc.c: 在函数‘binder_alloc_shrinker_init’中:
/mapp/communication_ipc/binder/binder_alloc.c:1082:23: 错误:提供给函数‘register_shrinker’的实参太少
1082 | ret = register_shrinker(&binder_shrinker);
| ^~~~~~~~~~~~~~~~~
In file included from ./include/linux/list_lru.h:13,
from ./include/linux/fs.h:13,
from ./include/linux/seq_file.h:12,
from /mapp/communication_ipc/binder/binder_alloc.c:16:
./include/linux/shrinker.h:109:27: 附注:在此声明
109 | extern int __printf(2, 3) register_shrinker(struct shrinker *shrinker,
| ^~~~~~~~~~~~~~~~~
make[3]: *** [scripts/Makefile.build:243:/mapp/communication_ipc/binder/binder_alloc.o] 错误 1
/mapp/communication_ipc/binder/binder.c: 在函数‘binder_deferred_fd_close’中:
/mapp/communication_ipc/binder/binder.c:2258:9: 错误:提供给函数‘close_fd_get_file’的实参太多
2258 | close_fd_get_file(fd, &twcb->file);
| ^~~~~~~~~~~~~~~~~
In file included from /mapp/communication_ipc/binder/binder.c:45:
./include/linux/fdtable.h:134:21: 附注:在此声明
134 | extern struct file *close_fd_get_file(unsigned int fd);
| ^~~~~~~~~~~~~~~~~
/mapp/communication_ipc/binder/binder.c: 在函数‘binder_mmap’中:
/mapp/communication_ipc/binder/binder.c:5539:23: 错误:向只读成员‘vm_flags’赋值
5539 | vma->vm_flags |= VM_DONTCOPY | VM_MIXEDMAP;
| ^~
/mapp/communication_ipc/binder/binder.c:5540:23: 错误:向只读成员‘vm_flags’赋值
5540 | vma->vm_flags &= ~VM_MAYWRITE;
| ^~
/mapp/communication_ipc/binder/binder.c: 在文件作用域:
/mapp/communication_ipc/binder/binder.c:6413:10: 错误:‘const struct file_operations’没有名为‘may_pollfree’的成员
6413 | .may_pollfree = true,
| ^~~~~~~~~~~~
/mapp/communication_ipc/binder/binder.c:6413:25: 错误:positional initialization of field in ‘struct’ declared with ‘designated_init’ attribute [-Werror=designated-init]
6413 | .may_pollfree = true,
| ^~~~
/mapp/communication_ipc/binder/binder.c:6413:25: 附注:(在‘binder_fops’的初始化附近)
cc1:有些警告被当作是错误
make[3]: *** [scripts/Makefile.build:243:/mapp/communication_ipc/binder/binder.o] 错误 1
make[2]: *** [/usr/lib/modules/6.6.0-28.0.0.34.oe2403.x86_64/build/Makefile:1924:/mapp/communication_ipc/binder] 错误 2
make[1]: *** [Makefile:234:__sub-make] 错误 2
make[1]: 离开目录“/usr/lib/modules/6.6.0-28.0.0.34.oe2403.x86_64/build”
make: *** [Makefile:13:all] 错误 2
你可能科隆了错误的分支。你说你的系统是24.03, 那就不能完全按照你帖子里的链接的安装指导。该安装指导科隆了22.03-LTS-SP2分支。假设你的系统是24.03-LTS:
git clone -b openEuler-24.03-LTS https://gitee.com/src-openeuler/communication_ipc.git
cd communication_ipc
tar zxvf binder-6.6.0.tar.gz
cd binder
patch -p1 < …/0003-Adapt-binder-as-a-kernel-module-on-kernel-6.6.0-10.patch
make - j 4
…