VS2015编译v8-6.3.298

  1. v8下载从 https://codeload.kkgithub.com/v8/v8/zip/refs/tags/6.3.298
  2. gyp编译方式只能用python27, 如果有其他版本需要在cmd修改path优先, 同样vs中也要添加优先
path E:\App\python27-x64;%PATH%
python gypfiles\gyp_v8.py -Dtarget_arch=ia32 -f msvs
  1. 需要下载gyp
    https://github.com/chromium/gyp

  2. 继续报错, 要下载其他组件six, jinja2,markupsafe
    以前有下载chromium的源码, 从那边复制过来
    https://codeload.github.com/chromium/chromium/zip/refs/tags/93.0.4577.63
    I:\chromium-93.0.4577.63\third_party\six\src
    I:\chromium-93.0.4577.63\tools\clang
    I:\chromium-93.0.4577.63\third_party\jinja2
    I:\chromium-93.0.4577.63\third_party\markupsafe

six需要命令安装: E:\App\python27-x64\python.exe V:\six\setup.py install
其他只要复制过去

  1. icu报错
    修改 gypfiles\features.gypi 文件修改不使用icu
    'v8_enable_i18n_support%': 0,

  2. BIT_FIELD_ACCESSORS 相关报错修改, constexpr问题

#define BIT_FIELD_ACCESSORS(holder, field, name, BitField)      \
  BitField::FieldType holder::name() const {           \
    return BitField::decode(field());                           \
  }                                                             \
  void holder::set_##name(BitField::FieldType value) { \
    set_##field(BitField::update(field(), value));              \
  }
  1. ObjectTypeOf 相关报错修改, 模板可变参数问题
template <typename Derived, typename Shape> struct ObjectTypeOf<Dictionary<Derived, Shape>> 
{ 
	static const ObjectType value = ObjectType::kDictionary; 
}; 
template <typename Derived, typename Shape> struct ObjectTypeOf<HashTable<Derived, Shape>> 
{ 
	static const ObjectType value = ObjectType::kHashTable; 
}; 
template <class Derived, int entrysize> struct ObjectTypeOf<OrderedHashTable<Derived, entrysize>> 
{ 
	static const ObjectType value = ObjectType::kOrderedHashTable; 
};
  1. fatal error C1001: 编译器中发生内部错误。
    也是constexpr问题, 删除关键字

  2. SimdScalarLowering::kLaneOffsets 初始化报错
    把初始化从类中移动到cpp文件

  3. static_assert 报错

static_assert(sizeof(uint8_t) == sizeof(SectionCode), "type mismatch");
  1. SetForwardingHandlerIfTrue 报错, 参数加转换
  SetForwardingHandlerIfTrue(
      context, instrumenting,
      (Node*)LoadObjectField(capability, PromiseCapability::kRejectOffset));
  1. 修改输出目录导致报错
文本方式打开项目文件, 可以看到
<ClCompile Include="$(OutDir)obj\global_intermediate\src\inspector\protocol\Protocol.cpp" />
文件实际生成在
third_party\inspector_protocol\CodeGenerator.py
配置命令为
call call python "..\..\third_party\inspector_protocol\CodeGenerator.py" "--jinja_dir" "..\..\third_party" "--output_base" "$(OutDir)obj\global_intermediate\src\inspector" "--config" "inspector_protocol_config.json"
两个的$(OutDir)路径要一致

经过以上编译OK

posted @ 2025-03-07 13:19  Yofoo  阅读(36)  评论(0)    收藏  举报