【发布时间】:2014-04-27 11:17:27
【问题描述】:
我正在尝试在我的 Linux x86 机器上为 ARM 机器交叉编译 rtl8192cu 驱动程序。我从Realtek website 下载了驱动程序。编译指南参考编辑Makefile如下:
确保 $PATH 变量包含您将用于交叉编译模块的工具链的位置。有关此目录的位置,请参阅设置说明。
将 KSRC 环境变量设置为 Beagleboard 内核源的位置(请参阅此目录路径的交叉编译环境设置说明)。
将 KVER 环境变量设置为您的 beagleboard 的内核版本。
为此,我编辑了:
KVER := 2.6.32(2.6.32.是BB的内核版本)
KSRC ?= /home/demetres/linux-2.6.32.61(编译的内核源代码,取自 BB,存储在home/demetres/linux-2.6.32.61 位置)
我的问题是:
我必须在 Makefile 的字段 CROSS_COMPILE: 上编辑什么?我编辑了路径/home/demetres/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin 但是
make 失败并出现以下错误:
make ARCH=arm CROSS_COMPILE=/home/demetres/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin -C /home/demetres/linux-2.6.32.61 M=/home/demetres/Downloads/rtl8188C_8192C_usb_linux_v4.0.2_9000.20130911 modules
make[1]: /home/demetres/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bingcc: Command not found
make[1]: Entering directory `/home/demetres/linux-2.6.32.61'
CC [M] /home/demetres/Downloads/rtl8188C_8192C_usb_linux_v4.0.2_9000.20130911/core/rtw_cmd.o
/bin/sh: /home/demetres/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bingcc: No such file or directory
make[2]: *** [/home/demetres/Downloads/rtl8188C_8192C_usb_linux_v4.0.2_9000.20130911/core/rtw_cmd.o] Error 1
make[1]: *** [_module_/home/demetres/Downloads/rtl8188C_8192C_usb_linux_v4.0.2_9000.20130911] Error 2
make[1]: Leaving directory `/home/demetres/linux-2.6.32.61'
make: *** [modules] Error 2
INFO: x86 机器上的跨工具链来自 CodeSourcery。我在CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin 位置运行arm-none-linux-gnueabi-gcc helloworld.c –o helloworld,为BB 交叉编译了一个helloworld.c。
【问题讨论】:
-
你在 x86 或 beagle board 上编译吗?
-
如果您在 x86 上进行交叉编译,请确保 usr/src/linux-2.6.32.61 已针对 beagle 板进行交叉编译或至少配置为 beagle 板,以便 makefile 获得正确的架构。
-
我编辑了我的问题。如果您能看一看,我将不胜感激。
标签: makefile arm cross-compiling toolchain codesourcery