Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to compile NodeJS LTS Boron 6.11 #664

Closed
ArchangeGabriel opened this issue Jun 8, 2017 · 12 comments
Closed

Failure to compile NodeJS LTS Boron 6.11 #664

ArchangeGabriel opened this issue Jun 8, 2017 · 12 comments

Comments

@ArchangeGabriel
Copy link

  • Node.js Version: 6.11
  • OS: Arch Linux
  • Scope: Compilation

When building (with shared c-ares, libuv, icu, http-parser, openssl and zlib if that matters), it fails with the following error:

../deps/v8/src/objects-body-descriptors.h: In static member function ‘static void v8::internal::FixedBodyDescriptor<start_offset, end_offset, size>::IterateBody(v8::internal::HeapObject*, int)’:
../deps/v8/src/objects-body-descriptors.h:102:20: error: no matching function for call to ‘v8::internal::FixedBodyDescriptor<start_offset, end_offset, size>::IterateBody(v8::internal::HeapObject*&)’
     IterateBody(obj);
                    ^
../deps/v8/src/objects-body-descriptors.h:84:22: note: candidate: template<int start_offset, int end_offset, int size> template<class ObjectVisitor> static void v8::internal::FixedBodyDescriptor<start_offset, end_offset, size>::IterateBody(v8::internal::HeapObject*, ObjectVisitor*)
   static inline void IterateBody(HeapObject* obj, ObjectVisitor* v) {
                      ^~~~~~~~~~~
../deps/v8/src/objects-body-descriptors.h:84:22: note:   template argument deduction/substitution failed:
../deps/v8/src/objects-body-descriptors.h:102:20: note:   candidate expects 2 arguments, 1 provided
     IterateBody(obj);
                    ^
../deps/v8/src/objects-body-descriptors.h:89:22: note: candidate: template<int start_offset, int end_offset, int size> template<class ObjectVisitor> static void v8::internal::FixedBodyDescriptor<start_offset, end_offset, size>::IterateBody(v8::internal::HeapObject*, int, ObjectVisitor*)
   static inline void IterateBody(HeapObject* obj, int object_size,
                      ^~~~~~~~~~~
../deps/v8/src/objects-body-descriptors.h:89:22: note:   template argument deduction/substitution failed:
../deps/v8/src/objects-body-descriptors.h:102:20: note:   candidate expects 3 arguments, 1 provided
     IterateBody(obj);
                    ^
../deps/v8/src/objects-body-descriptors.h:95:22: note: candidate: template<int start_offset, int end_offset, int size> template<class StaticVisitor> static void v8::internal::FixedBodyDescriptor<start_offset, end_offset, size>::IterateBody(v8::internal::HeapObject*)
   static inline void IterateBody(HeapObject* obj) {
                      ^~~~~~~~~~~
../deps/v8/src/objects-body-descriptors.h:95:22: note:   template argument deduction/substitution failed:
../deps/v8/src/objects-body-descriptors.h:102:20: note:   couldn't deduce template parameter ‘StaticVisitor’
     IterateBody(obj);
                    ^
../deps/v8/src/objects-body-descriptors.h:101:22: note: candidate: template<int start_offset, int end_offset, int size> template<class StaticVisitor> static void v8::internal::FixedBodyDescriptor<start_offset, end_offset, size>::IterateBody(v8::internal::HeapObject*, int)
   static inline void IterateBody(HeapObject* obj, int object_size) {
                      ^~~~~~~~~~~
../deps/v8/src/objects-body-descriptors.h:101:22: note:   template argument deduction/substitution failed:
../deps/v8/src/objects-body-descriptors.h:102:20: note:   candidate expects 2 arguments, 1 provided
     IterateBody(obj);
                    ^
make[1]: *** [deps/v8/tools/gyp/v8_base.target.mk:482: /build/nodejs-lts-boron/src/node-v6.11.0/out/Release/obj.target/v8_base/deps/v8/src/heap/heap.o] Error 1
In file included from ../deps/v8/src/heap/objects-visiting.h:12:0,
                 from ../deps/v8/src/heap/scavenger.h:8,
                 from ../deps/v8/src/heap/scavenger.cc:5:
../deps/v8/src/objects-body-descriptors.h: In static member function ‘static void v8::internal::FixedBodyDescriptor<start_offset, end_offset, size>::IterateBody(v8::internal::HeapObject*, int)’:
../deps/v8/src/objects-body-descriptors.h:102:20: error: no matching function for call to ‘v8::internal::FixedBodyDescriptor<start_offset, end_offset, size>::IterateBody(v8::internal::HeapObject*&)’
     IterateBody(obj);
                    ^
../deps/v8/src/objects-body-descriptors.h:84:22: note: candidate: template<int start_offset, int end_offset, int size> template<class ObjectVisitor> static void v8::internal::FixedBodyDescriptor<start_offset, end_offset, size>::IterateBody(v8::internal::HeapObject*, ObjectVisitor*)
   static inline void IterateBody(HeapObject* obj, ObjectVisitor* v) {
                      ^~~~~~~~~~~
../deps/v8/src/objects-body-descriptors.h:84:22: note:   template argument deduction/substitution failed:
../deps/v8/src/objects-body-descriptors.h:102:20: note:   candidate expects 2 arguments, 1 provided
     IterateBody(obj);
                    ^
../deps/v8/src/objects-body-descriptors.h:89:22: note: candidate: template<int start_offset, int end_offset, int size> template<class ObjectVisitor> static void v8::internal::FixedBodyDescriptor<start_offset, end_offset, size>::IterateBody(v8::internal::HeapObject*, int, ObjectVisitor*)
   static inline void IterateBody(HeapObject* obj, int object_size,
                      ^~~~~~~~~~~
../deps/v8/src/objects-body-descriptors.h:89:22: note:   template argument deduction/substitution failed:
../deps/v8/src/objects-body-descriptors.h:102:20: note:   candidate expects 3 arguments, 1 provided
     IterateBody(obj);
                    ^
../deps/v8/src/objects-body-descriptors.h:95:22: note: candidate: template<int start_offset, int end_offset, int size> template<class StaticVisitor> static void v8::internal::FixedBodyDescriptor<start_offset, end_offset, size>::IterateBody(v8::internal::HeapObject*)
   static inline void IterateBody(HeapObject* obj) {
                      ^~~~~~~~~~~
../deps/v8/src/objects-body-descriptors.h:95:22: note:   template argument deduction/substitution failed:
../deps/v8/src/objects-body-descriptors.h:102:20: note:   couldn't deduce template parameter ‘StaticVisitor’
     IterateBody(obj);
                    ^
../deps/v8/src/objects-body-descriptors.h:101:22: note: candidate: template<int start_offset, int end_offset, int size> template<class StaticVisitor> static void v8::internal::FixedBodyDescriptor<start_offset, end_offset, size>::IterateBody(v8::internal::HeapObject*, int)
   static inline void IterateBody(HeapObject* obj, int object_size) {
                      ^~~~~~~~~~~
../deps/v8/src/objects-body-descriptors.h:101:22: note:   template argument deduction/substitution failed:
../deps/v8/src/objects-body-descriptors.h:102:20: note:   candidate expects 2 arguments, 1 provided
     IterateBody(obj);
                    ^
make[1]: *** [deps/v8/tools/gyp/v8_base.target.mk:482: /build/nodejs-lts-boron/src/node-v6.11.0/out/Release/obj.target/v8_base/deps/v8/src/heap/objects-visiting.o] Error 1
In file included from ../deps/v8/src/heap/heap-inl.h:16:0,
                 from ../deps/v8/src/objects-inl.h:23,
                 from ../deps/v8/src/api.h:13,
                 from ../deps/v8/src/ast/ast-value-factory.h:31,
                 from ../deps/v8/src/ast/ast.h:9,
                 from ../deps/v8/src/x64/codegen-x64.h:8,
                 from ../deps/v8/src/codegen.h:48,
                 from ../deps/v8/src/code-stubs.h:10,
                 from ../deps/v8/src/heap/mark-compact.cc:10:
../deps/v8/src/heap/spaces-inl.h: In member function ‘v8::internal::MemoryChunk* v8::internal::MemoryChunkIterator::next()’:
../deps/v8/src/heap/spaces-inl.h:405:14: warning: this statement may fall through [-Wimplicit-fallthrough=]
       state_ = kMapState;
       ~~~~~~~^~~~~~~~~~~
../deps/v8/src/heap/spaces-inl.h:408:5: note: here
     case kMapState: {
     ^~~~
../deps/v8/src/heap/spaces-inl.h:412:14: warning: this statement may fall through [-Wimplicit-fallthrough=]
       state_ = kCodeState;
       ~~~~~~~^~~~~~~~~~~~
../deps/v8/src/heap/spaces-inl.h:415:5: note: here
     case kCodeState: {
     ^~~~
../deps/v8/src/heap/spaces-inl.h:419:14: warning: this statement may fall through [-Wimplicit-fallthrough=]
       state_ = kLargeObjectState;
       ~~~~~~~^~~~~~~~~~~~~~~~~~~
../deps/v8/src/heap/spaces-inl.h:422:5: note: here
     case kLargeObjectState: {
     ^~~~
../deps/v8/src/heap/spaces-inl.h:427:14: warning: this statement may fall through [-Wimplicit-fallthrough=]
       state_ = kFinishedState;
       ~~~~~~~^~~~~~~~~~~~~~~~
../deps/v8/src/heap/spaces-inl.h:430:5: note: here
     case kFinishedState:
     ^~~~
make[1]: *** [deps/v8/tools/gyp/v8_base.target.mk:482: /build/nodejs-lts-boron/src/node-v6.11.0/out/Release/obj.target/v8_base/deps/v8/src/heap/mark-compact.o] Error 1
make[1]: *** [deps/v8/tools/gyp/v8_base.target.mk:482: /build/nodejs-lts-boron/src/node-v6.11.0/out/Release/obj.target/v8_base/deps/v8/src/heap/scavenger.o] Error 1
rm fc641a3a779e3f1744620786b10a32ccbda020e7.intermediate
make[1]: Leaving directory '/build/nodejs-lts-boron/src/node-v6.11.0/out'
make: *** [Makefile:73: node] Error 2

Please tell me if you need full log or further information.

@gibfahn
Copy link
Member

gibfahn commented Jun 8, 2017

maybe cc/ @nodejs/v8 @danbev

@gibfahn
Copy link
Member

gibfahn commented Jun 8, 2017

@ArchangeGabriel what Arch level and compiler levels are you using?

@gibfahn
Copy link
Member

gibfahn commented Jun 8, 2017

Also did you get the source by git clone or by downloading the tarball from nodejs.org?

@ArchangeGabriel
Copy link
Author

It’s the tarball from nodejs.org. Not sure what you mean by Arch level (x86_64 ?), but compiler is gcc 7.1.1.

@gibfahn
Copy link
Member

gibfahn commented Jun 9, 2017

This sounds similar to nodejs/node#10388 then, although that's on master rather than Node 6. See nodejs/node#13517 as well.

cc/ @bnoordhuis @targos

@ArchangeGabriel can you try an earlier version of Node 6? It sounds like it's probably never worked with gcc 7.

The workaround would be to use an earlier gcc, alternatively you could wait for a fix, but that'll take a while to get into LTS.

@ArchangeGabriel
Copy link
Author

OK, thank to asking me this, I’ve figured out that GCC 7 is responsible for this. I’ve tried compiling 6.10.3 again, and it failed. So the issue is compiling 6.x (and likely 4.x) with GCC 7.

Full log for 6.10.3: https://gist.github.com/ArchangeGabriel/589c470198459be620ad8ef2658458fa
Idem 6.11.0: https://gist.github.com/ArchangeGabriel/d33ba5637e19e5bca63f667a2b25e5ee

@ArchangeGabriel
Copy link
Author

Our post crossed (I was busy building the old version and updating the log).

Using an older version of gcc is likely not an option (on Arch, only latest gcc is supported AFAIK). So if I understand well the solution is to patch v8 in LTS for GCC7.

Other question: can NodeJS be built using a system installation of v8 instead of the embedded one? I suppose no, or only if using the same version as the embedded one, but not a newer one?

@gibfahn
Copy link
Member

gibfahn commented Jun 9, 2017

Other question: can NodeJS be built using a system installation of v8 instead of the embedded one? I suppose no, or only if using the same version as the embedded one, but not a newer one?

I wouldn't recommend it (I don't think many people have done that before).

So if I understand well the solution is to patch v8 in LTS for GCC7.

That is the solution, the issue is that as Node 6.x is an LTS stream, updates have to wait for a while before they go into it. However, if we can work out what the patch that fixes these issues is for 6.x, then you can just apply it before building.


BTW, I assume you want to build yourself rather than taking a tarball from the downloads page. That's fine, it'll just take longer for you to get Node onto your system compared to using nvm or just doing:

wget https://nodejs.org/dist/v6.11.0/node-v6.11.0-linux-x64.tar.xz
tar -xf node-v6.11.0-linux-x64.tar.gz --directory /usr/local --strip-components 1

@ArchangeGabriel
Copy link
Author

Yes of course, if the patch is done I can just apply it directly, as I did for ICU59. :)

And regarding building, yes, I don’t like using binaries from elsewhere than distro, and in this precise case I’m even packager for nodejs-lts-boron in Arch: https://www.archlinux.org/packages/community/x86_64/nodejs-lts-boron/. So using a prebuilt binary is not an option. ;)

@kasicka
Copy link

kasicka commented Jun 9, 2017

I opened nodejs/node#13574 that seems to work on rawhide with gcc 7.1.1

@ArchangeGabriel
Copy link
Author

Thanks, I’m closing this in favour of your PR then. Testing it right away too.

@ArchangeGabriel
Copy link
Author

Just as a side note, 4.x isn’t affected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants