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

Compiler error with latest canary #277

Closed
targos opened this issue Dec 20, 2023 · 11 comments
Closed

Compiler error with latest canary #277

targos opened this issue Dec 20, 2023 · 11 comments

Comments

@targos
Copy link
Member

targos commented Dec 20, 2023

https://github.com/nodejs/node-v8/actions/runs/7271603973/job/19812421974

In file included from /usr/include/unistd.h:226,
                 from ../deps/v8/third_party/abseil-cpp/absl/base/internal/thread_identity.h:27,
                 from ../deps/v8/third_party/abseil-cpp/absl/synchronization/mutex.h:71,
                 from ../deps/v8/third_party/abseil-cpp/absl/strings/internal/cordz_info.h:31,
                 from ../deps/v8/third_party/abseil-cpp/absl/strings/cord.h:91,
                 from ../deps/v8/third_party/abseil-cpp/absl/container/internal/hash_function_defaults.h:56,
                 from ../deps/v8/third_party/abseil-cpp/absl/container/flat_hash_map.h:41,
                 from ../deps/v8/src/zone/zone-containers.h:20,
                 from ../deps/v8/src/compiler/code-assembler.h:30,
                 from ../deps/v8/src/codegen/code-stub-assembler.h:15,
                 from ../deps/v8/src/builtins/builtins-iterator-gen.h:8,
                 from ../deps/v8/src/builtins/builtins-intl-gen.cc:9:
../deps/v8/src/builtins/builtins-intl-gen.cc: In member function ‘v8::internal::TNode<v8::internal::Uint8T> v8::internal::IntlBuiltinsAssembler::GetChar(v8::internal::TNode<v8::internal::SeqOneByteString>, int)’:
../deps/v8/src/builtins/builtins-intl-gen.cc:43:43: error: ‘index’ is not a constant expression
   43 |         offsetof(SeqOneByteString, chars_[index]) - kHeapObjectTag;
      |                                           ^~~~~
make[1]: *** [tools/v8_gypfiles/v8_initializers.target.mk:468: /home/runner/work/node-v8/node-v8/node-v8/out/Release/obj.target/v8_initializers/deps/v8/src/builtins/builtins-intl-gen.o] Error 1
@targos
Copy link
Member Author

targos commented Dec 20, 2023

Here's a test on my fork to see if the GCC version makes a difference: https://github.com/targos/node-v8/actions/runs/7275899259

@targos
Copy link
Member Author

targos commented Dec 20, 2023

Well, they all failed with the same error! Now I suspect it might be change that requires C++20 support.

@targos
Copy link
Member Author

targos commented Dec 20, 2023

@targos
Copy link
Member Author

targos commented Dec 20, 2023

Same error with C++20 😞

@targos
Copy link
Member Author

targos commented Dec 21, 2023

/cc @LeszekSwirski this seems to have been introduced by https://chromium-review.googlesource.com/c/v8/v8/+/5077926. Maybe you have an idea for why the V8 GCC buildbot didn't fail with that error?

@LeszekSwirski
Copy link

Interesting, looks like this was a change made in gcc 11 (see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95942) -- there seems to be some disagreement/lack of clarity in the C/C++ specs on whether an array member element access is a "member designator" or not, and looks like other compilers (and gcc up to 10) relaxed the spec requirement that the result is an integral constant. The V8 GCC buildbot runs with gcc 9, so it won't have picked this up.

I guess we have to rewrite this the old fashioned way -- shame, the offsetof with runtime index is much neater.

@LeszekSwirski
Copy link

@targos
Copy link
Member Author

targos commented Dec 21, 2023

Thank you!

@LeszekSwirski
Copy link

That fix landed, can you try patching it in and trying again?

@targos
Copy link
Member Author

targos commented Dec 21, 2023

@targos
Copy link
Member Author

targos commented Dec 22, 2023

Build passed!

@targos targos closed this as completed Dec 22, 2023
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

2 participants