Skip to content

Fail to cross build for RISC-V #66803

Open

Description

@scratch-er

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

build.log

Activity

  1. scratch-er commented on Oct 16, 2026

    @scratch-er
    Author

    Also, I find that --ninja in configure will not work with cross compiling to RISC-V, but works for native compiling for x86_64 and cross compiling to arm64.

    $ ./configure --dest-cpu=riscv64 --dest-os=linux --prefix=/usr --cross-compiling --ninja
    Node.js configure: Found Python 3.14.8...
    INFO: Using floating patch "tools/icu/patches/78/source/i18n/dtfmtsym.cpp" from "tools/icu"
    INFO: configure completed successfully
    $ 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
    ninja -C out/Release -j20
    ninja: Entering directory `out/Release'
    ninja: error: obj.host/tools/v8_gypfiles/v8_inspector_headers.ninja:14: multiple rules generate gen/inspector-generated-output-root/src/js_protocol.stamp
    
    make: *** [Makefile:161: node] Error 1
    make: Target 'install' not remade because of errors.
    
  2. bindu-yogesh commented on Oct 17, 2026

    @bindu-yogesh

    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!

  3. scratch-er commented on Oct 17, 2026

    @scratch-er
    Author

    3. 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!

    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 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions