Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#49 Cross-compiling linux-gpib for ARM target

open
nobody
None
5
2011-12-12
2011-12-12
Lampus
No

Hello.
I have successfully cross-compiled linux-gpib for ARM target, but with some ugly hacks. Keithley KUSB-488A with ni_usb_b driver were tested on AT91SAM9260 processor using ibtest program and DC power supply with GPIB interface.
linux-gpib version: SVN Revision 1584

Next problems have occurred during compilation:
1. implicit declaration of functions 'kmalloc' and 'kfree' in files drivers/gpib/cec/init.c and drivers/gpib/ines/ines_init.h
Solution: add #include <linux/slab.h>
2. implicit declaration of functions 'get_fs' and 'set_fs' in file drivers/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c
Solution: add #include <asm/uaccess.h>
3. For some reasons gcc parameters don't contain include path ${LINUX_SRCDIR}/include
Part of build log:
gcc -I/media/stuff/StarterKit/new_src/gpib/linux-gpib_trunk_build/for_arm_cross -I/media/stuff/StarterKit/new_src/gpib/linux-gpib_trunk_build/for_arm_cross/drivers/gpib/include -I/media/stuff/StarterKit/new_src/gpib/linux-gpib_trunk_build/for_arm_cross/include -Wp,-MD,/media/stuff/StarterKit/new_src/gpib/linux-gpib_trunk_build/for_arm_cross/drivers/gpib/tnt4882/.mite.o.d -nostdinc -isystem /opt/arm-2010q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1/include -I/media/stuff/StarterKit/new_src/linux-2.6.39.2_st3/arch/arm/include -Iinclude -include include/generated/autoconf.h -D__KERNEL__ -mlittle-endian -Iarch/arm/mach-at91/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__=5 -march=armv5te -mtune=arm9tdmi -msoft-float -Uarm -Wframe-larger-than=1024 -fno-stack-protector -fomit-frame-pointer -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -DMODULE -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(mite)" -D"KBUILD_MODNAME=KBUILD_STR(tnt4882)" -c -o /media/stuff/StarterKit/new_src/gpib/linux-gpib_trunk_build/for_arm_cross/drivers/gpib/tnt4882/mite.o /media/stuff/StarterKit/new_src/gpib/linux-gpib_trunk_build/for_arm_cross/drivers/gpib/tnt4882/mite.c
/media/stuff/StarterKit/new_src/gpib/linux-gpib_trunk_build/for_arm_cross/drivers/gpib/tnt4882/mite.c: In function 'mite_init':
/media/stuff/StarterKit/new_src/gpib/linux-gpib_trunk_build/for_arm_cross/drivers/gpib/tnt4882/mite.c:87: error: implicit declaration of function 'pci_dev_get'

My ./configure parameters:
export PATH="/opt/arm-2010q1/bin/:$PATH"
export CROSS_COMPILE="/opt/arm-2010q1/bin/arm-none-linux-gnueabi-"
export ARCH=arm
./configure \ --host=arm-none-linux-gnueabi \ --with-linux-srcdir=/media/stuff/StarterKit/new_src/linux-2.6.39.2_st3 \ --disable-guile-binding \ --disable-perl-binding \ --disable-php-binding \ --disable-python-binding \ --disable-tcl-binding

Discussion

  • I added the missing header includes to svn, but I've never done any cross-compiling so I can't be much help there.