Lines Matching +full:build +full:- +full:android
1 Android title
4 Mesa hardware drivers can be built for Android one of two ways: built
5 into the Android OS using the ndk-build build system on older versions
6 of Android, or out-of-tree using the Meson build system and the
7 Android NDK.
9 The ndk-build build system has proven to be hard to maintain, as one
10 needs a built Android tree to build against, and it has never been
11 tested in CI. The Meson build system flow is frequently used by
12 Chrome OS developers for building and testing Android drivers.
14 Building using the Android NDK
15 ------------------------------
19 ``~/.local/share/meson/cross/android-aarch64`` file:
21 .. code-block:: ini
24 ar = 'NDKDIR/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-ar'
25 c = ['ccache', 'NDKDIR/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android29-clang']
26 …built/linux-x86_64/bin/aarch64-linux-android29-clang++', '-fno-exceptions', '-fno-unwind-tables', …
29 strip = 'NDKDIR/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-strip'
30 # Android doesn't come with a pkg-config, but we need one for Meson to be happy not
31 # finding all the optional deps it looks for. Use system pkg-config pointing at a
32 # directory we get to populate with any .pc files we want to add for Android
33 pkgconfig = ['env', 'PKG_CONFIG_LIBDIR=NDKDIR/pkgconfig', '/usr/bin/pkg-config']
41 Now, use that cross file for your Android build directory (as in this
42 one cross-compiling the turnip driver for a stock Pixel phone)
44 .. code-block:: sh
46 meson setup build-android-aarch64 \
47 --cross-file android-aarch64 \
48 -Dplatforms=android \
49 -Dplatform-sdk-version=26 \
50 -Dandroid-stub=true \
51 -Dgallium-drivers= \
52 -Dvulkan-drivers=freedreno \
53 -Dfreedreno-kmds=kgsl
54 meson compile -C build-android-aarch64
56 Replacing Android drivers on stock Android
57 ------------------------------------------
60 read-only disk image on ``/vendor``. To be able to replace them for
64 .. code-block:: sh
66 adb disable-verity
68 adb remount -R
72 .. code-block:: sh
74 …adb push build-android-aarch64/src/freedreno/vulkan/libvulkan_freedreno.so /vendor/lib64/hw/vulkan…
78 meson.build to change the SONAME.
80 Replacing Android drivers on Chrome OS
81 --------------------------------------
83 Chrome OS's ARC++ is an Android container with hardware drivers inside
85 a read-only squashfs image on disk. For doing rapid driver
91 On your device, you'll want to make ``/`` read-write. ssh in as root
94 .. code-block:: sh
97 /usr/share/vboot/bin/make_dev_ssd.sh --remove_rootfs_verification --partitions 4
100 Then, we'll switch Android from using an image for ``/vendor`` to using a
101 bind-mount from a directory we control.
103 .. code-block:: sh
105 cd /opt/google/containers/android/
106 mkdir vendor-ro
107 mount -o loop vendor.raw.img vendor-ro
108 cp -a vendor-ro vendor-rw
117 "source": "/opt/google/containers/android/vendor-rw",
126 .. code-block:: sh
130 At this point, your android container is restarted with your new
131 bind-mount ``/vendor``, and if you use ``android-sh`` to shell into it
136 Now, replacing your DRI driver with a new one built for Android should
139 .. code-block:: sh
141 scp msm_dri.so $HOST:/opt/google/containers/android/vendor-rw/lib64/dri/
143 You can do your build of your DRI driver using ``emerge-$BOARD
144 arc-mesa-freedreno`` (for example) if you have a source tree with
145 ARC++, but it should also be possible to build using the NDK as
147 example the build will require that you have your arc-libdrm build
152 .. code-block:: sh
154 scp $HOST:/opt/google/containers/android/vendor-rw/lib64/libdrm.so \
155 NDKDIR/sysroot/usr/lib/aarch64-linux-android/lib/
157 ln -s \
165 find you need to reload the whole Android container. To do so without
169 .. code-block:: sh
171 kill $(cat /run/containers/android-run_oci/container.pid )