From fa07089ff86b6bf0b5f4ab7e264c1afcfec66e18 Mon Sep 17 00:00:00 2001 From: Cong Zhang <13283869+congzhangzh@users.noreply.github.com> Date: Sun, 17 Mar 2024 00:58:22 +0800 Subject: [PATCH 1/2] [BUILDING.md] Update GNU/Linux Speeding up section 1. C/C++ link is slow, especially for node like project, which will link GBs data to 100MB like size 2. C/C++ link process can not be cached 3. mold is really really fast --- BUILDING.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/BUILDING.md b/BUILDING.md index 53f636a4cf641e..55aec682caaf38 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -532,16 +532,21 @@ make test-only #### Speeding up frequent rebuilds when developing If you plan to frequently rebuild Node.js, especially if using several branches, -installing `ccache` can help to greatly reduce build times. Set up with: +installing `ccache` and `mold` can help to greatly reduce build times. Set up with: On GNU/Linux: ```bash -sudo apt install ccache # for Debian/Ubuntu, included in most Linux distros -export CC="ccache gcc" # add to your .profile -export CXX="ccache g++" # add to your .profile +sudo apt install ccache mold # for Debian/Ubuntu, included in most Linux distros +export CC="ccache gcc" # add to your .profile +export CXX="ccache g++" # add to your .profile +export LDFLAGS="-fuse-ld=mold" # add to your .profile ``` +Refs: +1. https://ccache.dev/performance.html +2. https://github.com/rui314/mold + On macOS: ```bash From 0c8ed36c4622cf41e5a28937e365c53e0eafefca Mon Sep 17 00:00:00 2001 From: Cong Zhang <13283869+congzhangzh@users.noreply.github.com> Date: Sun, 17 Mar 2024 17:25:11 +0800 Subject: [PATCH 2/2] [Windows Build] add tips about build failed cause by vcpkg --- BUILDING.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/BUILDING.md b/BUILDING.md index 55aec682caaf38..15f8f81d3a1b71 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -583,6 +583,15 @@ to run it again before invoking `make -j4`. ### Windows +#### Tips +You may need disable vcpkg integration if you got link error about symbol redefine related to zlib.lib(zlib1.dll), even you do not install it by hand, as vcpkg is part of [CLion](https://www.jetbrains.com/clion) and Visual Studio + +```bat +vcpkg integration remove +``` + +Refs: [vcpkg](https://github.com/microsoft/vcpkg/), #24448, https://github.com/microsoft/vcpkg/issues/#37518 + #### Prerequisites ##### Option 1: Manual install