nodejs / node

Node.js JavaScript runtime ✨🐢🚀✨
https://nodejs.org
Other
106.79k stars 29.15k forks source link

Add riscv64 backend for node.js #37856

Closed luyahan closed 3 years ago

luyahan commented 3 years ago

Hi all, I am a developer about v8 for riscv64 and v8 for riscv64 patch had been upstreamed into google repo. I want to add support for node.js. I have build success locally.
And what should i do before opening a pr to submit it ?

Ayase-252 commented 3 years ago

Hello, I'd suggest to read Pull Requests guide to get yourself familiar with commit message guidelines.

Then you are good to go.

luyahan commented 3 years ago

Hello, I'd suggest to read Pull Requests guide to get yourself familiar with commit message guidelines.

Then you are good to go.

Thanks

luyahan commented 3 years ago

And i have another question About https://github.com/nodejs/node/tree/master/deps/openssl/config/archs Where do these openssl assembly codes come from? I don't find these in https://github.com/openssl/openssl @Ayase-252

luyahan commented 3 years ago

And i have another question About https://github.com/nodejs/node/tree/master/deps/openssl/config/archs Where do these openssl assembly codes come from? I don't find these in https://github.com/openssl/openssl @Ayase-252

O, i may be find in https://github.com/openssl/openssl/blob/13a574d8bb2523181f8150de49bc041c9841f59d/crypto/sha/asm/keccak1600-s390x.pl.

Ayase-252 commented 3 years ago

@luyahan

It seems that those files are pre-generated during building. Please refer to README in openssl dep and official maintainence guide.

FYI, Node.js has switched openssl to quictls/openssl in order to support QUIC in #37601

sxa commented 3 years ago

@luyahan I've only just noticed this issue - great timing as I was about to start taking a look at the port that you've done and give it a try. I'm interested in helping out with getting this in the main codebase if possible. I've sent a request to join your slack :-)

luyahan commented 3 years ago

@luyahan I've only just noticed this issue - great timing as I was about to start taking a look at the port that you've done and give it a try. I'm interested in helping out with getting this in the main codebase if possible. I've sent a request to join your slack :-)

@sxa Thanks. I am encountering a problem about openssl. About generate openssl noasm code for riscv64. What i need do to fix this error? Details:

yahan@f06755d88c20:~/source/node/deps/openssl/config $ make
cd ../openssl; CONFIGURE_CHECKER_WARN=1 perl ./Configure no-comp no-shared no-afalgeng enable-ssl-trace \
no-asm linux64-riscv64;
Configuring OpenSSL version 1.1.1j+quic (0x101010afL) for linux64-riscv64
Using os-specific seed configuration
Usage: Configure [no-<cipher> ...] [enable-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-egd] [sctp] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--config=FILE] os/compiler[:flags]

pick os/compiler from:
BS2000-OSD BSD-generic32 BSD-generic64 BSD-ia64 BSD-sparc64 BSD-sparcv8
BSD-x86 BSD-x86-elf BSD-x86_64 Cygwin Cygwin-i386 Cygwin-i486 Cygwin-i586
Cygwin-i686 Cygwin-x86 Cygwin-x86_64 DJGPP MPE/iX-gcc UEFI UWIN VC-CE VC-WIN32
VC-WIN32-ARM VC-WIN32-ONECORE VC-WIN64-ARM VC-WIN64A VC-WIN64A-ONECORE
VC-WIN64A-masm VC-WIN64I aix-cc aix-gcc aix64-cc aix64-gcc android-arm
android-arm64 android-armeabi android-mips android-mips64 android-x86
android-x86_64 android64 android64-aarch64 android64-mips64 android64-x86_64
bsdi-elf-gcc cc darwin-i386-cc darwin-ppc-cc darwin64-arm64-cc
darwin64-debug-test-64-clang darwin64-ppc-cc darwin64-x86_64-cc gcc haiku-x86
haiku-x86_64 hpux-ia64-cc hpux-ia64-gcc hpux-parisc-cc hpux-parisc-gcc
hpux-parisc1_1-cc hpux-parisc1_1-gcc hpux64-ia64-cc hpux64-ia64-gcc
hpux64-parisc2-cc hpux64-parisc2-gcc hurd-x86 ios-cross ios-xcrun ios64-cross
ios64-xcrun iossimulator-xcrun iphoneos-cross irix-mips3-cc irix-mips3-gcc
irix64-mips4-cc irix64-mips4-gcc linux-aarch64 linux-alpha-gcc linux-aout
linux-arm64ilp32 linux-armv4 linux-c64xplus linux-elf linux-generic32
linux-generic64 linux-ia64 linux-mips32 linux-mips64 linux-ppc linux-ppc64
linux-ppc64le linux-sparcv8 linux-sparcv9 linux-x32 linux-x86 linux-x86-clang
linux-x86_64 linux-x86_64-clang linux32-s390x linux64-mips64 linux64-s390x
linux64-sparcv9 mingw mingw64 nextstep nextstep3.3 purify sco5-cc sco5-gcc
solaris-sparcv7-cc solaris-sparcv7-gcc solaris-sparcv8-cc solaris-sparcv8-gcc
solaris-sparcv9-cc solaris-sparcv9-gcc solaris-x86-gcc solaris64-sparcv9-cc
solaris64-sparcv9-gcc solaris64-x86_64-cc solaris64-x86_64-gcc tru64-alpha-cc
tru64-alpha-gcc uClinux-dist uClinux-dist64 unixware-2.0 unixware-2.1
unixware-7 unixware-7-gcc vms-alpha vms-alpha-p32 vms-alpha-p64 vms-ia64
vms-ia64-p32 vms-ia64-p64 vos-gcc vxworks-mips vxworks-ppc405 vxworks-ppc60x
vxworks-ppc750 vxworks-ppc750-debug vxworks-ppc860 vxworks-ppcgen
vxworks-simlinux debug debug-erbridge debug-linux-ia32-aes debug-linux-pentium
debug-linux-ppro debug-test-64-clang

NOTE: If in doubt, on Unix-ish systems use './config'.
make: *** [Makefile:63: linux64-riscv64] Error 1
mhdawson commented 3 years ago

@luyahan not related to your issues and probably too early, but what OS is your riskv64 implementation running on, and do you work for/know of any company that might donate virtual instances to the Node.js CI?

luyahan commented 3 years ago

@luyahan not related to your issues and probably too early, but what OS is your riskv64 implementation running on

I am running Fedroa for riscv64.

, and do you work for/know of any company that might donate virtual instances to the Node.js CI?

PLCT Lab may be can provide it. I need to ask my leader.

luyahan commented 3 years ago

@luyahan not related to your issues and probably too early, but what OS is your riskv64 implementation running on, and do you work for/know of any company that might donate virtual instances to the Node.js CI?

I know V8 can be built with simulator mode that can run other arch V8 on X64 machine. Can Node.js support it ?

luyahan commented 3 years ago

@luyahan not related to your issues and probably too early, but what OS is your riskv64 implementation running on, and do you work for/know of any company that might donate virtual instances to the Node.js CI?

About May, PLCT Lab can get some riscv64 .borads and can donate it to Node.js ci

lazyparser commented 3 years ago

@luyahan not related to your issues and probably too early, but what OS is your riskv64 implementation running on, and do you work for/know of any company that might donate virtual instances to the Node.js CI?

PLCT Lab is happy to donate RISC-V dev boards. We had ordered dozens of RISC-V boards last year and still waiting to receive them :( Hopefully we will get more boards in May.

mhdawson commented 3 years ago

@lazyparser can the PLCT Lab host the donated boards ? The project typically has vm's donated versus hardware as we don't have an easy place to host physical hardware.

lazyparser commented 3 years ago

@lazyparser can the PLCT Lab host the donated boards ? The project typically has vm's donated versus hardware as we don't have an easy place to host physical hardware.

Sure. We are building an open CI infrastructure for RISC-V porting ( https://ci.rvperf.org ) and will provide a board farm to nodejs and v8, etc.

playground commented 2 years ago

How can I install nodejs on risc-v Fedora?



## Installing the NodeSource Node.js 16.x repo...

## Inspecting system...

+ rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release || rpm -q --whatprovides cloudlinux-release || rpm -q --whatprovides sl-release || rpm -q --whatprovides fedora-release
+ uname -m

## You don't appear to be running a supported machine architecture: riscv64. Please contact NodeSource at https://github.com/nodesource/distributions/issues if you think this is incorrect or would like your architecture to be considered for support. ```