Skip to content

Commit

Permalink
根据版本修改
Browse files Browse the repository at this point in the history
  • Loading branch information
chexiongsheng committed Aug 13, 2024
1 parent 5502117 commit 082810d
Show file tree
Hide file tree
Showing 15 changed files with 13 additions and 28 deletions.
2 changes: 0 additions & 2 deletions android_armv7.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ CXX_SETTING="use_custom_libcxx=false"

if [ "$NEW_WRAP" == "with_new_wrap" ]; then
echo "=====[ wrap new delete ]====="
cp -f $GITHUB_WORKSPACE/node-script/wrap_symbols.cc "third_party/libc++/src/src"
node -e "const fs = require('fs'); fs.writeFileSync('buildtools/third_party/libc++/BUILD.gn', fs.readFileSync('buildtools/third_party/libc++/BUILD.gn', 'utf-8').replace('\"//third_party/libc++/src/src/verbose_abort.cpp\",', '\"//third_party/libc++/src/src/verbose_abort.cpp\",\n \"//third_party/libc++/src/src/wrap_symbols.cc\",'));"
CXX_SETTING="use_custom_libcxx=true"
fi

Expand Down
2 changes: 0 additions & 2 deletions android_armv8.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ CXX_SETTING="use_custom_libcxx=false"

if [ "$NEW_WRAP" == "with_new_wrap" ]; then
echo "=====[ wrap new delete ]====="
cp -f $GITHUB_WORKSPACE/node-script/wrap_symbols.cc "third_party/libc++/src/src"
node -e "const fs = require('fs'); fs.writeFileSync('buildtools/third_party/libc++/BUILD.gn', fs.readFileSync('buildtools/third_party/libc++/BUILD.gn', 'utf-8').replace('\"//third_party/libc++/src/src/verbose_abort.cpp\",', '\"//third_party/libc++/src/src/verbose_abort.cpp\",\n \"//third_party/libc++/src/src/wrap_symbols.cc\",'));"
CXX_SETTING="use_custom_libcxx=true"
fi

Expand Down
2 changes: 0 additions & 2 deletions android_x64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ CXX_SETTING="use_custom_libcxx=false"

if [ "$NEW_WRAP" == "with_new_wrap" ]; then
echo "=====[ wrap new delete ]====="
cp -f $GITHUB_WORKSPACE/node-script/wrap_symbols.cc "third_party/libc++/src/src"
node -e "const fs = require('fs'); fs.writeFileSync('buildtools/third_party/libc++/BUILD.gn', fs.readFileSync('buildtools/third_party/libc++/BUILD.gn', 'utf-8').replace('\"//third_party/libc++/src/src/verbose_abort.cpp\",', '\"//third_party/libc++/src/src/verbose_abort.cpp\",\n \"//third_party/libc++/src/src/wrap_symbols.cc\",'));"
CXX_SETTING="use_custom_libcxx=true"
fi

Expand Down
2 changes: 0 additions & 2 deletions ios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ CXX_SETTING="use_custom_libcxx=false"

if [ "$NEW_WRAP" == "with_new_wrap" ]; then
echo "=====[ wrap new delete ]====="
cp -f $GITHUB_WORKSPACE/node-script/wrap_symbols.cc "third_party/libc++/src/src"
node -e "const fs = require('fs'); fs.writeFileSync('buildtools/third_party/libc++/BUILD.gn', fs.readFileSync('buildtools/third_party/libc++/BUILD.gn', 'utf-8').replace('\"//third_party/libc++/src/src/verbose_abort.cpp\",', '\"//third_party/libc++/src/src/verbose_abort.cpp\",\n \"//third_party/libc++/src/src/wrap_symbols.cc\",'));"
brew install llvm
export PATH="/usr/local/opt/llvm/bin:$PATH"
CXX_SETTING="use_custom_libcxx=true"
Expand Down
2 changes: 0 additions & 2 deletions linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ CXX_SETTING="use_custom_libcxx=false"

if [ "$NEW_WRAP" == "with_new_wrap" ]; then
echo "=====[ wrap new delete ]====="
cp -f $GITHUB_WORKSPACE/node-script/wrap_symbols.cc "third_party/libc++/src/src"
node -e "const fs = require('fs'); fs.writeFileSync('buildtools/third_party/libc++/BUILD.gn', fs.readFileSync('buildtools/third_party/libc++/BUILD.gn', 'utf-8').replace('\"//third_party/libc++/src/src/verbose_abort.cpp\",', '\"//third_party/libc++/src/src/verbose_abort.cpp\",\n \"//third_party/libc++/src/src/wrap_symbols.cc\",'));"
sudo apt-get install -y llvm
CXX_SETTING="use_custom_libcxx=true"
fi
Expand Down
2 changes: 0 additions & 2 deletions linux_arm64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ CXX_SETTING="use_custom_libcxx=false"

if [ "$NEW_WRAP" == "with_new_wrap" ]; then
echo "=====[ wrap new delete ]====="
cp -f $GITHUB_WORKSPACE/node-script/wrap_symbols.cc "third_party/libc++/src/src"
node -e "const fs = require('fs'); fs.writeFileSync('buildtools/third_party/libc++/BUILD.gn', fs.readFileSync('buildtools/third_party/libc++/BUILD.gn', 'utf-8').replace('\"//third_party/libc++/src/src/verbose_abort.cpp\",', '\"//third_party/libc++/src/src/verbose_abort.cpp\",\n \"//third_party/libc++/src/src/wrap_symbols.cc\",'));"
sudo apt-get install -y llvm
CXX_SETTING="use_custom_libcxx=true"
fi
Expand Down
2 changes: 0 additions & 2 deletions macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ CXX_SETTING="use_custom_libcxx=false"

if [ "$NEW_WRAP" == "with_new_wrap" ]; then
echo "=====[ wrap new delete ]====="
cp -f $GITHUB_WORKSPACE/node-script/wrap_symbols.cc "third_party/libc++/src/src"
node -e "const fs = require('fs'); fs.writeFileSync('buildtools/third_party/libc++/BUILD.gn', fs.readFileSync('buildtools/third_party/libc++/BUILD.gn', 'utf-8').replace('\"//third_party/libc++/src/src/verbose_abort.cpp\",', '\"//third_party/libc++/src/src/verbose_abort.cpp\",\n \"//third_party/libc++/src/src/wrap_symbols.cc\",'));"
brew install llvm
export PATH="/usr/local/opt/llvm/bin:$PATH"
CXX_SETTING="use_custom_libcxx=true"
Expand Down
2 changes: 0 additions & 2 deletions macos_DLL.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ CXX_SETTING="use_custom_libcxx=false"

if [ "$NEW_WRAP" == "with_new_wrap" ]; then
echo "=====[ wrap new delete ]====="
cp -f $GITHUB_WORKSPACE/node-script/wrap_symbols.cc "third_party/libc++/src/src"
node -e "const fs = require('fs'); fs.writeFileSync('buildtools/third_party/libc++/BUILD.gn', fs.readFileSync('buildtools/third_party/libc++/BUILD.gn', 'utf-8').replace('\"//third_party/libc++/src/src/verbose_abort.cpp\",', '\"//third_party/libc++/src/src/verbose_abort.cpp\",\n \"//third_party/libc++/src/src/wrap_symbols.cc\",'));"
brew install llvm
export PATH="/usr/local/opt/llvm/bin:$PATH"
CXX_SETTING="use_custom_libcxx=true libcxx_is_shared=false"
Expand Down
2 changes: 0 additions & 2 deletions macos_arm64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ CXX_SETTING="use_custom_libcxx=false"

if [ "$NEW_WRAP" == "with_new_wrap" ]; then
echo "=====[ wrap new delete ]====="
cp -f $GITHUB_WORKSPACE/node-script/wrap_symbols.cc "third_party/libc++/src/src"
node -e "const fs = require('fs'); fs.writeFileSync('buildtools/third_party/libc++/BUILD.gn', fs.readFileSync('buildtools/third_party/libc++/BUILD.gn', 'utf-8').replace('\"//third_party/libc++/src/src/verbose_abort.cpp\",', '\"//third_party/libc++/src/src/verbose_abort.cpp\",\n \"//third_party/libc++/src/src/wrap_symbols.cc\",'));"
brew install llvm
export PATH="/usr/local/opt/llvm/bin:$PATH"
CXX_SETTING="use_custom_libcxx=true"
Expand Down
2 changes: 0 additions & 2 deletions macos_arm64_DLL.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ CXX_SETTING="use_custom_libcxx=false"

if [ "$NEW_WRAP" == "with_new_wrap" ]; then
echo "=====[ wrap new delete ]====="
cp -f $GITHUB_WORKSPACE/node-script/wrap_symbols.cc "third_party/libc++/src/src"
node -e "const fs = require('fs'); fs.writeFileSync('buildtools/third_party/libc++/BUILD.gn', fs.readFileSync('buildtools/third_party/libc++/BUILD.gn', 'utf-8').replace('\"//third_party/libc++/src/src/verbose_abort.cpp\",', '\"//third_party/libc++/src/src/verbose_abort.cpp\",\n \"//third_party/libc++/src/src/wrap_symbols.cc\",'));"
brew install llvm
export PATH="/usr/local/opt/llvm/bin:$PATH"
CXX_SETTING="use_custom_libcxx=true libcxx_is_shared=false"
Expand Down
13 changes: 13 additions & 0 deletions node-script/patchs.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,18 @@ function addV8CC() {
justReplace(path.join(v8_path, 'src/api/api.h'), 'NewArray<internal::Address>(kHandleBlockSize)', 'NewArray<internal::Address>(kHandleBlockSize + 1)');
} else {
console.log("wrap_new is set, skip path kHandleBlockSize");
const replacePath = path.join(v8_path, 'buildtools/third_party/libc++/BUILD.gn');
if (v8_version == "9.4.146.24") {
justReplace(replacePath, '\"trunk/src/vector.cpp\",', '\"trunk/src/vector.cpp\",\n \"trunk/src/wrap_symbols.cc\",');
fs.copyFileSync(path.join(__dirname, 'wrap_symbols.cc'), path.join(v8_path, 'buildtools/third_party/libc++/trunk/src/wrap_symbols.cc'));
} else if (v8_version == "10.6.194") {
justReplace(replacePath, '\"trunk/src/verbose_abort.cpp\",', '\"trunk/src/verbose_abort.cpp\",\n \"trunk/src/wrap_symbols.cc\",');
fs.copyFileSync(path.join(__dirname, 'wrap_symbols.cc'), path.join(v8_path, 'buildtools/third_party/libc++/trunk/src/wrap_symbols.cc'));
} else if (v8_version == "11.8.172") {
justReplace(replacePath, '\"//third_party/libc++/src/src/verbose_abort.cpp\",', '\"//third_party/libc++/src/src/verbose_abort.cpp\",\n \"//third_party/libc++/src/src/wrap_symbols.cc\",');
fs.copyFileSync(path.join(__dirname, 'wrap_symbols.cc'), path.join(v8_path, 'third_party/libc++/src/src/wrap_symbols.cc'));
} else {
throw new Error(`not support version:${v8_version}`);
}
}
})();
2 changes: 0 additions & 2 deletions windows_32.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ set "CXX_SETTING=is_clang=false use_custom_libcxx=false"

if "%NEW_WRAP%"=="with_new_wrap" (
echo =====[ wrap new delete ]=====
copy /Y %~dp0\node-script\wrap_symbols.cc "third_party\libc++\src\src"
node -e "const fs = require('fs'); fs.writeFileSync('buildtools/third_party/libc++/BUILD.gn', fs.readFileSync('buildtools/third_party/libc++/BUILD.gn', 'utf-8').replace('\"//third_party/libc++/src/src/verbose_abort.cpp\",', '\"//third_party/libc++/src/src/verbose_abort.cpp\",\n \"//third_party/libc++/src/src/wrap_symbols.cc\",'));"
set "CXX_SETTING=is_clang=true use_custom_libcxx=true"
)

Expand Down
2 changes: 0 additions & 2 deletions windows_64.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ set "CXX_SETTING=is_clang=false use_custom_libcxx=false"

if "%NEW_WRAP%"=="with_new_wrap" (
echo =====[ wrap new delete ]=====
copy /Y %~dp0\node-script\wrap_symbols.cc "third_party\libc++\src\src"
node -e "const fs = require('fs'); fs.writeFileSync('buildtools/third_party/libc++/BUILD.gn', fs.readFileSync('buildtools/third_party/libc++/BUILD.gn', 'utf-8').replace('\"//third_party/libc++/src/src/verbose_abort.cpp\",', '\"//third_party/libc++/src/src/verbose_abort.cpp\",\n \"//third_party/libc++/src/src/wrap_symbols.cc\",'));"
set "CXX_SETTING=is_clang=true use_custom_libcxx=true"
)

Expand Down
2 changes: 0 additions & 2 deletions windows_64MD.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ set "CXX_SETTING=is_clang=false use_custom_libcxx=false"

if "%NEW_WRAP%"=="with_new_wrap" (
echo =====[ wrap new delete ]=====
copy /Y %~dp0\node-script\wrap_symbols.cc "third_party\libc++\src\src"
node -e "const fs = require('fs'); fs.writeFileSync('buildtools/third_party/libc++/BUILD.gn', fs.readFileSync('buildtools/third_party/libc++/BUILD.gn', 'utf-8').replace('\"//third_party/libc++/src/src/verbose_abort.cpp\",', '\"//third_party/libc++/src/src/verbose_abort.cpp\",\n \"//third_party/libc++/src/src/wrap_symbols.cc\",'));"
set "CXX_SETTING=is_clang=true use_custom_libcxx=true"
)

Expand Down
2 changes: 0 additions & 2 deletions windows_64MD_DLL_94.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ set "CXX_SETTING=is_clang=false use_custom_libcxx=false"

if "%NEW_WRAP%"=="with_new_wrap" (
echo =====[ wrap new delete ]=====
copy /Y %~dp0\node-script\wrap_symbols.cc "third_party\libc++\src\src"
node -e "const fs = require('fs'); fs.writeFileSync('buildtools/third_party/libc++/BUILD.gn', fs.readFileSync('buildtools/third_party/libc++/BUILD.gn', 'utf-8').replace('\"//third_party/libc++/src/src/verbose_abort.cpp\",', '\"//third_party/libc++/src/src/verbose_abort.cpp\",\n \"//third_party/libc++/src/src/wrap_symbols.cc\",'));"
set "CXX_SETTING=is_clang=true use_custom_libcxx=true libcxx_is_shared=false"
)

Expand Down

0 comments on commit 082810d

Please sign in to comment.