NDK

您所在的位置:网站首页 clang源码分析 NDK

NDK

2023-03-17 01:06| 来源: 网络整理| 查看: 265

注意:要是用于NDK交叉编译qemu的依赖库,编译器工具API级别要在30以后,最好用33

因为只有30以后的版本支持函数memfd_create,详情请看http://t.csdn.cn/465cy

1.下载glib-2.73.3.tar.xz

Index of /sources/glib/2.73/https://download.gnome.org/sources/glib/2.73/?C=M&O=Aglibc相关包比较齐全的网址(包括glibc-ports,glibc-linuxheader):

https://ftp.gnu.org/pub/gnu/glibc/?C=N;O=A

glib与glibc不一样,我这里只是想做一下记录,忽视就可以了。

2.解压

tar -xvf glib-2.73.3.tar.xz

cd glib-2.73.3 &&mkdir build 

3.编写android.cache文档

android.cache内容,文档名字是android_crossfile.txt这个可以自己定义,如下:

[binaries] c = 'aarch64-linux-android21-clang' cpp ='aarch64-linux-android21-clang++' ar = 'llvm-ar' strip = 'llvm-strip'

[properties] sys_root = '${SYSROOT}' pkg_config_libdir = '${SYSROOT}/usr/lib/pkgconfig'

[host_machine] system = 'android' cpu_family = 'aarch64' cpu = 'arm8' endian = 'little'

其中的参数可以去glibc的官方网址查看交叉编译的介绍

Cross compilationhttps://mesonbuild.com/Cross-compilation.html#changing-cross-file-settings4.编译安装

meson setup -Dxattr=true --prefix=/home/dubu/installtest --cross-file android_crossfile.txt build

meson compile -C build

meson install -C build

 --cross-file指定cache文件

后面加的build是指定编译的目录



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3