1
votes

I want to cross-compile rtl8192cu driver targeting ARM Angstrom (BeagleBoard), on x86 Ubuntu 13.04.

Cross-compile prerequisites:

  1. rtl8192cu driver
  2. Cross-toolchain (CodeSourcery / arm-angstrom-linux-gnueabi)
  3. kernel sources

For this reason, I copied kernel sources usr/src directory of BeagleBoard, on Ubuntu machine (they heve been compiled on BeagleBoard, as I needed to rebuild the kernel).

Running make for cross-compile, I get this error:

make ARCH=arm CROSS_COMPILE=/home/demetres/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin/arm-none-linux-gnueabi- -C /home/demetres/Desktop/ks1 M=/home/demetres/Desktop/rtl3  modules
make[1]: Entering directory `/home/demetres/Desktop/ks1'
  CC [M]  /home/demetres/Desktop/rtl3/core/rtw_cmd.o
/bin/sh: scripts/basic/fixdep: cannot execute binary file
make[2]: *** [/home/demetres/Desktop/rtl3/core/rtw_cmd.o] Error 126
make[1]: *** [_module_/home/demetres/Desktop/rtl3] Error 2
make[1]: Leaving directory `/home/demetres/Desktop/ks1'
make: *** [modules] Error 2

If I run file fixdep I get:

fixdep: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped

This makes sense, as fixdep, is part of kernel sources (compiled on ARM platform).

My query is: Is that procedure correct and how can I fix this error?

EDIT:

Running make V=1:

make ARCH=arm CROSS_COMPILE=/home/demetres/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin/arm-none-linux-gnueabi- -C /home/demetres/Desktop/ks M=/home/demetres/Desktop/rtl  modules
make[1]: Entering directory `/home/demetres/Desktop/ks'
test -e include/linux/autoconf.h -a -e include/config/auto.conf || (        \
    echo;                               \
    echo "  ERROR: Kernel configuration is invalid.";       \
    echo "         include/linux/autoconf.h or include/config/auto.conf are missing.";  \
    echo "         Run 'make oldconfig && make prepare' on kernel src to fix it.";  \
    echo;                               \
    /bin/false)
mkdir -p /home/demetres/Desktop/rtl/.tmp_versions ; rm -f /home/demetres/Desktop/rtl/.tmp_versions/*
make -f scripts/Makefile.build obj=/home/demetres/Desktop/rtl
  /home/demetres/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin/arm-none-linux-gnueabi-gcc -Wp,-MD,/home/demetres/Desktop/rtl/core/.rtw_cmd.o.d  -nostdinc -isystem /home/demetres/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin/../lib/gcc/arm-none-linux-gnueabi/4.7.3/include -Iinclude  -I/home/demetres/Desktop/ks/arch/arm/include -include include/linux/autoconf.h -D__KERNEL__ -mlittle-endian -Iarch/arm/mach-versatile/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -Os -marm -fno-omit-frame-pointer -mapcs -mno-sched-prolog -mabi=apcs-gnu -mno-thumb-interwork -D__LINUX_ARM_ARCH__=5 -march=armv5te -mtune=arm9tdmi -msoft-float -Uarm -Wframe-larger-than=1024 -fno-stack-protector -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fno-dwarf2-cfi-asm -fconserve-stack -O1 -Wno-unused-variable -Wno-unused-value -Wno-unused-label -Wno-unused-parameter -Wno-unused-function -Wno-unused -Wno-uninitialized -I/home/demetres/Desktop/rtl/include -DCONFIG_POWER_SAVING -DCONFIG_LITTLE_ENDIAN  -DMODULE -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(rtw_cmd)"  -D"KBUILD_MODNAME=KBUILD_STR(8192cu)"  -c -o /home/demetres/Desktop/rtl/core/rtw_cmd.o /home/demetres/Desktop/rtl/core/rtw_cmd.c
/bin/sh: scripts/basic/fixdep: cannot execute binary file
make[2]: *** [/home/demetres/Desktop/rtl/core/rtw_cmd.o] Error 126
make[1]: *** [_module_/home/demetres/Desktop/rtl] Error 2
make[1]: Leaving directory `/home/demetres/Desktop/ks'
make: *** [modules] Error 2
1
try V=1 option in command and paste the resultvinay hunachyal
Question has been edited with the result of make V=1. I checked about missing files but there are exactly where they should be: include/linux/autoconfig.h and include/config/auto.conf.dempap

1 Answers

0
votes

fixdep is an ARM binary and you are trying to run it on x86 machine(intel). You probably have to recompile kernel resources (just make them) and try cross compiling again.