Add loongarch64-unknown-linux-gnu-gcc build target (#13895)

# Description

Add `loongarch64-unknown-linux-gnu-gcc` build target
A test release could be found here:
https://github.com/nushell/nightly/releases/tag/v0.98.1
Loongarch64 workflow build result:
https://github.com/nushell/nightly/actions/runs/10973523602/job/30471006104
This commit is contained in:
Justin Ma 2024-09-22 17:20:15 +08:00 committed by GitHub
parent 5c5cf418fb
commit cf5fec63c0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 0 deletions

View File

@ -82,6 +82,7 @@ jobs:
- armv7-unknown-linux-gnueabihf - armv7-unknown-linux-gnueabihf
- armv7-unknown-linux-musleabihf - armv7-unknown-linux-musleabihf
- riscv64gc-unknown-linux-gnu - riscv64gc-unknown-linux-gnu
- loongarch64-unknown-linux-gnu
extra: ['bin'] extra: ['bin']
include: include:
- target: aarch64-apple-darwin - target: aarch64-apple-darwin
@ -114,6 +115,8 @@ jobs:
os: ubuntu-22.04 os: ubuntu-22.04
- target: riscv64gc-unknown-linux-gnu - target: riscv64gc-unknown-linux-gnu
os: ubuntu-latest os: ubuntu-latest
- target: loongarch64-unknown-linux-gnu
os: ubuntu-22.04
runs-on: ${{matrix.os}} runs-on: ${{matrix.os}}

View File

@ -98,6 +98,13 @@ if $os in ['macos-latest'] or $USE_UBUNTU {
$env.CARGO_TARGET_ARMV7_UNKNOWN_LINUX_MUSLEABIHF_LINKER = 'armv7r-linux-musleabihf-gcc' $env.CARGO_TARGET_ARMV7_UNKNOWN_LINUX_MUSLEABIHF_LINKER = 'armv7r-linux-musleabihf-gcc'
cargo-build-nu cargo-build-nu
} }
'loongarch64-unknown-linux-gnu' => {
aria2c https://github.com/loongson/build-tools/releases/download/2024.08.08/x86_64-cross-tools-loongarch64-binutils_2.43-gcc_14.2.0-glibc_2.40.tar.xz
tar xf x86_64-cross-tools-loongarch64-*.tar.xz
$env.PATH = ($env.PATH | split row (char esep) | prepend $'($env.PWD)/cross-tools/bin')
$env.CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_GNU_LINKER = 'loongarch64-unknown-linux-gnu-gcc'
cargo-build-nu
}
_ => { _ => {
# musl-tools to fix 'Failed to find tool. Is `musl-gcc` installed?' # musl-tools to fix 'Failed to find tool. Is `musl-gcc` installed?'
# Actually just for x86_64-unknown-linux-musl target # Actually just for x86_64-unknown-linux-musl target

View File

@ -32,6 +32,7 @@ jobs:
- armv7-unknown-linux-gnueabihf - armv7-unknown-linux-gnueabihf
- armv7-unknown-linux-musleabihf - armv7-unknown-linux-musleabihf
- riscv64gc-unknown-linux-gnu - riscv64gc-unknown-linux-gnu
- loongarch64-unknown-linux-gnu
extra: ['bin'] extra: ['bin']
include: include:
- target: aarch64-apple-darwin - target: aarch64-apple-darwin
@ -64,6 +65,8 @@ jobs:
os: ubuntu-22.04 os: ubuntu-22.04
- target: riscv64gc-unknown-linux-gnu - target: riscv64gc-unknown-linux-gnu
os: ubuntu-latest os: ubuntu-latest
- target: loongarch64-unknown-linux-gnu
os: ubuntu-22.04
runs-on: ${{matrix.os}} runs-on: ${{matrix.os}}