Skip to content

Commit

Permalink
docs: new amd64 compilation instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Sep 26, 2023
1 parent ce1f8f0 commit c15125a
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[target.aarch64-unknown-linux-gnu]
ar = "./aarch64-linux-gnu/bin/aarch64-none-linux-gnu-ar"
linker = "./aarch64-linux-gnu/bin/aarch64-none-linux-gnu-gcc"

[target.aarch64-linux-android]
ar = "./ndk/arm64/bin/aarch64-linux-android-ar"
linker = "./ndk/arm64/bin/aarch64-linux-android-clang"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Cargo.lock

/ndk
/target
/aarch64-linux-gnu
/res/roms.prop
/frontends/*/target
/frontends/*/ndk
Expand Down
31 changes: 30 additions & 1 deletion frontends/libretro/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,36 @@
cargo build
```

### Android
### Cross-compiling

#### Arm64

Download the linux toolchain from [https://developer.arm.com/downloads/-/gnu-a](https://developer.arm.com/downloads/-/gnu-a).

Set the env variable `ARM64_TOOLCHAIN` to the path of the toolchain directory.

Create a toolchain synbolic link using the following command in Unix:

```bash
ln -s $ARM64_TOOLCHAIN aarch64-linux-gnu
```

... and the following command in Windows (cmd vs powershell):

```bash
mklink /D aarch64-linux-gnu %ARM64_TOOLCHAIN%
New-Item -ItemType SymbolicLink -Path aarch64-linux-gnu -Target $env:ARM64_TOOLCHAIN
```

```bash
rustup target add aarch64-unknown-linux-gnu
```

```bash
cargo build --target=aarch64-unknown-linux-gnu --release
```

#### Android

Configure `NDK_HOME` environment variable to point to your Android NDK directory and then create local toolchain replicas in the root project directory using:

Expand Down

0 comments on commit c15125a

Please sign in to comment.