From 2e80966757d4aa001104a3c4443ebe3b2ce18530 Mon Sep 17 00:00:00 2001 From: SolDev69 <40839581+SolDev69@users.noreply.github.com> Date: Wed, 20 Dec 2023 18:49:44 +0000 Subject: [PATCH] update ci, fix os_misc.c --- .github/workflows/android.yml | 22 ++++++++++++++++------ android-drm-x86_64 | 22 ++++++++++++++++++++++ android-x86_64 | 26 ++++++++++++++++++++++++++ src/util/os_misc.c | 2 -- 4 files changed, 64 insertions(+), 8 deletions(-) create mode 100644 android-drm-x86_64 create mode 100644 android-x86_64 diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 485892319f5..5d597f04e6d 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -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 @@ -44,11 +43,16 @@ jobs: ninja -C "build-android" install cd .. envsubst 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 \ @@ -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: diff --git a/android-drm-x86_64 b/android-drm-x86_64 new file mode 100644 index 00000000000..45198a5636c --- /dev/null +++ b/android-drm-x86_64 @@ -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' diff --git a/android-x86_64 b/android-x86_64 new file mode 100644 index 00000000000..a63b6b570d0 --- /dev/null +++ b/android-x86_64 @@ -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' diff --git a/src/util/os_misc.c b/src/util/os_misc.c index 0445e8ee0c6..4374866981a 100644 --- a/src/util/os_misc.c +++ b/src/util/os_misc.c @@ -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;