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

Debug build broken on v18.8.0 #44371

Open
trevnorris opened this issue Aug 24, 2022 · 2 comments
Open

Debug build broken on v18.8.0 #44371

trevnorris opened this issue Aug 24, 2022 · 2 comments
Labels
build Issues and PRs related to build files or the CI.

Comments

@trevnorris
Copy link
Contributor

trevnorris commented Aug 24, 2022

Version

v18.8.0

Platform

Linux pop-os 5.18.10-76051810-generic

Subsystem

build

What steps will reproduce the bug?

$ ./configure --debug
$ make

How often does it reproduce? Is there a required condition?

Every time when compiling with clang. The debug build completes when using gcc.

What is the expected behavior?

To build properly.

What do you see instead?

The following output during the build:

../deps/v8/src/codegen/register.h:29:48: error: member reference base type 'RegListBase' is not a structure or union
  int num_different_regs = RegListBase{regs...}.Count();
                           ~~~~~~~~~~~~~~~~~~~~^~~~~~

Additional information

I'm compiling with clang 11.1.0 and gcc 11.2.0.

@VoltrexKeyva VoltrexKeyva added the build Issues and PRs related to build files or the CI. label Aug 24, 2022
@bnoordhuis
Copy link
Member

Hi Trevor, long time no see! Does it work when you apply this patch?

diff --git a/src/codegen/register.h b/src/codegen/register.h
index e36e4d1e9af..36561fe5077 100644
--- a/deps/v8/src/codegen/register.h
+++ b/deps/v8/src/codegen/register.h
@@ -19,18 +19,17 @@ constexpr bool ShouldPadArguments(int argument_count) {
   return ArgumentPaddingSlots(argument_count) != 0;
 }
 
 #ifdef DEBUG
 template <typename... RegTypes,
           // All arguments must be either Register or DoubleRegister.
           typename = typename std::enable_if_t<
               std::conjunction_v<std::is_same<Register, RegTypes>...> ||
               std::conjunction_v<std::is_same<DoubleRegister, RegTypes>...>>>
 inline constexpr bool AreAliased(RegTypes... regs) {
-  int num_different_regs = RegListBase{regs...}.Count();
+  using FirstRegType = std::tuple_element_t<0, std::tuple<RegTypes...>>;
+  int num_different_regs = RegListBase<FirstRegType>{regs...}.Count();
   int num_given_regs = (... + (regs.is_valid() ? 1 : 0));
   return num_different_regs < num_given_regs;
 }
 #endif

 }  // namespace internal
 }  // namespace v8

@trevnorris
Copy link
Contributor Author

Hey Ben! It has been a while. That patch does fix the Debug build issue. Thanks.

bnoordhuis added a commit to bnoordhuis/io.js that referenced this issue Aug 25, 2022
This is a (very) partial cherry-pick of upstream change v8/v8@f8fddd6b13
that fixes the following debug mode build error with clang:

    ../deps/v8/src/codegen/register.h:29:48: error: member reference
    base type 'RegListBase' is not a structure or union
      int num_different_regs = RegListBase{regs...}.Count();

Fixes: nodejs#44371
@trevnorris trevnorris changed the title Debug build broken on v18.8.0-proposal Debug build broken on v18.8.0 Aug 26, 2022
danielleadams pushed a commit that referenced this issue Oct 5, 2022
This is a (very) partial cherry-pick of upstream change v8/v8@f8fddd6b13
that fixes the following debug mode build error with clang:

    ../deps/v8/src/codegen/register.h:29:48: error: member reference
    base type 'RegListBase' is not a structure or union
      int num_different_regs = RegListBase{regs...}.Count();

Fixes: #44371
PR-URL: #44392
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Jiawen Geng <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Zeyu "Alex" Yang <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI.
Projects
None yet
Development

No branches or pull requests

3 participants