Skip to content

Commit

Permalink
[native_toolchain_c] Setup Android RISCV64 toolchain.
Browse files Browse the repository at this point in the history
  • Loading branch information
rmacnak-google committed Oct 27, 2023
1 parent 762b4da commit 272b9c5
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions .github/workflows/cipd_packages
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
flutter/android/ndk/${platform} version:r27.0.10869015
6 changes: 2 additions & 4 deletions .github/workflows/dart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,8 @@ jobs:
with:
sdk: ${{ matrix.sdk }}

- uses: nttld/setup-ndk@dbacc5871a0fac6eef9a09d2ca86bc8bf79432c3
with:
ndk-version: r25b
if: ${{ matrix.sdk == 'stable' }}
- run: git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
- run: depot_tools/cipd ensure -root $HOME/Android/sdk/ -ensure-file $GITHUB_WORKSPACE/.github/workflows/cipd_packages

- run: dart pub get

Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/native_toolchain_c.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,8 @@ jobs:
with:
sdk: ${{ matrix.sdk }}

- uses: nttld/setup-ndk@dbacc5871a0fac6eef9a09d2ca86bc8bf79432c3
with:
ndk-version: r25b
if: ${{ matrix.sdk == 'stable' }}
- run: git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
- run: depot_tools/cipd ensure -root $HOME/Android/sdk/ -ensure-file $GITHUB_WORKSPACE/.github/workflows/cipd_packages

- run: dart pub get

Expand Down
1 change: 1 addition & 0 deletions pkgs/native_toolchain_c/lib/src/cbuilder/run_cbuilder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ class RunCBuilder {
Target.androidArm64: 'aarch64-linux-android',
Target.androidIA32: 'i686-linux-android',
Target.androidX64: 'x86_64-linux-android',
Target.androidRiscv64: 'riscv64-linux-android',
};

static const appleClangMacosTargetFlags = {
Expand Down
2 changes: 1 addition & 1 deletion pkgs/native_toolchain_c/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies:
glob: ^2.1.1
logging: ^1.1.1
meta: ^1.9.1
native_assets_cli: ^0.3.0
native_assets_cli: ^0.3.1
pub_semver: ^2.1.3

dev_dependencies:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,23 @@ void main() {
Target.androidArm64,
Target.androidIA32,
Target.androidX64,
Target.androidRiscv64,
];

const readElfMachine = {
Target.androidArm: 'ARM',
Target.androidArm64: 'AArch64',
Target.androidIA32: 'Intel 80386',
Target.androidX64: 'Advanced Micro Devices X86-64',
Target.androidRiscv64: 'RISC-V',
};

const objdumpFileFormat = {
Target.androidArm: 'elf32-littlearm',
Target.androidArm64: 'elf64-littleaarch64',
Target.androidIA32: 'elf32-i386',
Target.androidX64: 'elf64-x86-64',
Target.androidRiscv64: 'elf64-littleriscv',
};

/// From https://docs.flutter.dev/reference/supported-platforms.
Expand Down

0 comments on commit 272b9c5

Please sign in to comment.