2

我想将 corss_compiler D-bus 武装起来。

工具链:arm-linux-gcc-3.4.1

配置选项:CC=arm-linux-gcc ./configure --prefix=/opt/dbus/ --host=arm-linux --enable-abstract-sockets -with-xml=expat

源代码:d-bus-1.2.24 d-bus-1.3.1 d-bus-1.4.0

make[2]: Entering directory `/home/mandy/Desktop/apps/d-bus/remotec/dbus-1.4.0/bus'
  CCLD   dbus-daemon
/usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/../../../../arm-linux/bin/ld: Warning: gc-sections option ignored
dbus_daemon-bus.o(.text.process_config_postinit+0x120): In function `bus_context_check_security_policy':
/home/mandy/Desktop/apps/d-bus/remotec/dbus-1.4.0/bus/bus.c:1638: undefined reference to `bus_set_watched_dirs'
/usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/../../../../arm-linux/lib/libc_nonshared.a(elf-init.oS)(.text+0x44): In function `__libc_csu_init':
: undefined reference to `__init_array_end'
/usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/../../../../arm-linux/lib/libc_nonshared.a(elf-init.oS)(.text+0x48): In function `__libc_csu_init':
: undefined reference to `__init_array_start'
/usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/../../../../arm-linux/lib/libc_nonshared.a(elf-init.oS)(.text+0x8c): In function `__libc_csu_fini':
: undefined reference to `__fini_array_end'
/usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/../../../../arm-linux/lib/libc_nonshared.a(elf-init.oS)(.text+0x90): In function `__libc_csu_fini':
: undefined reference to `__fini_array_start'
collect2: ld returned 1 exit status
make[2]: *** [dbus-daemon] Error 1
make[2]: Leaving directory `/home/mandy/Desktop/apps/d-bus/remotec/dbus-1.4.0/bus'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/mandy/Desktop/apps/d-bus/remotec/dbus-1.4.0'
make: *** [all] Error 2

在 dbus-1.2.24 和 dbus-1.3.1 也得到同样的错误。

我能这样吗?

多谢。

4

1 回答 1

3

这些是为 avr32 架构交叉编译 dbus 的一般说明。基于手臂的这个参考(第 3 篇文章),我创建了这个小教程。我发布我的教程是因为它可能对其他人有用,甚至对您比较命令有用。


外籍人士图书馆

为了交叉编译 dbus,首先需要交叉编译 Expat 库。使用选项前缀,您可以指定必须安装它的位置。

下载 expat src 代码: ftp: //ftp.free.fr/.mirrors1/ftp.netbsd.org/packages/distfiles/expat-2.0.1.tar.gz

解压它:

tar zxvf expat-2.0.1.tar.gz 

使用适当的主机和 c 编译器对其进行配置。您必须安装 avr32 linux 工具链(Buildroot 为您编译工具链,您必须将二进制文件路径添加到环境变量 $PATH)

cd expat-2.0.1/ 
./configure --host=avr32-linux --prefix=/home/juan/builds/build_expat/ CC=avr32-linux-gcc
make; make install 

总线

下载dbus src代码: http ://dbus.freedesktop.org/releases/dbus/dbus-1.5.0.tar.gz

解压它:

tar zxvf dbus-1.5.0.tar.gz
cd dbus-1.5.0.tar.gz 

配置为 expat 库指定安装文件夹(--prefix)、c 编译器、include 文件夹和 lib 文件夹:

./configure --prefix=/home/juan/builds/build_dbus/ --host=avr32-linux --with-x=no ac_cv_have_abstract_sockets=yes "CC=avr32-linux-gcc -I/home/juan/builds/build_expat/include -L/home/juan/builds/build_expat/lib"

make;make install; 
于 2011-05-11T02:39:56.730 回答