Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Freedreno patches + remove non-functioning workflow file #1

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
57 changes: 0 additions & 57 deletions .github/android.yml

This file was deleted.

44 changes: 35 additions & 9 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: Build Android

on:
[push, pull_request]
[push, pull_request, workflow_dispatch]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
strategy:
matrix:
arch: [ "arm32", "aarch64", "x86_64"]
arch: [ "arm32", "aarch64", "x86_64" ]
fail-fast: false

name: "Build for ${{matrix.arch}}"
Expand All @@ -24,12 +24,32 @@ jobs:
sudo apt install -y meson libxrandr-dev libxxf86vm-dev libxcb-*-dev libx11-xcb-dev libxfixes-dev libdrm-dev libx11-dev
pip3 install mako
export ANDROID_NDK_HOME="$ANDROID_SDK_ROOT/ndk-bundle"
envsubst <android-drm-${{matrix.arch}} >build-crossfile-drm
git clone --depth 1 https://gitlab.freedesktop.org/mesa/drm.git
cd drm
meson setup "build-android" \
--prefix=/tmp/drm-static \
--cross-file "../build-crossfile-drm" \
-Ddefault_library=static \
-Dintel=disabled \
-Dradeon=disabled \
-Damdgpu=disabled \
-Dnouveau=disabled \
-Dvmwgfx=disabled \
-Dfreedreno=enabled \
-Dvc4=disabled \
-Detnaviv=disabled \
-Dfreedreno-kgsl=true
ninja -C "build-android" install
cd ..
envsubst <android-${{matrix.arch}} >build-crossfile
git clone --depth 1 https://github.com/Mesa3D/mesa
git clone --depth 1 https://gitlab.freedesktop.org/mesa/mesa.git
cd mesa
git apply --reject --whitespace=fix ../mesa-zink.diff || echo "git apply failed"
wget https://gitlab.freedesktop.org/mesa/mesa/-/commit/bed69133cda5bb6e29beacd61a665ef653d4d1f9.diff
git apply -v --whitespace=fix --reverse bed69133cda5bb6e29beacd61a665ef653d4d1f9.diff || echo "git apply failed"
git apply -v --whitespace=fix ../mesa-zink.diff || echo "git apply failed"
meson setup "build-android" \
--prefix=/tmp/zink \
--prefix=/tmp/mesa \
--cross-file "../build-crossfile" \
-Dplatforms=android \
-Dplatform-sdk-version=25 \
Expand All @@ -42,13 +62,19 @@ jobs:
-Dopengl=true \
-Dosmesa=true \
-Dvulkan-drivers= \
-Dgallium-drivers=zink \
-Dgallium-drivers=freedreno,zink \
-Dfreedreno-kmds=kgsl \
-Dshared-glapi=false \
-Dandroid-libbacktrace=disabled \
-Dbuildtype=release
ninja -C "build-android" install
cd build-android
if [ ${{matrix.arch}} == 'x86_64' ]
then
meson configure -Dgallium-drivers=zink
fi
ninja install
- name: Upload libraries
uses: actions/upload-artifact@v2
with:
name: libzink_${{matrix.arch}}
path: /tmp/zink
name: libOSMesa_${{matrix.arch}}
path: /tmp/mesa
10 changes: 7 additions & 3 deletions android-aarch64
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
[binaries]
ar = '$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar'
c = ['ccache', '$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang', '-O3', '-DVK_USE_PLATFORM_ANDROID_KHR', '-fPIC']
cpp = ['ccache', '$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang++', '-O3', '-DVK_USE_PLATFORM_ANDROID_KHR', '-fPIC', '-fno-exceptions', '-fno-unwind-tables', '-fno-asynchronous-unwind-tables', '-static-libstdc++']
c = ['ccache', '$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android26-clang', '-O3', '-DVK_USE_PLATFORM_ANDROID_KHR', '-fPIC']
cpp = ['ccache', '$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android26-clang++', '-O3', '-DVK_USE_PLATFORM_ANDROID_KHR', '-fPIC', '-fno-exceptions', '-fno-unwind-tables', '-fno-asynchronous-unwind-tables', '-static-libstdc++']
c_ld = 'lld'
cpp_ld = 'lld'
strip = '$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip'
# Android doesn't come with a pkg-config, but we need one for meson to be happy not
# finding all the optional deps it looks for. Use system pkg-config pointing at a
# directory we get to populate with any .pc files we want to add for Android
pkgconfig = ['env', 'PKG_CONFIG_LIBDIR=.', '/usr/bin/pkg-config']

# Also, include the plain DRM lib we found earlier. Panfrost relies on it rather heavily, especially when
# interacting with the panfrost DRM module and not kbase

pkgconfig = ['env', 'PKG_CONFIG_LIBDIR=.:/tmp/drm-static/lib/pkgconfig', '/usr/bin/pkg-config']

[host_machine]
system = 'linux'
Expand Down
10 changes: 7 additions & 3 deletions android-arm32
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
[binaries]
ar = '$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar'
c = ['ccache', '$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi24-clang', '-O3', '-DVK_USE_PLATFORM_ANDROID_KHR', '-fPIC']
cpp = ['ccache', '$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi24-clang++', '-O3', '-DVK_USE_PLATFORM_ANDROID_KHR', '-fPIC', '-fno-exceptions', '-fno-unwind-tables', '-fno-asynchronous-unwind-tables', '-static-libstdc++']
c = ['ccache', '$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi26-clang', '-O3', '-DVK_USE_PLATFORM_ANDROID_KHR', '-fPIC']
cpp = ['ccache', '$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi26-clang++', '-O3', '-DVK_USE_PLATFORM_ANDROID_KHR', '-fPIC', '-fno-exceptions', '-fno-unwind-tables', '-fno-asynchronous-unwind-tables', '-static-libstdc++']
c_ld = 'lld'
cpp_ld = 'lld'
strip = '$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip'
# Android doesn't come with a pkg-config, but we need one for meson to be happy not
# finding all the optional deps it looks for. Use system pkg-config pointing at a
# directory we get to populate with any .pc files we want to add for Android
pkgconfig = ['env', 'PKG_CONFIG_LIBDIR=.', '/usr/bin/pkg-config']

# Also, include the plain DRM lib we found earlier. Panfrost relies on it rather heavily, especially when
# interacting with the panfrost DRM module and not kbase

pkgconfig = ['env', 'PKG_CONFIG_LIBDIR=.:/tmp/drm-static/lib/pkgconfig', '/usr/bin/pkg-config']

[host_machine]
system = 'linux'
Expand Down
22 changes: 22 additions & 0 deletions android-drm-aarch64
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[binaries]
ar = '$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar'
c = ['ccache', '$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang', '-O3', '-DVK_USE_PLATFORM_ANDROID_KHR', '-fPIC']
cpp = ['ccache', '$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang++', '-O3', '-DVK_USE_PLATFORM_ANDROID_KHR', '-fPIC', '-fno-exceptions', '-fno-unwind-tables', '-fno-asynchronous-unwind-tables', '-static-libstdc++']
c_ld = 'lld'
cpp_ld = 'lld'
strip = '$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip'
# Android doesn't come with a pkg-config, but we need one for meson to be happy not
# finding all the optional deps it looks for. Use system pkg-config pointing at a
# directory we get to populate with any .pc files we want to add for Android
pkgconfig = ['env', 'PKG_CONFIG_LIBDIR=.', '/usr/bin/pkg-config']

[host_machine]
system = 'linux'
# cpu_family = 'x86_64'
# cpu = 'amd64'

# ik this is wrong but workaround sanity check
cpu_family = 'arm'
cpu = 'armv8'

endian = 'little'
22 changes: 22 additions & 0 deletions android-drm-arm32
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[binaries]
ar = '$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar'
c = ['ccache', '$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi24-clang', '-O3', '-DVK_USE_PLATFORM_ANDROID_KHR', '-fPIC']
cpp = ['ccache', '$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi24-clang++', '-O3', '-DVK_USE_PLATFORM_ANDROID_KHR', '-fPIC', '-fno-exceptions', '-fno-unwind-tables', '-fno-asynchronous-unwind-tables', '-static-libstdc++']
c_ld = 'lld'
cpp_ld = 'lld'
strip = '$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip'
# Android doesn't come with a pkg-config, but we need one for meson to be happy not
# finding all the optional deps it looks for. Use system pkg-config pointing at a
# directory we get to populate with any .pc files we want to add for Android
pkgconfig = ['env', 'PKG_CONFIG_LIBDIR=.', '/usr/bin/pkg-config']

[host_machine]
system = 'linux'
# cpu_family = 'x86_64'
# cpu = 'amd64'

# ik this is wrong but workaround sanity check
cpu_family = 'arm'
cpu = 'armv7'

endian = 'little'
12 changes: 6 additions & 6 deletions android-i686 → android-drm-x86_64
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[binaries]
ar = '$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar'
c = ['ccache', '$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android24-clang', '-O3', '-DVK_USE_PLATFORM_ANDROID_KHR', '-fPIC']
cpp = ['ccache', '$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android24-clang++', '-O3', '-DVK_USE_PLATFORM_ANDROID_KHR', '-fPIC', '-fno-exceptions', '-fno-unwind-tables', '-fno-asynchronous-unwind-tables', '-static-libstdc++']
c = ['ccache', '$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android24-clang', '-O3', '-DVK_USE_PLATFORM_ANDROID_KHR', '-fPIC']
cpp = ['ccache', '$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android24-clang++', '-O3', '-DVK_USE_PLATFORM_ANDROID_KHR', '-fPIC', '-fno-exceptions', '-fno-unwind-tables', '-fno-asynchronous-unwind-tables', '-static-libstdc++']
c_ld = 'lld'
cpp_ld = 'lld'
strip = '$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip'
Expand All @@ -12,11 +12,11 @@ pkgconfig = ['env', 'PKG_CONFIG_LIBDIR=.', '/usr/bin/pkg-config']

[host_machine]
system = 'linux'
cpu_family = 'x86'
cpu = 'i686'
# cpu_family = 'x86_64'
# cpu = 'amd64'

# ik this is wrong but workaround sanity check
#cpu_family = 'arm'
#cpu = 'armv8'
cpu_family = 'arm'
cpu = 'armv8'

endian = 'little'
6 changes: 5 additions & 1 deletion android-x86_64
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ strip = '$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip'
# Android doesn't come with a pkg-config, but we need one for meson to be happy not
# finding all the optional deps it looks for. Use system pkg-config pointing at a
# directory we get to populate with any .pc files we want to add for Android
pkgconfig = ['env', 'PKG_CONFIG_LIBDIR=.', '/usr/bin/pkg-config']

# Also, include the plain DRM lib we found earlier. Panfrost relies on it rather heavily, especially when
# interacting with the panfrost DRM module and not kbase

pkgconfig = ['env', 'PKG_CONFIG_LIBDIR=.:/tmp/drm-static/lib/pkgconfig', '/usr/bin/pkg-config']

[host_machine]
system = 'linux'
Expand Down
Loading