Repository navigation
Fail to cross build for RISC-V #66803
Copy link
Copy link
Open
Labels
buildIssues and PRs related to Node.js builds or CI infrastructure.Issues and PRs related to Node.js builds or CI infrastructure.riscv64Issues and PRs related to the 64-bit RISC-V architecture.Issues and PRs related to the 64-bit RISC-V architecture.
Description
Platform
- Nodejs version: current main branch (
f59539b514344ed0a0945f8790d61121df88a5d4) - Host: Linux x86_64
- Target: RISC-V 64 bit Linux with rv64gc instruction set.
- Host compiler: clang 22
- Cross compiler: GCC 15
$ clang --version
clang version 22.1.8
Target: x86_64-aosc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm-22/bin
$ riscv64-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=riscv64-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/opt/abcross/riscv64/libexec/gcc/riscv64-aosc-linux-gnu/15.3.0/lto-wrapper
Target: riscv64-aosc-linux-gnu
Configured with: /var/cache/acbs/build/acbs.r7e6hypg/gcc-15.3.0/configure --prefix=/opt/abcross/riscv64 --target=riscv64-aosc-linux-gnu --with-sysroot=/var/ab/cross-root/riscv64 --enable-shared --disable-multilib --enable-c99 --enable-long-long --enable-threads=posix --enable-languages=c,c++,fortran,lto,go,objc,obj-c++,m2,d,ada --enable-__cxa_atexit --disable-altivec --disable-fixed-point --enable-lto --enable-gnu-unique-object --enable-linker-build-id --enable-libstdcxx-dual-abi --with-default-libstdcxx-abi=new --with-arch=rv64gc --with-abi=lp64d --with-isa-spec=2.2
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.3.0 (GCC)
Error
There will be many errors related with failed static assertions and no matching templates, see the attached log for details.
Detailed steps of reproduction
# first configure for cross building
./configure --dest-cpu=riscv64 --dest-os=linux --prefix=/usr --cross-compiling
# then attempt to build
make CC="ccache riscv64-linux-gnu-gcc" CXX="ccache riscv64-linux-gnu-g++" CC_host="ccache clang" CXX_host="ccache clang++" DESTDIR=$PWD/target install -j20
# the above command will fail, and log was collected with the following command
make CC="ccache riscv64-linux-gnu-gcc" CXX="ccache riscv64-linux-gnu-g++" CC_host="ccache clang" CXX_host="ccache clang++" DESTDIR=$PWD/target install -j20 -k 2>&1 | tee build.log
Log file
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
buildIssues and PRs related to Node.js builds or CI infrastructure.Issues and PRs related to Node.js builds or CI infrastructure.riscv64Issues and PRs related to the 64-bit RISC-V architecture.Issues and PRs related to the 64-bit RISC-V architecture.
Activity
scratch-er commentedon Oct 16, 2026
Also, I find that
--ninjain configure will not work with cross compiling to RISC-V, but works for native compiling for x86_64 and cross compiling to arm64.bindu-yogesh commentedon Oct 17, 2026
Hi @scratch-er, I'd like to work on this issue.
I'm interested in investigating the RISC-V cross-compilation failures and the Ninja build error. I'd like to look into the root cause, reproduce the issue, and work on a fix.
Could you please assign this issue to me? I'll share my findings and submit a PR once I have a solution. Thanks!
scratch-er commentedon Oct 17, 2026
Hi, @bindu-yogesh , neither you or me are member of this repo so I cannot assign you. Please just refer to https://github.com/nodejs/node/blob/main/CONTRIBUTING.md .
inoway46 commentedon Oct 18, 2026
The cross-build issues are being addressed separately:
MutablePageassertion: reported upstream as V8 issue #574828088.I plan to run a full cross-build with both PRs and the candidate V8
/64change applied.