linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: linux-ext4@vger.kernel.org
Subject: [PATCH 3/3] ci.yml: test cross-compiling for Android
Date: Tue, 21 Mar 2023 20:29:45 -0700	[thread overview]
Message-ID: <20230322032945.31779-4-ebiggers@kernel.org> (raw)
In-Reply-To: <20230322032945.31779-1-ebiggers@kernel.org>

From: Eric Biggers <ebiggers@google.com>

Add jobs that cross-compile e2fsprogs for Android using the Android NDK.
These use the autotools-based build system, so they're a bit different
from the actual Android builds, but they should still be useful.

Signed-off-by: Eric Biggers <ebiggers@google.com>
---
 .github/workflows/ci.yml | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 6b0f91506..0c14250a4 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -126,3 +126,36 @@ jobs:
       with:
         name: windows-${{matrix.env}}-config.h
         path: lib/config.h
+
+  # Jobs that cross-compile e2fsprogs for Android using the Android NDK.  Note
+  # that these use the autotools-based build system, which makes them a bit
+  # different from the actual Android builds from the Android source tree.
+  cross-compile-for-android:
+    name: Cross-compile for Android (${{matrix.arch}})
+    strategy:
+      matrix:
+        include:
+        - { arch: aarch64, target: aarch64-linux-android }
+        - { arch: armv7a, target: armv7a-linux-androideabi }
+        - { arch: i686, target: i686-linux-android }
+        - { arch: x86_64, target: x86_64-linux-android }
+    runs-on: ubuntu-latest
+    steps:
+    - uses: actions/checkout@v3
+    # See https://developer.android.com/ndk/guides/other_build_systems#autoconf
+    - name: configure
+      run: |
+        TOOLCHAIN=$ANDROID_NDK_LATEST_HOME/toolchains/llvm/prebuilt/linux-x86_64
+        API_LEVEL=29 # Android 10
+        export AR=$TOOLCHAIN/bin/llvm-ar
+        export CC=$TOOLCHAIN/bin/${{matrix.target}}${API_LEVEL}-clang
+        export AS=$CC
+        export LD=$TOOLCHAIN/bin/ld
+        export RANLIB=$TOOLCHAIN/bin/llvm-ranlib
+        export STRIP=$TOOLCHAIN/bin/llvm-strip
+        ./configure --host=${{matrix.target}} CFLAGS="$DEF_CFLAGS"
+    - run: make -j8 V=1 CFLAGS_WARN="-Werror"
+    - uses: actions/upload-artifact@v3
+      with:
+        name: android-${{matrix.arch}}-config.h
+        path: lib/config.h
-- 
2.40.0


      parent reply	other threads:[~2023-03-22  3:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-22  3:29 [PATCH 0/3] e2fsprogs: test cross-compiling for Android Eric Biggers
2023-03-22  3:29 ` [PATCH 1/3] e2fsck: avoid -Wtautological-constant-out-of-range-compare warnings Eric Biggers
2023-03-22  3:29 ` [PATCH 2/3] e2freefrag: don't use linux/fsmap.h when fsmap_sizeof() is missing Eric Biggers
2023-03-22  3:29 ` Eric Biggers [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230322032945.31779-4-ebiggers@kernel.org \
    --to=ebiggers@kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).