Skip to content

Build error on Windows (arm64) #240

Description

@targos

https://ci.nodejs.org/job/node-compile-windows/46957/nodes=win-vs2019-arm64/console

11:13:20   simd.cc
11:13:21 C:\workspace\node-compile-windows\node\deps\v8\src\objects\simd.cc(99,28): error C2078: too many initializers [C:\workspace\node-compile-windows\node\tools\v8_gypfiles\v8_base_without_compiler.vcxproj]
11:13:21 C:\workspace\node-compile-windows\node\deps\v8\src\objects\simd.cc(109,1): error C2766: explicit specialization; 'int v8::internal::`anonymous-namespace'::extract_first_nonzero_index<uint32x4_t>(uint32x4_t)' has already been defined [C:\workspace\node-compile-windows\node\tools\v8_gypfiles\v8_base_without_compiler.vcxproj]

Activity

  1. targos commented on Sep 16, 2022

    @targos
    MemberAuthor

    The first error is considered "not a bug" by Microsoft. What should we do?

    @nodejs/platform-windows-arm

    https://developercommunity.visualstudio.com/t/error-c2078-too-many-initializers-when-using-arm-n/402911

  2. p-b-o commented on Sep 16, 2022

    @p-b-o

    It seems like a workaround was given by Microsoft (using .128_u8).
    It it's working, would that be possible to simply add an ifdef for that compiler (vs gcc/clang)?

  3. niyas-sait commented on Sep 16, 2022

    @niyas-sait

    We probably should upstream a patch to V8 as well to fix the same issue with MSVC.

  4. targos commented on Sep 16, 2022

    @targos
    MemberAuthor

    Yes, please send a patch upstream if possible!

  5. p-b-o commented on Sep 16, 2022

    @p-b-o

    I'll look at it :)
    If we integrate that in v8, can you easily update to latest version (including current trunk)?

  6. targos commented on Sep 16, 2022

    @targos
    MemberAuthor

    Yes, the canary branch in this repository is updated automatically every day.

  7. p-b-o commented on Sep 20, 2022

    @p-b-o

    @targos After investigation, it is indeed not a bug in msvc, but simply the C++ standard dictating this (and gcc having an extension that accepts it). The way to initialize those variables must be changed specifically for msvc.

    In more, there is another problem appearing with a conflict between two template specialization.

    Quick and dirty details and patch are available here: https://github.com/pbo-linaro/node/commit/7586c64749459e238023834dc0ab8b0d941c819b.

    I'll try to upstream that in V8 directly (so nodejs and other projects can benefit from it).
    If that's not ready for next nodejs release, you can still use that patch 👍

  8. p-b-o commented on Sep 23, 2022

    @p-b-o

    @targos I just submitted 4 patches to fix all compilation errors of V8 with MSVC (including some not concerning Node).

    This one solves issue discussed here.

  9. targos commented on Sep 23, 2022

    @targos
    MemberAuthor

    Amazing!

  10. added a commit that references this issue on Sep 23, 2022
  11. p-b-o commented on Sep 25, 2022

    @p-b-o

    @targos Patches are now merged upstream, v8 canary should be able to compile for windows from now.

    Don't hesitate to ping me if you need help in the future 👍

  12. targos commented on Sep 25, 2022

    @targos
    MemberAuthor

    Cherry-picked all patches to nodejs/node#44741.

  13. added a commit that references this issue on Sep 25, 2022
  14. 6 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions