
With a CFLAGS -v set I get the text shown in the attached. Thanks -------- Original Message -------- Subject: Re: Cross Compile Module for armv7 Date: Fri, 09 May 2014 18:33:57 +1000 From: Robert Brown <rebrown@exemail.com.au> To: luv-main@luv.asn.au On 09/05/14 17:35, Erik Christiansen wrote:
First, harking back to your OP, whose introductory scene-setting I didn't read closely enough last night before jumping to the make errors:
On 08.05.14 20:49, Robert Brown wrote:
The DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0-master folder contains source files for a module I need rtl2832.ko and some other related ones.
I need to compile it for a 3.4 kernel on a sun4i armv7 platform so I get the kernel source from github sunxi. Typo there. I _got_ the kernel source from github sunxi. It's a Pat Wood creation. Is there a "did" missing between "I" and "get"? Since later posts show that no dvb-usb.h exists for kernel 3.4, you still need kernel 3.4 headers, AFAICT. Have you looked for a separate headers source package? That's how native headers are provided, so it would be unsurprising for that ARM kernel to be similarly packaged. (See also end of this post)
On 09.05.14 08:05, Robert Brown wrote:
I only have this like CFLAGS in the Makefile: EXTRA_CFLAGS += -I$(KBUILD_SRC)/drivers/media/dvb/dvb-usb/ \ -I$(KBUILD_SRC)/drivers/media/dvb/dvb-core/ \ -I$(KBUILD_SRC)/drivers/media/dvb/frontends/ \ -I$(KBUILD_SRC)/drivers/media/common/tuners/ \ -I$(SOURCEDIR)/$(INCLUDE_EXTRA_DVB) Should I tack a -v on the end of this? That would do, or since it's only temporary, for debugging, it would be easier and more visible if just tacked onto the "GCC =" definition. The effect is the same. (It is stuffed somewhere in the gcc invocation, as a command-line option.)
That is to find the include path actually used at compile time, and here you've serendipitously provided an explicitly specified include path for dvb-usb headers. There's no guarantee that that's the only (or first) place it'll look, but you could already check what $(KBUILD_SRC) is set to, and check whether $(KBUILD_SRC)/drivers/media/dvb/dvb-usb/ exists. Once you set include-340, that would appear to point to stuff you don't have, or is my visualisation of what I can't see from here inaccurate? No you are right there is nothing in an include-340 directory. From what I had read it seems like that is what it needs for a 3.4 kernel but it does not appear available on the web. I will insert the -v and report back with results.
BTW uname -ra shows Linux debian 3.4.67-sun4i+ #10 PREEMPT Sun Nov 24 17:13:58 EST 2013 armv7l GNU/Linux which is why I was looking for a directory include-340 OK, that's on the target, not the build machine, right? ('cos if that's the build machine, then a native compile would do, and life would be much simpler. Just checkin') Yes that is uname from the target arm machine. That was to point out that the module is required for a 3.4 kernel. Its still the case that the 'make' doesn't get to first base when not run from the sub-directory. I have tried CROSS-COMPILEing on my laptop as well where it also falls over unless I cd to the sub-directory. When you run:
$ locate dvb-usb.h
on the target, does it show anything? (Or "find" if the target lacks "locate".) If so, you have a copy of the required header, just not where you need it.
You will be able to see from the following that I have had numerous attempts and various methods to get this going. The one in bold is probably the one I need? debian@debian:~$ sudo find / -iname dvb-usb.h [sudo] password for debian: /home/debian/rtl2832u/media_build/linux/drivers/media/usb/dvb-usb/dvb-usb.h /home/debian/rtl2832u/media_build/v4l/dvb-usb.h /home/debian/rtl2832u/dvb-usb.h /home/debian/drivers/media/dvb/dvb-usb/dvb-usb.h /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/dvb-usb.h /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/include-300/dvb-usb.h /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/include-320/dvb-usb.h /home/debian/media_build/linux/drivers/media/usb/dvb-usb/dvb-usb.h /home/debian/media_build/v4l/dvb-usb.h* **/home/debian/linux-sunxi-pat-3.4.67/drivers/media/dvb/dvb-usb/dvb-usb.h* /home/debian/Desktop/media_build/linux/drivers/media/usb/dvb-usb/dvb-usb.h /home/debian/Desktop/media_build/v4l/dvb-usb.h /home/debian/rtl2832u1/dvb-usb.h /robskernel/rtl2832u/dvb-usb.h /robskernel/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/include-300/dvb-usb.h /robskernel/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/include-320/dvb-usb.h /robskernel/media_build/linux/drivers/media/usb/dvb-usb/dvb-usb.h /robskernel/linux-sunxi-pat-3.4.67/drivers/media/dvb/dvb-usb/dvb-usb.h /robskernel/rtl/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0-master/RTL2832-2.2.2_kernel-3.0.0/include-300/dvb-usb.h /robskernel/rtl/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0-master/RTL2832-2.2.2_kernel-3.0.0/include-320/dvb-usb.h /robskernel/themagicpudding-rtl2832_2836_2840-f9ab69bf2eee/media_build/linux/drivers/media/dvb/dvb-usb/dvb-usb.h /robskernel/themagicpudding-rtl2832_2836_2840-f9ab69bf2eee/media_build/linux/drivers/media/usb/dvb-usb/dvb-usb.h /robskernel/themagicpudding-rtl2832_2836_2840-f9ab69bf2eee/media_build/v4l/dvb-usb.h I notice that there's an include directory in /home/debian/linux-sunxi-pat-3.4.67/ .. Does this indicate that I have kernel headers (or should I say kernel sources?)?
(I won't ask whether that kernel 3.0 stuff can build with kernel 3.4 headers, after all, it just might. You don't know till you try.) I have read confirmations that the modules have built successfully on kernels 3.0 through to 3.3 (using include-300 through to include-330) and then on 3.6 but am yet to find some-one who has done this on 3.4 other than the guy mcct on this link: http://www.cubieforums.com/index.php?topic=2427.0 This is where I started as I could not make full sense of his process.
If I can't get this to work with 3.4 I will have to wait an unknown length of time until the Allwinner kernel development hits the mainline kernel in release 3.15 - could be another 6 months.
Happy header hunting.
Erik Really appreciate that you have taken some time to digest this.
Regards Rob