Closed lucascastro closed 6 years ago
Hi @lucascastro,
did you use build.sh script to build or did you build by issuing make inside driver folder? Also, it seems you're pointing to host includes instead of an entire kernel with KDIR.
mm/cma.h is different from include/linux/cma.h, so that #include <../mm/cma.h> tries to include linux/mm/cma.h
Can you pastebin the entire build log?
Thanks
Just as HOWTO, ./build.sh -r $VERSION -b and I looked ./build.sh and tried just apply the patched to check if the file would be created and nothing about cma.h file. I tried on more than one branch.
later I'll post the build log.
the complete build log
lucas@arm-dev:~/build/sunxi-mali$ find . -name "*cma*" lucas@arm-dev:~/build/sunxi-mali$
I think you're missing to pass a KDIR. Maybe you are using headers only instead of entire kernel. cma.h exists under include/linux/cma.h from version >= 4.4 or before. Instead driver needs also mm/cma.h that is not provided by headers only. At this point I suggest you to get entire kernel sources and point KDIR to that path. This way mm/cma.h can be found. Try to double check for include/linux/cma.h it must exist in your headers.
Yes, it's that. I thought it was a file in sunxi-mali tree.
So, I can't build against running kernel just as kernel doc? Because cma.h exist at /usr/src/linux-headers-4.9.0-4-armmp-lpae/include/config/cma.h
There are 2 different cma.h files. One under include/linux the other under mm/ and they are different
As I know you can't. You need the entire kernel.
I don't think so, everything you may need is the headers. As the doc I had posted, the Kernel doc show how to compile against the running kernel.
Yes, but as you can see in the source where mm/cma.h is included there is a comment about it, that define it a hack and need a fix. So I tell you again you need entire kernel sources. If you have an idea how to fix it on code feel free to PR with a patch.
I'm already doing that way. Just posting to be noted because I took some time to notice that.
Ok, let's try to think about a workaround, if possible. It should compile as a normal module.
It should be fixed by 2d997d5f2e01
I didn't have time to test that yet. I guess in two weeks I'm gonna back to work on that.
Any update?
tried to build KERVERSION = 4.14.0-0.bpo.3-armmp-lpae but also tried on 4.9 4.9.0-5-armmp-lpae
sunxi-mali/r6p2/src/devicedrv/mali/platform/sunxi/sunxi.c:24:23: fatal error: ../mm/cma.h: No such file or directory
include <../mm/cma.h>
compilation terminated. /usr/src/linux-headers-4.9.0-5-common/scripts/Makefile.build:298: recipe for target '/home/lucas/build/sunxi-mali/r6p2/src/devicedrv/mali/platform/sunxi/sunxi.o' failed