交叉編譯 glib

2021-07-31 20:48:18 字數 1851 閱讀 5114

首先建立檔案 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

參考:為了解決對於 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".

還沒搞懂這個是什麼意思。。

glib 交叉編譯記錄

redhat6.5平台 glib版本 glib 2.45.2 原始碼資源url libffi 3.2.1.tar.gz glib 2.45.2.tar.xz zlib 1.2.3.tar.bz2 使用glib 2.55.2版本 有找不到lmount問題,即使主機上已經編譯安裝了util linux ...

mipsel下交叉編譯glib 2 24

編譯這個也花了不少工夫,configure的時候老是報一些cannot test的error.鬱悶死 幾經波折,終於找到根救命稻草 按照說明及出錯資訊 1 建立 mipsel.cache,內容如下 glib cv stack grows no glib cv uscore no ac cv func...

編譯 交叉編譯

交叉編譯含義 是指在乙個平台上生成另乙個平台上的可執行 同乙個體系結構可以執行不同的作業系統,同樣乙個作業系統也可以在不同的體系結構上執行 例 常說的x86 linux平台 指inter x86體系結構及linux for x86作業系統 x86 winnt平台 指inter x86體系結構及win...