交叉编译 glib

首先创建文件 arm-linux.cache,内容如下:

$ cat arm-linux.cache 
ac_cv_type_long_long=yes
glib_cv_stack_grows=no
glib_cv_uscore=no
ac_cv_func_posix_getpwuid_r=yes

然后去掉 write属性:

chmod a-w arm-linux.cache

之后,执行 configure:

./configure --host=arm-linux-gnueabi     --prefix=/home/charles/code/build_systemd/_install --cache-file=arm-linux.cache CFLAGS=-I/home/charles/code/build_systemd/_install/include LDFLAGS=-L/home/charles/code/build_systemd/_install/lib

参考:

http://blog.csdn.net/absurd/article/details/646993


为了解决对于 libffi的依赖,在配置的时候,需要加上

LIBFFI_CFLAGS="-I/home/charles/code/build_systemd/_install/lib/libffi-3.2.1/include" LIBFFI_LIBS="-I/home/charles/code/build_systemd/_install/lib -lffi"

最后 link的时候报错:

/toolchain/armv7-gcc-6.3/bin/../lib/gcc/arm-linux-gnueabi/6.3.0/../../../../arm-linux-gnueabi/bin/ld: warning: libgmodule-2.0.so.0, needed by ./.libs/libgio-2.0.so, not found (try using -rpath or -rpath-link)
./.libs/libgio-2.0.so: undefined reference to `g_module_close'
./.libs/libgio-2.0.so: undefined reference to `g_module_symbol'
./.libs/libgio-2.0.so: undefined reference to `g_module_supported'
./.libs/libgio-2.0.so: undefined reference to `g_module_open'
./.libs/libgio-2.0.so: undefined reference to `g_module_error'

解决方法是,在 gio/Makefile 里找到 LDFLAGS, 在最后加 -lgmodule-2.0


但之后还有这样的错误:

  GEN      glib-compile-schemas.1
Error: no ID for constraint linkend: "GSettings".
Error: no ID for constraint linkend: "GSettings".
  GEN      glib-compile-resources.1
Error: no ID for constraint linkend: "GResource".
Error: no ID for constraint linkend: "GResource".
Error: no ID for constraint linkend: "G-GNUC-INTERNAL:CAPS".

还没搞懂这个是什么意思。。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值