Skip to content

Build error on Windows (arm64) #240

Closed
Listed in
Closed
@targos

Description

@targos
Member

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

targos

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

pbo-linaro

pbo-linaro commented on Sep 16, 2022

@pbo-linaro

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)?

niyas-sait

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.

targos

targos commented on Sep 16, 2022

@targos
MemberAuthor

Yes, please send a patch upstream if possible!

pbo-linaro

pbo-linaro commented on Sep 16, 2022

@pbo-linaro

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

targos

targos commented on Sep 16, 2022

@targos
MemberAuthor

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

pbo-linaro

pbo-linaro commented on Sep 20, 2022

@pbo-linaro

@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 👍

pbo-linaro

pbo-linaro commented on Sep 23, 2022

@pbo-linaro

@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.

targos

targos commented on Sep 23, 2022

@targos
MemberAuthor

Amazing!

added a commit that references this issue on Sep 23, 2022
pbo-linaro

pbo-linaro commented on Sep 25, 2022

@pbo-linaro

@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 👍

added a commit that references this issue on Sep 25, 2022
targos

targos commented on Sep 25, 2022

@targos
MemberAuthor

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

23 remaining items

Loading
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

        Participants

        @targos@niyas-sait@pbo-linaro

        Issue actions

          Build error on Windows (arm64) · Issue #240 · nodejs/node-v8