嵌入式交叉编译:glib(未成功)
- 下载
Index of /sources/glib/
我下载了最新的2.83.0,编译时提示meson版本需要1.4.0,于是下载了2.70.5
安装meson
sudo apt install -y meson
- 新建文件cross_file.txt
[host_machine]
system = 'linux'
cpu_family = 'arm'
cpu = 'arm'
endian = 'little'
[built-in options]
c_args = []
c_link_args = []
[binaries]
c = 'aarch64-mix210-linux-gcc'
cpp = 'aarch64-mix210-linux-g++'
ar = 'aarch64-mix210-linux-ar'
ld = 'aarch64-mix210-linux-ld'
objcopy = 'aarch64-mix210-linux-objcopy'
strip = 'aarch64-mix210-linux-strip'
pkgconfig = 'aarch64-mix210-linux-pkg-config'
- 配置
LIB_DIR=${HOME}/build_libs/lib64
BUILD_DIR=`pwd`/builddir
if [ ! -d ${BUILD_DIR} ]; then
mkdir ${BUILD_DIR}
fi
export LD_LIBRARY_PATH=${LIB_DIR}
meson \
setup --cross-file cross_file.txt \
builddir --prefix ${BUILD_DIR}
结果报错(libffi需要特殊版本?):
fatal error: ffitarget-aarch64.h: No such file or directory
- 编译
cd build
ninja
ninja install