Browse Source

Add Node.js v18.0.0 submodule and cross-compile instructions

Jun Yuan Tan 1 year ago
parent
commit
da0fdc9b56
3 changed files with 30 additions and 0 deletions
  1. 3 0
      .gitmodules
  2. 26 0
      node/README.md
  3. 1 0
      node/node

+ 3 - 0
.gitmodules

@@ -1,3 +1,6 @@
 [submodule "libreoffice/libreoffice-7.5"]
 	path = libreoffice/libreoffice-7.5
 	url = https://github.com/LibreOffice/core.git
+[submodule "node/node"]
+	path = node/node
+	url = https://github.com/nodejs/node.git

+ 26 - 0
node/README.md

@@ -0,0 +1,26 @@
+===How to Cross-compile Node.js v18.0.0===
+
+
+1. Prepare a RISC-V Toolchain and add the toolchain path into PATH:
+
+    $ export PATH="<toolchain_path>:$PATH"
+
+
+
+2. Then clone the node.js repo:
+
+    $ git clone https://github.com/nodejs/node.git -b v18.0.0
+
+
+3. cd into the directory and run the following to set build arguments:
+
+    $ CC=riscv64-unknown-linux-gnu-gcc CXX=riscv64-unknown-linux-gnu-g++ CC_host=gcc CXX_host=g++ ./configure --dest-cpu=riscv64 --cross-compiling --dest-os=linux --openssl-no-asm
+
+
+4. Execute the following to compile:
+
+    $ make -j32 && make install PREFIX=./install
+
+
+5. The output files will be located in the 'node/install' directory. There are 4 directories: bin, include, lib and share
+   To enable it in Debian, you will need to copy the directories to their respective /usr/local/ location.

+ 1 - 0
node/node

@@ -0,0 +1 @@
+Subproject commit 49a77a5a996a49e8cb728eed42e55a7c1a9eef6e