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

Update compiler for Node.js 16 #42

Merged
merged 1 commit into from
Aug 15, 2021
Merged

Conversation

richardlau
Copy link
Member

Node.js 16 requires gcc/g++ 8.3 or later.

V8 9.2 included in Node.js 16.6.0 fails to compile with gcc/g++ 8.2.1:
https://unofficial-builds.nodejs.org/logs/202107292303-v16.6.0/x64-usdt.log

../deps/v8/src/builtins/builtins-call-gen.cc: In instantiation of 'void v8::internal::CallOrConstructBuiltinsAssembler::CallReceiver(v8::internal::Builtins::Name, v8::internal::TNode<v8::internal::Int32T>, v8::internal::TNode<v8::internal::UintPtrT>, v8::base::Optional<v8::internal::TNode<v8::internal::Object> >) [with Descriptor = v8::internal::CallTrampoline_BaselineDescriptor]':
../deps/v8/src/builtins/builtins-call-gen.cc:81:42:   required from here
../deps/v8/src/builtins/builtins-call-gen.cc:491:14: error: passing 'const v8::base::Optional<v8::internal::TNode<v8::internal::Object> >' as 'this' argument discards qualifiers [-fpermissive]
       return *maybe_receiver;
              ^~~~~~~~~~~~~~~
In file included from ../deps/v8/src/compiler/code-assembler.h:17,
                 from ../deps/v8/src/codegen/code-stub-assembler.h:15,
                 from ../deps/v8/src/builtins/builtins-call-gen.h:8,
                 from ../deps/v8/src/builtins/builtins-call-gen.cc:5:
../deps/v8/src/base/optional.h:575:16: note:   in call to 'constexpr T& v8::base::Optional<T>::operator*() & [with T = v8::internal::TNode<v8::internal::Object>]'
   constexpr T& operator*() & {
                ^~~~~~~~
../deps/v8/src/builtins/builtins-call-gen.cc: In instantiation of 'void v8::internal::CallOrConstructBuiltinsAssembler::CallReceiver(v8::internal::Builtins::Name, v8::internal::TNode<v8::internal::Int32T>, v8::internal::TNode<v8::internal::UintPtrT>, v8::base::Optional<v8::internal::TNode<v8::internal::Object> >) [with Descriptor = v8::internal::CallTrampoline_Baseline_CompactDescriptor]':
../deps/v8/src/builtins/builtins-call-gen.cc:479:3:   required from 'void v8::internal::CallOrConstructBuiltinsAssembler::CallReceiver(v8::internal::Builtins::Name, v8::base::Optional<v8::internal::TNode<v8::internal::Object> >) [with Descriptor = v8::internal::CallTrampoline_Baseline_CompactDescriptor]'
../deps/v8/src/builtins/builtins-call-gen.cc:72:79:   required from here
../deps/v8/src/builtins/builtins-call-gen.cc:491:14: error: passing 'const v8::base::Optional<v8::internal::TNode<v8::internal::Object> >' as 'this' argument discards qualifiers [-fpermissive]
       return *maybe_receiver;
              ^~~~~~~~~~~~~~~
In file included from ../deps/v8/src/compiler/code-assembler.h:17,
                 from ../deps/v8/src/codegen/code-stub-assembler.h:15,
                 from ../deps/v8/src/builtins/builtins-call-gen.h:8,
                 from ../deps/v8/src/builtins/builtins-call-gen.cc:5:
../deps/v8/src/base/optional.h:575:16: note:   in call to 'constexpr T& v8::base::Optional<T>::operator*() & [with T = v8::internal::TNode<v8::internal::Object>]'
   constexpr T& operator*() & {
                ^~~~~~~~
In file included from /opt/rh/devtoolset-8/root/usr/include/c++/8/functional:59,
                 from ../deps/v8/src/codegen/code-stub-assembler.h:8,
                 from ../deps/v8/src/builtins/builtins-call-gen.h:8,
                 from ../deps/v8/src/builtins/builtins-call-gen.cc:5:
/opt/rh/devtoolset-8/root/usr/include/c++/8/bits/std_function.h:666:7: error: 'std::function<_Res(_ArgTypes ...)>::function(_Functor) [with _Functor = v8::internal::CallOrConstructBuiltinsAssembler::CallReceiver(v8::internal::Builtins::Name, v8::internal::TNode<v8::internal::Int32T>, v8::internal::TNode<v8::internal::UintPtrT>, v8::base::Optional<v8::internal::TNode<v8::internal::Object> >) [with Descriptor = v8::internal::CallTrampoline_BaselineDescriptor]::<lambda()>; <template-parameter-2-2> = void; <template-parameter-2-3> = void; _Res = v8::internal::TNode<v8::internal::Object>; _ArgTypes = {}]', declared using local type 'v8::internal::CallOrConstructBuiltinsAssembler::CallReceiver(v8::internal::Builtins::Name, v8::internal::TNode<v8::internal::Int32T>, v8::internal::TNode<v8::internal::UintPtrT>, v8::base::Optional<v8::internal::TNode<v8::internal::Object> >) [with Descriptor = v8::internal::CallTrampoline_BaselineDescriptor]::<lambda()>', is used but never defined [-fpermissive]
       function<_Res(_ArgTypes...)>::
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/rh/devtoolset-8/root/usr/include/c++/8/bits/std_function.h:666:7: error: 'std::function<_Res(_ArgTypes ...)>::function(_Functor) [with _Functor = v8::internal::CallOrConstructBuiltinsAssembler::CallReceiver(v8::internal::Builtins::Name, v8::internal::TNode<v8::internal::Int32T>, v8::internal::TNode<v8::internal::UintPtrT>, v8::base::Optional<v8::internal::TNode<v8::internal::Object> >) [with Descriptor = v8::internal::CallTrampoline_Baseline_CompactDescriptor]::<lambda()>; <template-parameter-2-2> = void; <template-parameter-2-3> = void; _Res = v8::internal::TNode<v8::internal::Object>; _ArgTypes = {}]', declared using local type 'v8::internal::CallOrConstructBuiltinsAssembler::CallReceiver(v8::internal::Builtins::Name, v8::internal::TNode<v8::internal::Int32T>, v8::internal::TNode<v8::internal::UintPtrT>, v8::base::Optional<v8::internal::TNode<v8::internal::Object> >) [with Descriptor = v8::internal::CallTrampoline_Baseline_CompactDescriptor]::<lambda()>', is used but never defined [-fpermissive]
make[2]: *** [tools/v8_gypfiles/v8_initializers.target.mk:388: /home/node/node-v16.6.0/out/Release/obj.target/v8_initializers/deps/v8/src/builtins/builtins-call-gen.o] Error 1

The baseline compiler requirement for Node.js 16 is gcc/g++ 8.3: https://github.com/nodejs/node/blob/v16.0.0/BUILDING.md#supported-toolchains

This PR updates the compiler used for Node.js 16 and later by enabling devtoolset-9.

The Cloud Linux repo's devtoolset-8 package is gcc/g++ 8.2.1:
https://repo.cloudlinux.com/cloudlinux/7/sclo/devtoolset-8/x86_64/
image

FWIW Software Collections does have a devtoolset-8 that provides gcc/g++ 8.3.1 but only for x64:
http://mirror.centos.org/centos/7/sclo/x86_64/rh/Packages/d/
image

Pointer compression builds were separately broken in 16.4.0 nodejs/TSC#790 (comment) and may need nodejs/node#39664 (not yet in a release).

Node.js 16 requires gcc/g++ 8.3 or later.
Copy link
Member

@rvagg rvagg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems fine to me
I take it that this is only impacting the images that are centos/rhel based so those are the ones getting the udpate?

@richardlau
Copy link
Member Author

I take it that this is only impacting the images that are centos/rhel based so those are the ones getting the udpate?

Correct.

@richardlau richardlau merged commit 00164ad into nodejs:master Aug 15, 2021
@richardlau richardlau deleted the compiler branch August 15, 2021 19:22
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

Successfully merging this pull request may close these issues.

2 participants