Skip to content

Commit

Permalink
update ci, fix os_misc.c
Browse files Browse the repository at this point in the history
  • Loading branch information
SolDev69 committed Dec 20, 2023
1 parent 14f9e7f commit 2e80966
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 8 deletions.
22 changes: 16 additions & 6 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ jobs:
build:
strategy:
matrix:
arch: [ "arm32", "aarch64" ]
arch: [ "arm32", "aarch64", "x86_64" ]
fail-fast: false

name: "Build for ${{matrix.arch}}"

runs-on: ubuntu-latest

steps:

steps:
- uses: actions/checkout@v2

- name: Build
Expand Down Expand Up @@ -44,11 +43,16 @@ jobs:
ninja -C "build-android" install
cd ..
envsubst <android-${{matrix.arch}} >build-crossfile
git clone --depth 1 https://gitlab.freedesktop.org/mesa/mesa.git
cd mesa
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/mesa \
--cross-file "build-crossfile" \
--cross-file "../build-crossfile" \
-Dplatforms=android \
-Dplatform-sdk-version=26 \
-Dplatform-sdk-version=25 \
-Dandroid-stub=true \
-Dllvm=disabled \
-Dxlib-lease=disabled \
Expand All @@ -61,8 +65,14 @@ jobs:
-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:
Expand Down
22 changes: 22 additions & 0 deletions android-drm-x86_64
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/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'
# 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'
26 changes: 26 additions & 0 deletions android-x86_64
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[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/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'
# 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

# 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'
# cpu_family = 'x86_64'
# cpu = 'amd64'

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

endian = 'little'
2 changes: 0 additions & 2 deletions src/util/os_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,6 @@ os_get_option(const char *name)
return opt;
}

#endif

static struct hash_table *options_tbl;
static bool options_tbl_exited = false;
static simple_mtx_t options_tbl_mtx = SIMPLE_MTX_INITIALIZER;
Expand Down

0 comments on commit 2e80966

Please sign in to comment.