v8引擎编译一

12次阅读

共计 1759 个字符,预计需要花费 5 分钟才能阅读完成。

电脑配置 :macos catalina i5 16g 1t
编译版本 :v8-version,8.6.00.1
编译日期:2020.07.15

1.git 装置配置

先装置 homebrew

/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

而后

brew install git

git 的配置参考 https://docs.github.com/en/gi… 操作即可

2.depot_tools 下载安装

depot\_tools 是个工具包,外面蕴含 gclient、gcl、gn 和 ninja 等工具。其中 gclient 是代码获取工具,它其实是利用了 svn 和 git。gn 和 nijia 是编译工具

在下载 depot\_tools 时须要迷信上网这样能力关上https://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.html#_setting_up

同时还须要查看本人的迷信上网软件的代理端口而后

git config --global http.proxy "127.0.0.1:1087”

这样能力下载回来

git clone https://chromium.googlesource.com/chromium/tools/depot\_tools.git

下回来之后须要设置全局变量https://blog.csdn.net/akaier/article/details/81296794

设置好了当前须要输出 gclient 更新 depot\_tools 但会报错

curl: (7) Failed to connect to chrome-infra-packages.appspot.com port 443: Operation timed out

又是代理的问题所以间接这样设置https://www.jianshu.com/p/db3964292b1c

而后再来

gclient

更新会呈现

WARNING: Your metrics.cfg file was invalid or nonexistent. A new one will be created.

这时候就 ok 了

3. 编译源码

mkdir ~/v8

cd ~/v8

fetch v8

拉取对应的文件,继续期待

这个时候能够去下载 xcode 软件

等拉取完了能够在本地创立一个新分支

git new-branch 20200715gyk

git pull && gclient sync// 确保所有依赖都是最新的

开始编译源码

tools/dev/gm.py x64.release.check

autoninja 会主动编译记得开代理,漫长的期待

\# autoninja -C out/x64.release unittests cctest inspector-test d8 wasm\_api\_tests

ninja: Entering directory \`out/x64.release'

\[520/520\] LINK ./cctest

\# "/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python" tools/run-tests.py --outdir=out/x64.release debugger intl mjsunit cctest message unittests 

Build found: /Users/gyk/v8/v8/out/x64.release

\>>> Autodetected:

pointer\_compression

\>>> Running tests for x64.release

\>>> Running with test processors

\[02:24|% 97|+ 16494|- 0\]: Done 

\>>> 16972 base tests produced 16494 (97%) non-filtered tests

\>>> 16494 tests ran

Done! - V8 compilation finished successfully.
正文完
 0