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 <[email protected]>
To: [email protected]
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
make: Entering directory `/home/debian/linux-sunxi-pat-3.4.67'
CC [M]
/home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/demod_rtl2832.o
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/4.6/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../src/configure -v --with-pkgversion='Debian 4.6.3-14'
--with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.6 --enable-shared --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object
--enable-plugin --enable-objc-gc --disable-sjlj-exceptions --with-arch=armv7-a
--with-fpu=vfpv3-d16 --with-float=hard --with-mode=thumb
--enable-checking=release --build=arm-linux-gnueabihf
--host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
Thread model: posix
gcc version 4.6.3 (Debian 4.6.3-14)
COLLECT_GCC_OPTIONS='-nostdinc' '-isystem'
'/usr/lib/gcc/arm-linux-gnueabihf/4.6/include' '-I'
'/home/debian/linux-sunxi-pat-3.4.67/arch/arm/include' '-I'
'arch/arm/include/generated' '-I' 'include' '-include'
'/home/debian/linux-sunxi-pat-3.4.67/include/linux/kconfig.h' '-D' '__KERNEL__'
'-mlittle-endian' '-I' 'arch/arm/mach-sun4i/include' '-I'
'arch/arm/plat-sunxi/include' '-Wall' '-Wundef' '-Wstrict-prototypes'
'-Wno-trigraphs' '-fno-strict-aliasing' '-fno-common'
'-Werror=implicit-function-declaration' '-Wno-format-security'
'-fno-delete-null-pointer-checks' '-O2' '-marm' '-fno-dwarf2-cfi-asm'
'-mabi=aapcs-linux' '-mno-thumb-interwork' '-funwind-tables' '-D'
'__LINUX_ARM_ARCH__=7' '-march=armv7-a' '-msoft-float' '-U' 'arm'
'-Wframe-larger-than=2048' '-fno-stack-protector'
'-Wno-unused-but-set-variable' '-fomit-frame-pointer' '-g'
'-Wdeclaration-after-statement' '-Wno-pointer-sign' '-fno-strict-overflow'
'-fconserve-stack' '-I' '/drivers/media/dvb/dvb-usb/' '-I'
'/drivers/media/dvb/dvb-core/' '-I' '/drivers/media/dvb/frontends/' '-I'
'/drivers/media/common/tuners/' '-I'
'/home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/include-320'
'-v' '-D' 'MODULE' '-D' 'KBUILD_STR(s)=#s' '-D'
'KBUILD_BASENAME=KBUILD_STR(demod_rtl2832)' '-D'
'KBUILD_MODNAME=KBUILD_STR(dvb_usb_rtl2832u)' '-c' '-o'
'/home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/.tmp_demod_rtl2832.o'
'-mfpu=vfpv3-d16'
/usr/lib/gcc/arm-linux-gnueabihf/4.6/cc1 -quiet -nostdinc -v -I
/home/debian/linux-sunxi-pat-3.4.67/arch/arm/include -I
arch/arm/include/generated -I include -I arch/arm/mach-sun4i/include -I
arch/arm/plat-sunxi/include -I /drivers/media/dvb/dvb-usb/ -I
/drivers/media/dvb/dvb-core/ -I /drivers/media/dvb/frontends/ -I
/drivers/media/common/tuners/ -I
/home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/include-320
-imultilib . -imultiarch arm-linux-gnueabihf -D __KERNEL__ -D
__LINUX_ARM_ARCH__=7 -U arm -D MODULE -D KBUILD_STR(s)=#s -D
KBUILD_BASENAME=KBUILD_STR(demod_rtl2832) -D
KBUILD_MODNAME=KBUILD_STR(dvb_usb_rtl2832u) -isystem
/usr/lib/gcc/arm-linux-gnueabihf/4.6/include -include
/home/debian/linux-sunxi-pat-3.4.67/include/linux/kconfig.h -MD
/home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/.demod_rtl2832.o.d
/home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/demod_rtl2832.c
-quiet -dumpbase demod_rtl2832.c -mlittle-endian -marm -mabi=aapcs-linux
-mno-thumb-interwork -march=armv7-a -msoft-float -mfpu=vfpv3-d16 -auxbase-strip
/home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/.tmp_demod_rtl2832.o
-g -O2 -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs
-Werror=implicit-function-declaration -Wno-format-security
-Wframe-larger-than=2048 -Wno-unused-but-set-variable
-Wdeclaration-after-statement -Wno-pointer-sign -version -fno-strict-aliasing
-fno-common -fno-delete-null-pointer-checks -fno-dwarf2-cfi-asm -funwind-tables
-fno-stack-protector -fomit-frame-pointer -fno-strict-overflow -fconserve-stack
-o /tmp/cca5mrtp.s
GNU C (Debian 4.6.3-14) version 4.6.3 (arm-linux-gnueabihf)
compiled by GNU C version 4.6.3, GMP version 5.0.5, MPFR version
3.1.0-p10, MPC version 0.9
GGC heuristics: --param ggc-min-expand=85 --param ggc-min-heapsize=103793
ignoring nonexistent directory "/drivers/media/dvb/dvb-usb/"
ignoring nonexistent directory "/drivers/media/dvb/dvb-core/"
ignoring nonexistent directory "/drivers/media/dvb/frontends/"
ignoring nonexistent directory "/drivers/media/common/tuners/"
#include "..." search starts here:
#include <...> search starts here:
/home/debian/linux-sunxi-pat-3.4.67/arch/arm/include
arch/arm/include/generated
include
arch/arm/mach-sun4i/include
arch/arm/plat-sunxi/include
/home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/include-320
/usr/lib/gcc/arm-linux-gnueabihf/4.6/include
End of search list.
GNU C (Debian 4.6.3-14) version 4.6.3 (arm-linux-gnueabihf)
compiled by GNU C version 4.6.3, GMP version 5.0.5, MPFR version
3.1.0-p10, MPC version 0.9
GGC heuristics: --param ggc-min-expand=85 --param ggc-min-heapsize=103793
Compiler executable checksum: 68d231530145667d43f9900d1efcd927
In file included from
/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:19:0,
from
/home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/foundation.h:19,
from
/home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/dvbt_demod_base.h:289,
from
/home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/demod_rtl2832.h:72,
from
/home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/demod_rtl2832.c:13:
/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_frontend.h:49:33:
error: field ‘parameters’ has incomplete type
/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_frontend.h:313:28:
error: array type has incomplete element type
make[1]: ***
[/home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/demod_rtl2832.o]
Error 1
make: ***
[_module_/home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0]
Error 2
make: Leaving directory `/home/debian/linux-sunxi-pat-3.4.67'_______________________________________________
luv-main mailing list
[email protected]
http://lists.luv.asn.au/listinfo/luv-main