Skip to content

Added support to build in Linux RISCV64. #2928

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
- { os: ubuntu-22.04, target: linux, platform: linux-x64, container: 'alpine:latest', libc: musl }
- { os: ubuntu-20.04, target: linux, platform: linux-x64 }
- { os: ubuntu-20.04, target: linux, platform: linux-arm64 }
- { os: ubuntu-20.04, target: linux, platform: linux-riscv64 }
- { os: macos-latest, target: darwin, platform: darwin-x64 }
- { os: macos-latest, target: darwin, platform: darwin-arm64 }
- { os: windows-latest, target: windows, platform: win32-ia32 }
Expand All @@ -41,6 +42,12 @@ jobs:
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu

- name: Install riscv64-linux-gnu
if: ${{ matrix.platform == 'linux-riscv64' && matrix.libc != 'musl' }}
run: |
sudo apt-get update
sudo apt-get install -y gcc-riscv64-linux-gnu g++-riscv64-linux-gnu

- name: Prepare container for musl
if: ${{ matrix.target == 'linux' && matrix.libc == 'musl' }}
run: |
Expand Down
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased
<!-- Add all new changes here. They will be moved under a version at release -->
* NEW Support for Linux RISCV64 builds.

## 3.12.0
`2024-10-30`
Expand Down
3 changes: 3 additions & 0 deletions make/detect_platform.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ elseif platform.os == 'linux' then
elseif lm.platform == "linux-x64" then
elseif lm.platform == "linux-arm64" then
lm.cc = 'aarch64-linux-gnu-gcc'
elseif lm.platform == "linux-riscv64" then
lm.cc = 'riscv64-linux-gnu-gcc'
else
error "unknown platform"
end
Expand All @@ -49,6 +51,7 @@ local ARCH <const> = {
x86_64 = 'x64',
i686 = 'ia32',
arm64 = 'arm64',
riscv64 = 'riscv64'
}

local function detectArch()
Expand Down
Loading