Skip to content
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

feat(target): add riscv64 support #651

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
3 changes: 3 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@ linker = "arm-linux-gnueabihf-gcc"
linker = "aarch64-linux-musl-gcc"
rustflags = ["-C", "target-feature=-crt-static"]

[target.riscv64gc-unknown-linux-gnu]
linker = "riscv64-linux-gnu-gcc"

[target.wasm32-unknown-unknown]
rustflags = ["-C", "link-arg=--export-table"]
6 changes: 6 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ jobs:
- target: x86_64-unknown-linux-musl
image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
strip: strip
- target: riscv64gc-unknown-linux-gnu
image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian
strip: riscv64-linux-gnu-strip
setup: |
sudo apt-get update
sudo apt-get install gcc-riscv64-linux-gnu binutils-riscv64-linux-gnu -y

name: build-${{ matrix.target }}
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"@codemirror/lint": "^6.1.0",
"@codemirror/theme-one-dark": "^6.1.0",
"@mdn/browser-compat-data": "^5.3.29",
"@napi-rs/cli": "^2.14.0",
"@napi-rs/cli": "^2.17.0",
"autoprefixer": "^10.4.16",
"codemirror": "^6.0.1",
"cssnano": "^5.0.8",
Expand Down
7 changes: 6 additions & 1 deletion scripts/build-npm.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,18 @@ const triples = [
},
{
name: 'x86_64-unknown-freebsd'
}
},
{
name: 'riscv64gc-unknown-linux-gnu',
libc: 'glibc',
},
];
const cpuToNodeArch = {
x86_64: 'x64',
aarch64: 'arm64',
i686: 'ia32',
armv7: 'arm',
riscv64gc: 'riscv64',
};
const sysToNodePlatform = {
linux: 'linux',
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -412,10 +412,10 @@
resolved "https://registry.yarnpkg.com/@msgpackr-extract/msgpackr-extract-win32-x64/-/msgpackr-extract-win32-x64-2.1.2.tgz#f2d8b9ddd8d191205ed26ce54aba3dfc5ae3e7c9"
integrity sha512-rIZVR48zA8hGkHIK7ED6+ZiXsjRCcAVBJbm8o89OKAMTmEAQ2QvoOxoiu3w2isAaWwzgtQIOFIqHwvZDyLKCvw==

"@napi-rs/cli@^2.14.0":
version "2.14.0"
resolved "https://registry.yarnpkg.com/@napi-rs/cli/-/cli-2.14.0.tgz#ca1c1a75d6922f8af098d8d56f4914e0889963c8"
integrity sha512-hQW+gOTQ80nCoBAWA0hq49HM3QqyC7x879CdF/CEEFHeJNlHT8tgru8nbMQa6YqMP1XADfiudsYzy5V7TxBxCw==
"@napi-rs/cli@^2.17.0":
version "2.17.0"
resolved "https://registry.yarnpkg.com/@napi-rs/cli/-/cli-2.17.0.tgz#05566f0550333789824325e4d817e613cc91181c"
integrity sha512-/M7MZ3dIqyFs6c0Bxtk+SOobPq6vYWYqBLYCOKx3dYWqoyJNBEgmDKUTrxIZu9eHw9Ill3WyEoHPqS9P99cd8A==

"@parcel/[email protected]":
version "2.8.2"
Expand Down