nodejs / nodejs/node

nodejs 26.8.2 fails to build with clang/LLVM

未关闭 适合新手
#66,076 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

build
主要语言
JavaScript
星标
122k
派生
37.3k
平均合并
4 天 2 小时
30 天内合并 PR
283

描述

Version

26.8.2

Platform
Linux (Gentoo with LLVM profile)
Subsystem

LIEF (or forzen)

What steps will reproduce the bug?
  1. Build nodejs version 26.8.2 with clang
  2. Observe failure
How often does it reproduce? Is there a required condition?

Always while building with clang

What is the expected behavior? Why is that the expected behavior?

Successful build with clang

What do you see instead?

Build failure while building with Clang

A snippet from the build log:

...
In file included from ../../deps/LIEF/src/platforms/android/version.cpp:17:
In file included from ../../deps/LIEF/src/frozen.hpp:22:
../../deps/LIEF/third-party/frozen/include/frozen/map.h:40:20: error: implicit instantiation of undefined template 'std::less<LIEF::Android::ANDROID_VERSIONS>'
   40 |   Comparator const comparator_;
      |                    ^
../../deps/LIEF/third-party/frozen/include/frozen/map.h:75:29: note: in instantiation of template class 'frozen::impl::CompareKey<std::less<LIEF::Android::ANDROID_VERSIONS>>' requested here
   75 |   impl::CompareKey<Compare> less_than_;
      |                             ^
../../deps/LIEF/src/platforms/android/version.cpp:22:47: note: in instantiation of template class 'frozen::map<LIEF::Android::ANDROID_VERSIONS, const char *, 8>' requested here
   22 |   CONST_MAP(ANDROID_VERSIONS, const char*, 8) version2code {
      |                                               ^
/usr/include/c++/v1/__fwd/functional.h:25:8: note: template is declared here
   25 | struct less;
      |        ^
In file included from ../../deps/LIEF/src/platforms/android/version.cpp:17:
In file included from ../../deps/LIEF/src/frozen.hpp:22:
../../deps/LIEF/third-party/frozen/include/frozen/map.h:110:20: error: implicit instantiation of undefined template 'std::less<LIEF::Android::ANDROID_VERSIONS>'
  110 |       : map{items, Compare{}} {}
      |                    ^
../../deps/LIEF/src/platforms/android/version.cpp:22:47: note: in instantiation of member function 'frozen::map<LIEF::Android::ANDROID_VERSIONS, const char *, 8>::map' requested here
   22 |   CONST_MAP(ANDROID_VERSIONS, const char*, 8) version2code {
      |                                               ^
/usr/include/c++/v1/__fwd/functional.h:25:8: note: template is declared here
   25 | struct less;
      |        ^
../../deps/LIEF/src/platforms/android/version.cpp:22:47: error: constexpr variable 'version2code' must be initialized by a constant expression
   22 |   CONST_MAP(ANDROID_VERSIONS, const char*, 8) version2code {
...
Additional information

I think this is due to stricter include requirements on clang
I was able to build by adding #include <functional> in deps/LIEF/third-party/frozen/include/frozen/map.h

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 deps/LIEF/third-party/frozen/include/frozen/map.h 开始,然后使用 Clang 在 Linux 上复现 Node.js 26.8.2 的构建。检查错误中报告的标准库依赖项,并验证使用 Clang 的构建能够成功完成,且不会出现 std::less 未定义错误。

由索引模型根据 Issue 内容生成。

评估

技术栈
cpp, linux, nodejs
领域
build-system, operating-systems
Issue 类型
缺陷
难度
1/5
预计耗时
1 小时以内
活跃度
活跃
描述清晰度
描述清楚
新手友好度
88/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。