• Home
  • Raw
  • Download

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 Android.mk build system on older versions
6 of Android, or out-of-tree using the Meson build system and the
7 Android NDK.
9 The Android.mk 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::
22 ar = 'NDKDIR/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-ar'
23 c = ['ccache', 'NDKDIR/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android29-clang']
24 …built/linux-x86_64/bin/aarch64-linux-android29-clang++', '-fno-exceptions', '-fno-unwind-tables', …
27 strip = 'NDKDIR/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-strip'
28 # Android doesn't come with a pkg-config, but we need one for meson to be happy not
29 # finding all the optional deps it looks for. Use system pkg-config pointing at a
30 # directory we get to populate with any .pc files we want to add for Android
31 pkgconfig = ['env', 'PKG_CONFIG_LIBDIR=NDKDIR/pkgconfig', '/usr/bin/pkg-config']
39 Now, use that cross file for your Android build directory (as in this
40 one cross-compiling the turnip driver for a stock Pixel phone)
42 .. code-block:: console
44 meson build-android-aarch64 \
45 --cross-file android-aarch64 \
46 -Dplatforms=android \
47 -Dplatform-sdk-version=26 \
48 -Dandroid-stub=true \
49 -Dgallium-drivers= \
50 -Dvulkan-drivers=freedreno \
51 -Dfreedreno-kgsl=true
52 ninja -C build-android-aarch64
54 Replacing Android drivers on stock Android
55 ------------------------------------------
58 read-only disk image on ``/vendor``. To be able to replace them for
62 .. code-block:: console
64 adb disable-verity
66 adb remount -R
70 .. code-block:: console
72 …adb push build-android-aarch64/src/freedreno/vulkan/libvulkan_freedreno.so /vendor/lib64/hw/vulkan…
76 meson.build to change the SONAME.
78 Replacing Android drivers on Chrome OS
79 --------------------------------------
81 Chrome OS's ARC++ is an Android container with hardware drivers inside
83 a read-only squashfs image on disk. For doing rapid driver
89 On your device, you'll want to make ``/`` read-write. ssh in as root
92 .. code-block:: console
95 /usr/share/vboot/bin/make_dev_ssd.sh --remove_rootfs_verification --partitions 4
98 Then, we'll switch Android from using an image for ``/vendor`` to using a
99 bind-mount from a directory we control.
101 .. code-block:: console
103 cd /opt/google/containers/android/
104 mkdir vendor-ro
105 mount -o loop vendor.raw.img vendor-ro
106 cp -a vendor-ro vendor-rw
115 "source": "/opt/google/containers/android/vendor-rw",
124 .. code-block:: console
128 At this point, your android container is restarted with your new
129 bind-mount ``/vendor``, and if you use ``android-sh`` to shell into it
134 Now, replacing your DRI driver with a new one built for Android should
137 .. code-block:: console
139 scp msm_dri.so $HOST:/opt/google/containers/android/vendor-rw/lib64/dri/
141 You can do your build of your DRI driver using ``emerge-$BOARD
142 arc-mesa-freedreno`` (for example) if you have a source tree with
143 ARC++, but it should also be possible to build using the NDK as
145 example the build will require that you have your arc-libdrm build
150 .. code-block:: console
152 scp $HOST:/opt/google/containers/android/vendor-rw/lib64/libdrm.so \
153 NDKDIR/sysroot/usr/lib/aarch64-linux-android/lib/
155 ln -s \
163 find you need to reload the whole Android container. To do so without
167 .. code-block:: console
169 kill $(cat /run/containers/android-run_oci/container.pid )