-
Notifications
You must be signed in to change notification settings - Fork 36
/
v8-env-script-x86.sh
60 lines (43 loc) · 1.48 KB
/
v8-env-script-x86.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
sudo apt-get install -y ccache
sudo apt-get install -y cmake
sudo apt-get install -y pkg-config
ccache --version
# ccache version 4.6.3
ccache g++ --version
# Apple clang version 13.1.6 (clang-1316.0.21.2.5)
# Target: arm64-apple-darwin21.6.0
# Thread model: posix
# InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
cmake --version
# cmake version 3.24.1
pkg-config --version
# 0.29.2
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH=`pwd`/depot_tools:$PATH
echo "export PATH=`pwd`/depot_tools:\$PATH" >> ~/.zshrc
cd depot_tools && git checkout 787e71ac && cd ..
# add patch
mkdir -p lib/v8 && cd lib/v8
gclient
fetch v8
cd v8
git checkout 4ec5bb4f26
tools/dev/v8gen.py list
tools/dev/v8gen.py x64.release.sample
# echo 'v8_target_cpu = "arm64"' >> out.gn/x64.release.sample/args.gn
echo 'cc_wrapper="ccache"' >> out.gn/x64.release.sample/args.gn
sed -ie '/v8_enable_sandbox/d' out.gn/x64.release.sample/args.gn
export CCACHE_CPP2=yes
export CCACHE_SLOPPINESS=time_macros
# Optionally, add this to your ~/.zshrc if you are using zsh, or any
# other equivalents
echo "export CCACHE_CPP2=yes" >> ~/.zshrc
echo "export CCACHE_SLOPPINESS=time_macros" >> ~/.zshrc
time ninja -C out.gn/x64.release.sample v8_monolith
cp out.gn/x64.release.sample/obj/libv8_monolith.a ../../../v8/
cp out.gn/x64.release.sample/icudtl.dat ../../../v8/
cp -r include ../../../v8/
# clean up
cd ../../
rm -rf v8
rm -rf depot_tools