nodejs 26.8.2 fails to build with clang/LLVM

Abierto Apto para principiantes
#66,076 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
1/5
Tiempo estimado
Menos de una hora
Aptitud para principiantes
88/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
cpp, linux, nodejs

Línea de trabajo

Comienza con deps/LIEF/third-party/frozen/include/frozen/map.h y luego reproduce la compilación de Node.js 26.8.2 en Linux con Clang. Comprueba la dependencia de la biblioteca estándar indicada en el error y verifica que la compilación se complete correctamente con Clang sin los errores de std::less no definido.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

build
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

Lenguaje dominante
JavaScript
Estrellas
122k
Forks
37.4k
Merge medio
4 d 3 h
PR fusionados (30 d)
273

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de nodejs/node

Todos los issues de nodejs/node

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.