Git Product home page Git Product logo

binder-for-linux's People

Contributors

hungys avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

binder-for-linux's Issues

project.sh returns an error

OS: Ubuntu 20.04 LTS
Shell: I've tried both BASH and ZSH, with the same results
The Error: When I try to ./project.sh makeall, I get this:

make[1]: Entering directory '/usr/src/linux-headers-5.4.0-42-generic'
  AR      /home/ma-ika/binder-for-linux/driver/binder/built-in.a
  CC [M]  /home/ma-ika/binder-for-linux/driver/binder/deps.o
/home/ma-ika/binder-for-linux/driver/binder/deps.c:32:6: error: conflicting types for ‘zap_page_range’
   32 | void zap_page_range(struct vm_area_struct *vma, unsigned long address, unsigned long size, struct zap_details *details)
      |      ^~~~~~~~~~~~~~
In file included from /home/ma-ika/binder-for-linux/driver/binder/deps.c:5:
./include/linux/mm.h:1457:6: note: previous declaration of ‘zap_page_range’ was here
 1457 | void zap_page_range(struct vm_area_struct *vma, unsigned long address,
      |      ^~~~~~~~~~~~~~
make[2]: *** [scripts/Makefile.build:275: /home/ma-ika/binder-for-linux/driver/binder/deps.o] Error 1
make[1]: *** [Makefile:1731: /home/ma-ika/binder-for-linux/driver/binder] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.4.0-42-generic'
make: *** [Makefile:15: all] Error 2
make -C /lib/modules/5.4.0-42-generic/build V=0 M=$PWD
make[1]: Entering directory '/usr/src/linux-headers-5.4.0-42-generic'
  AR      /home/ma-ika/binder-for-linux/driver/ashmem/built-in.a
  CC [M]  /home/ma-ika/binder-for-linux/driver/ashmem/deps.o
  CC [M]  /home/ma-ika/binder-for-linux/driver/ashmem/ashmem.o
In file included from ./include/linux/export.h:42,
                 from ./include/linux/linkage.h:7,
                 from ./include/linux/kernel.h:8,
                 from ./include/linux/list.h:9,
                 from ./include/linux/module.h:9,
                 from /home/ma-ika/binder-for-linux/driver/ashmem/ashmem.c:21:
/home/ma-ika/binder-for-linux/driver/ashmem/ashmem.c: In function ‘ashmem_mmap’:
/home/ma-ika/binder-for-linux/driver/ashmem/ashmem.c:375:33: error: too few arguments to function ‘calc_vm_prot_bits’
  375 |  if (unlikely((vma->vm_flags & ~calc_vm_prot_bits(asma->prot_mask)) &
      |                                 ^~~~~~~~~~~~~~~~~
./include/linux/compiler.h:78:42: note: in definition of macro ‘unlikely’
   78 | # define unlikely(x) __builtin_expect(!!(x), 0)
      |                                          ^
In file included from /home/ma-ika/binder-for-linux/driver/ashmem/ashmem.c:28:
./include/linux/mman.h:117:1: note: declared here
  117 | calc_vm_prot_bits(unsigned long prot, unsigned long pkey)
      | ^~~~~~~~~~~~~~~~~
In file included from ./include/linux/export.h:42,
                 from ./include/linux/linkage.h:7,
                 from ./include/linux/kernel.h:8,
                 from ./include/linux/list.h:9,
                 from ./include/linux/module.h:9,
                 from /home/ma-ika/binder-for-linux/driver/ashmem/ashmem.c:21:
/home/ma-ika/binder-for-linux/driver/ashmem/ashmem.c:376:8: error: too few arguments to function ‘calc_vm_prot_bits’
  376 |        calc_vm_prot_bits(PROT_MASK))) {
      |        ^~~~~~~~~~~~~~~~~
./include/linux/compiler.h:78:42: note: in definition of macro ‘unlikely’
   78 | # define unlikely(x) __builtin_expect(!!(x), 0)
      |                                          ^
In file included from /home/ma-ika/binder-for-linux/driver/ashmem/ashmem.c:28:
./include/linux/mman.h:117:1: note: declared here
  117 | calc_vm_prot_bits(unsigned long prot, unsigned long pkey)
      | ^~~~~~~~~~~~~~~~~
/home/ma-ika/binder-for-linux/driver/ashmem/ashmem.c: In function ‘ashmem_exit’:
/home/ma-ika/binder-for-linux/driver/ashmem/ashmem.c:870:6: error: void value not ignored as it ought to be
  870 |  ret = misc_deregister(&ashmem_misc);
      |      ^
make[2]: *** [scripts/Makefile.build:275: /home/ma-ika/binder-for-linux/driver/ashmem/ashmem.o] Error 1
make[1]: *** [Makefile:1731: /home/ma-ika/binder-for-linux/driver/ashmem] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.4.0-42-generic'
make: *** [Makefile:15: all] Error 2
make: Nothing to be done for 'all'.
gcc -I.. -Iinclude -DHAVE_PTHREADS -DHAVE_SYS_UIO_H -DHAVE_ENDIAN_H -DHAVE_ANDROID_OS=1 -std=c++11 -c -o utils/BlobCache.o utils/BlobCache.cpp
In file included from include/utils/SortedVector.h:26,
                 from include/utils/BlobCache.h:24,
                 from utils/BlobCache.cpp:24:
include/utils/Vector.h: In member function ‘const android::Vector<T>& android::Vector<TYPE>::operator=(const android::Vector<TYPE>&) const’:
include/utils/Vector.h:251:64: error: cannot convert ‘const android::Vector<TYPE>*’ to ‘android::VectorImpl*251 |     VectorImpl::operator = (static_cast<const VectorImpl&>(rhs));
      |                                                                ^
In file included from include/utils/Vector.h:26,
                 from include/utils/SortedVector.h:26,
                 from include/utils/BlobCache.h:24,
                 from utils/BlobCache.cpp:24:
include/utils/VectorImpl.h:56:59: note:   initializing argument 'this' of ‘android::VectorImpl& android::VectorImpl::operator=(const android::VectorImpl&)’
   56 |             VectorImpl&     operator = (const VectorImpl& rhs);
      |                                         ~~~~~~~~~~~~~~~~~~^~~
make: *** [Makefile:16: utils/BlobCache.o] Error 1
g++ -std=c++11 -o binderAddInts -I../libs/include -I.. -L../libs -DHAVE_PTHREADS -DHAVE_SYS_UIO_H -DHAVE_ENDIAN_H -DHAVE_ANDROID_OS=1 binderAddInts.cpp testUtil.c -lpthread -lbinder
In file included from ../libs/include/binder/Parcel.h:24,
                 from ../libs/include/binder/IPCThreadState.h:21,
                 from binderAddInts.cpp:49:
../libs/include/utils/Vector.h: In member function ‘const android::Vector<T>& android::Vector<TYPE>::operator=(const android::Vector<TYPE>&) const’:
../libs/include/utils/Vector.h:251:64: error: cannot convert ‘const android::Vector<TYPE>*’ to ‘android::VectorImpl*251 |     VectorImpl::operator = (static_cast<const VectorImpl&>(rhs));
      |                                                                ^
In file included from ../libs/include/utils/Vector.h:26,
                 from ../libs/include/binder/Parcel.h:24,
                 from ../libs/include/binder/IPCThreadState.h:21,
                 from binderAddInts.cpp:49:
../libs/include/utils/VectorImpl.h:56:59: note:   initializing argument 'this' of ‘android::VectorImpl& android::VectorImpl::operator=(const android::VectorImpl&)’
   56 |             VectorImpl&     operator = (const VectorImpl& rhs);
      |                                         ~~~~~~~~~~~~~~~~~~^~~
make: *** [Makefile:4: binderAddInts] Error 1

I then can't ./project.sh insmod or do anything else with binder.

Unknown symbol in module

OS: Manjaro Linux

Kernel version: 4.19.60

I copy binder.c/h, binder_alloc.c/h in linux 4.19.60 source code and overwrite binder.c/h in this projcet. Then I enter driver/binder folder and execute make command like following:

$ uname -r
4.19.60-1-MANJARO
$ cd driver/binder
$ make
make -C /lib/modules/4.19.60-1-MANJARO/build V=0 M=$PWD
make[1]: 进入目录“/usr/lib/modules/4.19.60-1-MANJARO/build”
  Building modules, stage 2.
  MODPOST 1 modules
WARNING: "binder_alloc_free_buf" [/home/xx/code/binder-for-linux-master/driver/binder/binder_linux.ko] undefined!
WARNING: "binder_alloc_prepare_to_free" [/home/xx/code/binder-for-linux-master/driver/binder/binder_linux.ko] undefined!
WARNING: "binder_alloc_get_allocated_count" [/home/xx/code/binder-for-linux-master/driver/binder/binder_linux.ko] undefined!
WARNING: "binder_alloc_new_buf" [/home/xx/code/binder-for-linux-master/driver/binder/binder_linux.ko] undefined!
WARNING: "binder_alloc_print_pages" [/home/xx/code/binder-for-linux-master/driver/binder/binder_linux.ko] undefined!
WARNING: "binder_alloc_vma_close" [/home/xx/code/binder-for-linux-master/driver/binder/binder_linux.ko] undefined!
WARNING: "binder_alloc_mmap_handler" [/home/xx/code/binder-for-linux-master/driver/binder/binder_linux.ko] undefined!
WARNING: "binder_alloc_shrinker_init" [/home/xx/code/binder-for-linux-master/driver/binder/binder_linux.ko] undefined!
WARNING: "binder_alloc_print_allocated" [/home/xx/code/binder-for-linux-master/driver/binder/binder_linux.ko] undefined!
WARNING: "binder_alloc_init" [/home/xx/code/binder-for-linux-master/driver/binder/binder_linux.ko] undefined!
WARNING: "binder_alloc_deferred_release" [/home/xx/code/binder-for-linux-master/driver/binder/binder_linux.ko] undefined!
make[1]: 离开目录“/usr/lib/modules/4.19.60-1-MANJARO/build”
$ sudo insmod binder_linux.ko
insmod: ERROR: could not insert module binder_linux.ko: Unknown symbol in module
$

following is systemd/journal output:

kernel: binder_linux: Unknown symbol binder_alloc_deferred_release (err -2)
kernel: binder_linux: Unknown symbol binder_alloc_init (err -2)
kernel: binder_linux: Unknown symbol binder_alloc_print_allocated (err -2)
kernel: binder_linux: Unknown symbol binder_alloc_shrinker_init (err -2)
kernel: binder_linux: Unknown symbol binder_alloc_mmap_handler (err -2)
kernel: binder_linux: Unknown symbol binder_alloc_vma_close (err -2)
kernel: binder_linux: Unknown symbol binder_alloc_print_pages (err -2)
kernel: binder_linux: Unknown symbol binder_alloc_new_buf (err -2)
kernel: binder_linux: Unknown symbol binder_alloc_get_allocated_count (err -2)
kernel: binder_linux: Unknown symbol binder_alloc_prepare_to_free (err -2)
kernel: binder_linux: Unknown symbol binder_alloc_free_buf (err -2)

How to solve this unknown symbol problem?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.