-
Notifications
You must be signed in to change notification settings - Fork 71
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
Build error on Windows (arm64) #240
Comments
The first error is considered "not a bug" by Microsoft. What should we do? @nodejs/platform-windows-arm |
It seems like a workaround was given by Microsoft (using .128_u8). |
We probably should upstream a patch to V8 as well to fix the same issue with MSVC. |
Yes, please send a patch upstream if possible! |
I'll look at it :) |
Yes, the canary branch in this repository is updated automatically every day. |
@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). |
Amazing! |
This compilation error was found by NodeJS when updating V8: nodejs/node-v8#240 MSVC reports an error with "too many initializer" for type uint32x4_t. --- Under gcc/clang, this is a typedef to a builtin type. For MSVC, it is a typedef to this union: typedef union __n128 { unsigned __int64 n128_u64[2]; unsigned __int32 n128_u32[4]; ... } __n128; C++ mandates that only first member of union can be initialized at declaration. Thus, it can only be initialized with {uint64_t, uint64_t}. VS people proposed to use designated initializer instead: var = {.n128_u32={1, 2, 3, 8}} https://developercommunity.visualstudio.com/t/error-c2078-too-many-initializers-when-using-arm-n/402911 But, you need to use /std:c++20 for this, which is not the case in v8. --- Thus, the only solution is to implement a hack specifically for MSVC, where you build two uint64, from four uint32. --------------------------------------- Once solved, another error is reported: templated function extract_first_nonzero_index is specialized twice. This is because, with MSVC, uint32x4_t and uint64x2_t are typedef to the same __n128 union. The fix is to drop templates, and use explicit function names instead. Bug: v8:13312 Change-Id: I231d8cf01c05af01af319d56d5666c415f8b989b Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3913035 Reviewed-by: Igor Sheludko <ishell@chromium.org> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Commit-Queue: Jakob Kummerow <jkummerow@chromium.org> Cr-Commit-Position: refs/heads/main@{#83404}
@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 👍 |
Original commit message: [msvc] fix build with neon intrinsics This compilation error was found by NodeJS when updating V8: nodejs/node-v8#240 MSVC reports an error with "too many initializer" for type uint32x4_t. --- Under gcc/clang, this is a typedef to a builtin type. For MSVC, it is a typedef to this union: typedef union __n128 { unsigned __int64 n128_u64[2]; unsigned __int32 n128_u32[4]; ... } __n128; C++ mandates that only first member of union can be initialized at declaration. Thus, it can only be initialized with {uint64_t, uint64_t}. VS people proposed to use designated initializer instead: var = {.n128_u32={1, 2, 3, 8}} https://developercommunity.visualstudio.com/t/error-c2078-too-many-initializers-when-using-arm-n/402911 But, you need to use /std:c++20 for this, which is not the case in v8. --- Thus, the only solution is to implement a hack specifically for MSVC, where you build two uint64, from four uint32. --------------------------------------- Once solved, another error is reported: templated function extract_first_nonzero_index is specialized twice. This is because, with MSVC, uint32x4_t and uint64x2_t are typedef to the same __n128 union. The fix is to drop templates, and use explicit function names instead. Bug: v8:13312 Change-Id: I231d8cf01c05af01af319d56d5666c415f8b989b Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3913035 Reviewed-by: Igor Sheludko <ishell@chromium.org> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Commit-Queue: Jakob Kummerow <jkummerow@chromium.org> Cr-Commit-Position: refs/heads/main@{#83404} Refs: v8/v8@1b3a4f0
Cherry-picked all patches to nodejs/node#44741. |
Original commit message: [msvc] fix build with neon intrinsics This compilation error was found by NodeJS when updating V8: nodejs/node-v8#240 MSVC reports an error with "too many initializer" for type uint32x4_t. --- Under gcc/clang, this is a typedef to a builtin type. For MSVC, it is a typedef to this union: typedef union __n128 { unsigned __int64 n128_u64[2]; unsigned __int32 n128_u32[4]; ... } __n128; C++ mandates that only first member of union can be initialized at declaration. Thus, it can only be initialized with {uint64_t, uint64_t}. VS people proposed to use designated initializer instead: var = {.n128_u32={1, 2, 3, 8}} https://developercommunity.visualstudio.com/t/error-c2078-too-many-initializers-when-using-arm-n/402911 But, you need to use /std:c++20 for this, which is not the case in v8. --- Thus, the only solution is to implement a hack specifically for MSVC, where you build two uint64, from four uint32. --------------------------------------- Once solved, another error is reported: templated function extract_first_nonzero_index is specialized twice. This is because, with MSVC, uint32x4_t and uint64x2_t are typedef to the same __n128 union. The fix is to drop templates, and use explicit function names instead. Bug: v8:13312 Change-Id: I231d8cf01c05af01af319d56d5666c415f8b989b Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3913035 Reviewed-by: Igor Sheludko <ishell@chromium.org> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Commit-Queue: Jakob Kummerow <jkummerow@chromium.org> Cr-Commit-Position: refs/heads/main@{#83404} Refs: v8/v8@1b3a4f0
Original commit message: [msvc] fix build with neon intrinsics This compilation error was found by NodeJS when updating V8: #240 MSVC reports an error with "too many initializer" for type uint32x4_t. --- Under gcc/clang, this is a typedef to a builtin type. For MSVC, it is a typedef to this union: typedef union __n128 { unsigned __int64 n128_u64[2]; unsigned __int32 n128_u32[4]; ... } __n128; C++ mandates that only first member of union can be initialized at declaration. Thus, it can only be initialized with {uint64_t, uint64_t}. VS people proposed to use designated initializer instead: var = {.n128_u32={1, 2, 3, 8}} https://developercommunity.visualstudio.com/t/error-c2078-too-many-initializers-when-using-arm-n/402911 But, you need to use /std:c++20 for this, which is not the case in v8. --- Thus, the only solution is to implement a hack specifically for MSVC, where you build two uint64, from four uint32. --------------------------------------- Once solved, another error is reported: templated function extract_first_nonzero_index is specialized twice. This is because, with MSVC, uint32x4_t and uint64x2_t are typedef to the same __n128 union. The fix is to drop templates, and use explicit function names instead. Bug: v8:13312 Change-Id: I231d8cf01c05af01af319d56d5666c415f8b989b Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3913035 Reviewed-by: Igor Sheludko <ishell@chromium.org> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Commit-Queue: Jakob Kummerow <jkummerow@chromium.org> Cr-Commit-Position: refs/heads/main@{#83404} Refs: v8/v8@1b3a4f0
Original commit message: [msvc] fix build with neon intrinsics This compilation error was found by NodeJS when updating V8: #240 MSVC reports an error with "too many initializer" for type uint32x4_t. --- Under gcc/clang, this is a typedef to a builtin type. For MSVC, it is a typedef to this union: typedef union __n128 { unsigned __int64 n128_u64[2]; unsigned __int32 n128_u32[4]; ... } __n128; C++ mandates that only first member of union can be initialized at declaration. Thus, it can only be initialized with {uint64_t, uint64_t}. VS people proposed to use designated initializer instead: var = {.n128_u32={1, 2, 3, 8}} https://developercommunity.visualstudio.com/t/error-c2078-too-many-initializers-when-using-arm-n/402911 But, you need to use /std:c++20 for this, which is not the case in v8. --- Thus, the only solution is to implement a hack specifically for MSVC, where you build two uint64, from four uint32. --------------------------------------- Once solved, another error is reported: templated function extract_first_nonzero_index is specialized twice. This is because, with MSVC, uint32x4_t and uint64x2_t are typedef to the same __n128 union. The fix is to drop templates, and use explicit function names instead. Bug: v8:13312 Change-Id: I231d8cf01c05af01af319d56d5666c415f8b989b Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3913035 Reviewed-by: Igor Sheludko <ishell@chromium.org> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Commit-Queue: Jakob Kummerow <jkummerow@chromium.org> Cr-Commit-Position: refs/heads/main@{#83404} Refs: v8/v8@1b3a4f0
Original commit message: [msvc] fix build with neon intrinsics This compilation error was found by NodeJS when updating V8: nodejs/node-v8#240 MSVC reports an error with "too many initializer" for type uint32x4_t. --- Under gcc/clang, this is a typedef to a builtin type. For MSVC, it is a typedef to this union: typedef union __n128 { unsigned __int64 n128_u64[2]; unsigned __int32 n128_u32[4]; ... } __n128; C++ mandates that only first member of union can be initialized at declaration. Thus, it can only be initialized with {uint64_t, uint64_t}. VS people proposed to use designated initializer instead: var = {.n128_u32={1, 2, 3, 8}} https://developercommunity.visualstudio.com/t/error-c2078-too-many-initializers-when-using-arm-n/402911 But, you need to use /std:c++20 for this, which is not the case in v8. --- Thus, the only solution is to implement a hack specifically for MSVC, where you build two uint64, from four uint32. --------------------------------------- Once solved, another error is reported: templated function extract_first_nonzero_index is specialized twice. This is because, with MSVC, uint32x4_t and uint64x2_t are typedef to the same __n128 union. The fix is to drop templates, and use explicit function names instead. Bug: v8:13312 Change-Id: I231d8cf01c05af01af319d56d5666c415f8b989b Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3913035 Reviewed-by: Igor Sheludko <ishell@chromium.org> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Commit-Queue: Jakob Kummerow <jkummerow@chromium.org> Cr-Commit-Position: refs/heads/main@{#83404} Refs: v8/v8@1b3a4f0
Original commit message: [msvc] fix build with neon intrinsics This compilation error was found by NodeJS when updating V8: #240 MSVC reports an error with "too many initializer" for type uint32x4_t. --- Under gcc/clang, this is a typedef to a builtin type. For MSVC, it is a typedef to this union: typedef union __n128 { unsigned __int64 n128_u64[2]; unsigned __int32 n128_u32[4]; ... } __n128; C++ mandates that only first member of union can be initialized at declaration. Thus, it can only be initialized with {uint64_t, uint64_t}. VS people proposed to use designated initializer instead: var = {.n128_u32={1, 2, 3, 8}} https://developercommunity.visualstudio.com/t/error-c2078-too-many-initializers-when-using-arm-n/402911 But, you need to use /std:c++20 for this, which is not the case in v8. --- Thus, the only solution is to implement a hack specifically for MSVC, where you build two uint64, from four uint32. --------------------------------------- Once solved, another error is reported: templated function extract_first_nonzero_index is specialized twice. This is because, with MSVC, uint32x4_t and uint64x2_t are typedef to the same __n128 union. The fix is to drop templates, and use explicit function names instead. Bug: v8:13312 Change-Id: I231d8cf01c05af01af319d56d5666c415f8b989b Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3913035 Reviewed-by: Igor Sheludko <ishell@chromium.org> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Commit-Queue: Jakob Kummerow <jkummerow@chromium.org> Cr-Commit-Position: refs/heads/main@{#83404} Refs: v8/v8@1b3a4f0
Original commit message: [msvc] fix build with neon intrinsics This compilation error was found by NodeJS when updating V8: nodejs/node-v8#240 MSVC reports an error with "too many initializer" for type uint32x4_t. --- Under gcc/clang, this is a typedef to a builtin type. For MSVC, it is a typedef to this union: typedef union __n128 { unsigned __int64 n128_u64[2]; unsigned __int32 n128_u32[4]; ... } __n128; C++ mandates that only first member of union can be initialized at declaration. Thus, it can only be initialized with {uint64_t, uint64_t}. VS people proposed to use designated initializer instead: var = {.n128_u32={1, 2, 3, 8}} https://developercommunity.visualstudio.com/t/error-c2078-too-many-initializers-when-using-arm-n/402911 But, you need to use /std:c++20 for this, which is not the case in v8. --- Thus, the only solution is to implement a hack specifically for MSVC, where you build two uint64, from four uint32. --------------------------------------- Once solved, another error is reported: templated function extract_first_nonzero_index is specialized twice. This is because, with MSVC, uint32x4_t and uint64x2_t are typedef to the same __n128 union. The fix is to drop templates, and use explicit function names instead. Bug: v8:13312 Change-Id: I231d8cf01c05af01af319d56d5666c415f8b989b Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3913035 Reviewed-by: Igor Sheludko <ishell@chromium.org> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Commit-Queue: Jakob Kummerow <jkummerow@chromium.org> Cr-Commit-Position: refs/heads/main@{#83404} Refs: v8/v8@1b3a4f0
Original commit message: [msvc] fix build with neon intrinsics This compilation error was found by NodeJS when updating V8: #240 MSVC reports an error with "too many initializer" for type uint32x4_t. --- Under gcc/clang, this is a typedef to a builtin type. For MSVC, it is a typedef to this union: typedef union __n128 { unsigned __int64 n128_u64[2]; unsigned __int32 n128_u32[4]; ... } __n128; C++ mandates that only first member of union can be initialized at declaration. Thus, it can only be initialized with {uint64_t, uint64_t}. VS people proposed to use designated initializer instead: var = {.n128_u32={1, 2, 3, 8}} https://developercommunity.visualstudio.com/t/error-c2078-too-many-initializers-when-using-arm-n/402911 But, you need to use /std:c++20 for this, which is not the case in v8. --- Thus, the only solution is to implement a hack specifically for MSVC, where you build two uint64, from four uint32. --------------------------------------- Once solved, another error is reported: templated function extract_first_nonzero_index is specialized twice. This is because, with MSVC, uint32x4_t and uint64x2_t are typedef to the same __n128 union. The fix is to drop templates, and use explicit function names instead. Bug: v8:13312 Change-Id: I231d8cf01c05af01af319d56d5666c415f8b989b Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3913035 Reviewed-by: Igor Sheludko <ishell@chromium.org> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Commit-Queue: Jakob Kummerow <jkummerow@chromium.org> Cr-Commit-Position: refs/heads/main@{#83404} Refs: v8/v8@1b3a4f0
Original commit message: [msvc] fix build with neon intrinsics This compilation error was found by NodeJS when updating V8: #240 MSVC reports an error with "too many initializer" for type uint32x4_t. --- Under gcc/clang, this is a typedef to a builtin type. For MSVC, it is a typedef to this union: typedef union __n128 { unsigned __int64 n128_u64[2]; unsigned __int32 n128_u32[4]; ... } __n128; C++ mandates that only first member of union can be initialized at declaration. Thus, it can only be initialized with {uint64_t, uint64_t}. VS people proposed to use designated initializer instead: var = {.n128_u32={1, 2, 3, 8}} https://developercommunity.visualstudio.com/t/error-c2078-too-many-initializers-when-using-arm-n/402911 But, you need to use /std:c++20 for this, which is not the case in v8. --- Thus, the only solution is to implement a hack specifically for MSVC, where you build two uint64, from four uint32. --------------------------------------- Once solved, another error is reported: templated function extract_first_nonzero_index is specialized twice. This is because, with MSVC, uint32x4_t and uint64x2_t are typedef to the same __n128 union. The fix is to drop templates, and use explicit function names instead. Bug: v8:13312 Change-Id: I231d8cf01c05af01af319d56d5666c415f8b989b Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3913035 Reviewed-by: Igor Sheludko <ishell@chromium.org> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Commit-Queue: Jakob Kummerow <jkummerow@chromium.org> Cr-Commit-Position: refs/heads/main@{#83404} Refs: v8/v8@1b3a4f0
Original commit message: [msvc] fix build with neon intrinsics This compilation error was found by NodeJS when updating V8: #240 MSVC reports an error with "too many initializer" for type uint32x4_t. --- Under gcc/clang, this is a typedef to a builtin type. For MSVC, it is a typedef to this union: typedef union __n128 { unsigned __int64 n128_u64[2]; unsigned __int32 n128_u32[4]; ... } __n128; C++ mandates that only first member of union can be initialized at declaration. Thus, it can only be initialized with {uint64_t, uint64_t}. VS people proposed to use designated initializer instead: var = {.n128_u32={1, 2, 3, 8}} https://developercommunity.visualstudio.com/t/error-c2078-too-many-initializers-when-using-arm-n/402911 But, you need to use /std:c++20 for this, which is not the case in v8. --- Thus, the only solution is to implement a hack specifically for MSVC, where you build two uint64, from four uint32. --------------------------------------- Once solved, another error is reported: templated function extract_first_nonzero_index is specialized twice. This is because, with MSVC, uint32x4_t and uint64x2_t are typedef to the same __n128 union. The fix is to drop templates, and use explicit function names instead. Bug: v8:13312 Change-Id: I231d8cf01c05af01af319d56d5666c415f8b989b Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3913035 Reviewed-by: Igor Sheludko <ishell@chromium.org> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Commit-Queue: Jakob Kummerow <jkummerow@chromium.org> Cr-Commit-Position: refs/heads/main@{#83404} Refs: v8/v8@1b3a4f0
Original commit message: [msvc] fix build with neon intrinsics This compilation error was found by NodeJS when updating V8: #240 MSVC reports an error with "too many initializer" for type uint32x4_t. --- Under gcc/clang, this is a typedef to a builtin type. For MSVC, it is a typedef to this union: typedef union __n128 { unsigned __int64 n128_u64[2]; unsigned __int32 n128_u32[4]; ... } __n128; C++ mandates that only first member of union can be initialized at declaration. Thus, it can only be initialized with {uint64_t, uint64_t}. VS people proposed to use designated initializer instead: var = {.n128_u32={1, 2, 3, 8}} https://developercommunity.visualstudio.com/t/error-c2078-too-many-initializers-when-using-arm-n/402911 But, you need to use /std:c++20 for this, which is not the case in v8. --- Thus, the only solution is to implement a hack specifically for MSVC, where you build two uint64, from four uint32. --------------------------------------- Once solved, another error is reported: templated function extract_first_nonzero_index is specialized twice. This is because, with MSVC, uint32x4_t and uint64x2_t are typedef to the same __n128 union. The fix is to drop templates, and use explicit function names instead. Bug: v8:13312 Change-Id: I231d8cf01c05af01af319d56d5666c415f8b989b Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3913035 Reviewed-by: Igor Sheludko <ishell@chromium.org> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Commit-Queue: Jakob Kummerow <jkummerow@chromium.org> Cr-Commit-Position: refs/heads/main@{#83404} Refs: v8/v8@1b3a4f0
Original commit message: [msvc] fix build with neon intrinsics This compilation error was found by NodeJS when updating V8: #240 MSVC reports an error with "too many initializer" for type uint32x4_t. --- Under gcc/clang, this is a typedef to a builtin type. For MSVC, it is a typedef to this union: typedef union __n128 { unsigned __int64 n128_u64[2]; unsigned __int32 n128_u32[4]; ... } __n128; C++ mandates that only first member of union can be initialized at declaration. Thus, it can only be initialized with {uint64_t, uint64_t}. VS people proposed to use designated initializer instead: var = {.n128_u32={1, 2, 3, 8}} https://developercommunity.visualstudio.com/t/error-c2078-too-many-initializers-when-using-arm-n/402911 But, you need to use /std:c++20 for this, which is not the case in v8. --- Thus, the only solution is to implement a hack specifically for MSVC, where you build two uint64, from four uint32. --------------------------------------- Once solved, another error is reported: templated function extract_first_nonzero_index is specialized twice. This is because, with MSVC, uint32x4_t and uint64x2_t are typedef to the same __n128 union. The fix is to drop templates, and use explicit function names instead. Bug: v8:13312 Change-Id: I231d8cf01c05af01af319d56d5666c415f8b989b Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3913035 Reviewed-by: Igor Sheludko <ishell@chromium.org> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Commit-Queue: Jakob Kummerow <jkummerow@chromium.org> Cr-Commit-Position: refs/heads/main@{#83404} Refs: v8/v8@1b3a4f0
Original commit message: [msvc] fix build with neon intrinsics This compilation error was found by NodeJS when updating V8: nodejs/node-v8#240 MSVC reports an error with "too many initializer" for type uint32x4_t. --- Under gcc/clang, this is a typedef to a builtin type. For MSVC, it is a typedef to this union: typedef union __n128 { unsigned __int64 n128_u64[2]; unsigned __int32 n128_u32[4]; ... } __n128; C++ mandates that only first member of union can be initialized at declaration. Thus, it can only be initialized with {uint64_t, uint64_t}. VS people proposed to use designated initializer instead: var = {.n128_u32={1, 2, 3, 8}} https://developercommunity.visualstudio.com/t/error-c2078-too-many-initializers-when-using-arm-n/402911 But, you need to use /std:c++20 for this, which is not the case in v8. --- Thus, the only solution is to implement a hack specifically for MSVC, where you build two uint64, from four uint32. --------------------------------------- Once solved, another error is reported: templated function extract_first_nonzero_index is specialized twice. This is because, with MSVC, uint32x4_t and uint64x2_t are typedef to the same __n128 union. The fix is to drop templates, and use explicit function names instead. Bug: v8:13312 Change-Id: I231d8cf01c05af01af319d56d5666c415f8b989b Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3913035 Reviewed-by: Igor Sheludko <ishell@chromium.org> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Commit-Queue: Jakob Kummerow <jkummerow@chromium.org> Cr-Commit-Position: refs/heads/main@{#83404} Refs: v8/v8@1b3a4f0
Original commit message: [msvc] fix build with neon intrinsics This compilation error was found by NodeJS when updating V8: nodejs/node-v8#240 MSVC reports an error with "too many initializer" for type uint32x4_t. --- Under gcc/clang, this is a typedef to a builtin type. For MSVC, it is a typedef to this union: typedef union __n128 { unsigned __int64 n128_u64[2]; unsigned __int32 n128_u32[4]; ... } __n128; C++ mandates that only first member of union can be initialized at declaration. Thus, it can only be initialized with {uint64_t, uint64_t}. VS people proposed to use designated initializer instead: var = {.n128_u32={1, 2, 3, 8}} https://developercommunity.visualstudio.com/t/error-c2078-too-many-initializers-when-using-arm-n/402911 But, you need to use /std:c++20 for this, which is not the case in v8. --- Thus, the only solution is to implement a hack specifically for MSVC, where you build two uint64, from four uint32. --------------------------------------- Once solved, another error is reported: templated function extract_first_nonzero_index is specialized twice. This is because, with MSVC, uint32x4_t and uint64x2_t are typedef to the same __n128 union. The fix is to drop templates, and use explicit function names instead. Bug: v8:13312 Change-Id: I231d8cf01c05af01af319d56d5666c415f8b989b Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3913035 Reviewed-by: Igor Sheludko <ishell@chromium.org> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Commit-Queue: Jakob Kummerow <jkummerow@chromium.org> Cr-Commit-Position: refs/heads/main@{#83404} Refs: v8/v8@1b3a4f0
Original commit message: [msvc] fix build with neon intrinsics This compilation error was found by NodeJS when updating V8: #240 MSVC reports an error with "too many initializer" for type uint32x4_t. --- Under gcc/clang, this is a typedef to a builtin type. For MSVC, it is a typedef to this union: typedef union __n128 { unsigned __int64 n128_u64[2]; unsigned __int32 n128_u32[4]; ... } __n128; C++ mandates that only first member of union can be initialized at declaration. Thus, it can only be initialized with {uint64_t, uint64_t}. VS people proposed to use designated initializer instead: var = {.n128_u32={1, 2, 3, 8}} https://developercommunity.visualstudio.com/t/error-c2078-too-many-initializers-when-using-arm-n/402911 But, you need to use /std:c++20 for this, which is not the case in v8. --- Thus, the only solution is to implement a hack specifically for MSVC, where you build two uint64, from four uint32. --------------------------------------- Once solved, another error is reported: templated function extract_first_nonzero_index is specialized twice. This is because, with MSVC, uint32x4_t and uint64x2_t are typedef to the same __n128 union. The fix is to drop templates, and use explicit function names instead. Bug: v8:13312 Change-Id: I231d8cf01c05af01af319d56d5666c415f8b989b Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3913035 Reviewed-by: Igor Sheludko <ishell@chromium.org> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Commit-Queue: Jakob Kummerow <jkummerow@chromium.org> Cr-Commit-Position: refs/heads/main@{#83404} Refs: v8/v8@1b3a4f0
Original commit message: [msvc] fix build with neon intrinsics This compilation error was found by NodeJS when updating V8: #240 MSVC reports an error with "too many initializer" for type uint32x4_t. --- Under gcc/clang, this is a typedef to a builtin type. For MSVC, it is a typedef to this union: typedef union __n128 { unsigned __int64 n128_u64[2]; unsigned __int32 n128_u32[4]; ... } __n128; C++ mandates that only first member of union can be initialized at declaration. Thus, it can only be initialized with {uint64_t, uint64_t}. VS people proposed to use designated initializer instead: var = {.n128_u32={1, 2, 3, 8}} https://developercommunity.visualstudio.com/t/error-c2078-too-many-initializers-when-using-arm-n/402911 But, you need to use /std:c++20 for this, which is not the case in v8. --- Thus, the only solution is to implement a hack specifically for MSVC, where you build two uint64, from four uint32. --------------------------------------- Once solved, another error is reported: templated function extract_first_nonzero_index is specialized twice. This is because, with MSVC, uint32x4_t and uint64x2_t are typedef to the same __n128 union. The fix is to drop templates, and use explicit function names instead. Bug: v8:13312 Change-Id: I231d8cf01c05af01af319d56d5666c415f8b989b Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3913035 Reviewed-by: Igor Sheludko <ishell@chromium.org> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Commit-Queue: Jakob Kummerow <jkummerow@chromium.org> Cr-Commit-Position: refs/heads/main@{#83404} Refs: v8/v8@1b3a4f0
Original commit message: [msvc] fix build with neon intrinsics This compilation error was found by NodeJS when updating V8: #240 MSVC reports an error with "too many initializer" for type uint32x4_t. --- Under gcc/clang, this is a typedef to a builtin type. For MSVC, it is a typedef to this union: typedef union __n128 { unsigned __int64 n128_u64[2]; unsigned __int32 n128_u32[4]; ... } __n128; C++ mandates that only first member of union can be initialized at declaration. Thus, it can only be initialized with {uint64_t, uint64_t}. VS people proposed to use designated initializer instead: var = {.n128_u32={1, 2, 3, 8}} https://developercommunity.visualstudio.com/t/error-c2078-too-many-initializers-when-using-arm-n/402911 But, you need to use /std:c++20 for this, which is not the case in v8. --- Thus, the only solution is to implement a hack specifically for MSVC, where you build two uint64, from four uint32. --------------------------------------- Once solved, another error is reported: templated function extract_first_nonzero_index is specialized twice. This is because, with MSVC, uint32x4_t and uint64x2_t are typedef to the same __n128 union. The fix is to drop templates, and use explicit function names instead. Bug: v8:13312 Change-Id: I231d8cf01c05af01af319d56d5666c415f8b989b Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3913035 Reviewed-by: Igor Sheludko <ishell@chromium.org> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Commit-Queue: Jakob Kummerow <jkummerow@chromium.org> Cr-Commit-Position: refs/heads/main@{#83404} Refs: v8/v8@1b3a4f0
Original commit message: [msvc] fix build with neon intrinsics This compilation error was found by NodeJS when updating V8: #240 MSVC reports an error with "too many initializer" for type uint32x4_t. --- Under gcc/clang, this is a typedef to a builtin type. For MSVC, it is a typedef to this union: typedef union __n128 { unsigned __int64 n128_u64[2]; unsigned __int32 n128_u32[4]; ... } __n128; C++ mandates that only first member of union can be initialized at declaration. Thus, it can only be initialized with {uint64_t, uint64_t}. VS people proposed to use designated initializer instead: var = {.n128_u32={1, 2, 3, 8}} https://developercommunity.visualstudio.com/t/error-c2078-too-many-initializers-when-using-arm-n/402911 But, you need to use /std:c++20 for this, which is not the case in v8. --- Thus, the only solution is to implement a hack specifically for MSVC, where you build two uint64, from four uint32. --------------------------------------- Once solved, another error is reported: templated function extract_first_nonzero_index is specialized twice. This is because, with MSVC, uint32x4_t and uint64x2_t are typedef to the same __n128 union. The fix is to drop templates, and use explicit function names instead. Bug: v8:13312 Change-Id: I231d8cf01c05af01af319d56d5666c415f8b989b Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3913035 Reviewed-by: Igor Sheludko <ishell@chromium.org> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Commit-Queue: Jakob Kummerow <jkummerow@chromium.org> Cr-Commit-Position: refs/heads/main@{#83404} Refs: v8/v8@1b3a4f0
Original commit message: [msvc] fix build with neon intrinsics This compilation error was found by NodeJS when updating V8: #240 MSVC reports an error with "too many initializer" for type uint32x4_t. --- Under gcc/clang, this is a typedef to a builtin type. For MSVC, it is a typedef to this union: typedef union __n128 { unsigned __int64 n128_u64[2]; unsigned __int32 n128_u32[4]; ... } __n128; C++ mandates that only first member of union can be initialized at declaration. Thus, it can only be initialized with {uint64_t, uint64_t}. VS people proposed to use designated initializer instead: var = {.n128_u32={1, 2, 3, 8}} https://developercommunity.visualstudio.com/t/error-c2078-too-many-initializers-when-using-arm-n/402911 But, you need to use /std:c++20 for this, which is not the case in v8. --- Thus, the only solution is to implement a hack specifically for MSVC, where you build two uint64, from four uint32. --------------------------------------- Once solved, another error is reported: templated function extract_first_nonzero_index is specialized twice. This is because, with MSVC, uint32x4_t and uint64x2_t are typedef to the same __n128 union. The fix is to drop templates, and use explicit function names instead. Bug: v8:13312 Change-Id: I231d8cf01c05af01af319d56d5666c415f8b989b Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3913035 Reviewed-by: Igor Sheludko <ishell@chromium.org> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Commit-Queue: Jakob Kummerow <jkummerow@chromium.org> Cr-Commit-Position: refs/heads/main@{#83404} Refs: v8/v8@1b3a4f0
Original commit message: [msvc] fix build with neon intrinsics This compilation error was found by NodeJS when updating V8: #240 MSVC reports an error with "too many initializer" for type uint32x4_t. --- Under gcc/clang, this is a typedef to a builtin type. For MSVC, it is a typedef to this union: typedef union __n128 { unsigned __int64 n128_u64[2]; unsigned __int32 n128_u32[4]; ... } __n128; C++ mandates that only first member of union can be initialized at declaration. Thus, it can only be initialized with {uint64_t, uint64_t}. VS people proposed to use designated initializer instead: var = {.n128_u32={1, 2, 3, 8}} https://developercommunity.visualstudio.com/t/error-c2078-too-many-initializers-when-using-arm-n/402911 But, you need to use /std:c++20 for this, which is not the case in v8. --- Thus, the only solution is to implement a hack specifically for MSVC, where you build two uint64, from four uint32. --------------------------------------- Once solved, another error is reported: templated function extract_first_nonzero_index is specialized twice. This is because, with MSVC, uint32x4_t and uint64x2_t are typedef to the same __n128 union. The fix is to drop templates, and use explicit function names instead. Bug: v8:13312 Change-Id: I231d8cf01c05af01af319d56d5666c415f8b989b Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3913035 Reviewed-by: Igor Sheludko <ishell@chromium.org> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Commit-Queue: Jakob Kummerow <jkummerow@chromium.org> Cr-Commit-Position: refs/heads/main@{#83404} Refs: v8/v8@1b3a4f0
Original commit message: [msvc] fix build with neon intrinsics This compilation error was found by NodeJS when updating V8: #240 MSVC reports an error with "too many initializer" for type uint32x4_t. --- Under gcc/clang, this is a typedef to a builtin type. For MSVC, it is a typedef to this union: typedef union __n128 { unsigned __int64 n128_u64[2]; unsigned __int32 n128_u32[4]; ... } __n128; C++ mandates that only first member of union can be initialized at declaration. Thus, it can only be initialized with {uint64_t, uint64_t}. VS people proposed to use designated initializer instead: var = {.n128_u32={1, 2, 3, 8}} https://developercommunity.visualstudio.com/t/error-c2078-too-many-initializers-when-using-arm-n/402911 But, you need to use /std:c++20 for this, which is not the case in v8. --- Thus, the only solution is to implement a hack specifically for MSVC, where you build two uint64, from four uint32. --------------------------------------- Once solved, another error is reported: templated function extract_first_nonzero_index is specialized twice. This is because, with MSVC, uint32x4_t and uint64x2_t are typedef to the same __n128 union. The fix is to drop templates, and use explicit function names instead. Bug: v8:13312 Change-Id: I231d8cf01c05af01af319d56d5666c415f8b989b Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3913035 Reviewed-by: Igor Sheludko <ishell@chromium.org> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Commit-Queue: Jakob Kummerow <jkummerow@chromium.org> Cr-Commit-Position: refs/heads/main@{#83404} Refs: v8/v8@1b3a4f0
Original commit message: [msvc] fix build with neon intrinsics This compilation error was found by NodeJS when updating V8: nodejs/node-v8#240 MSVC reports an error with "too many initializer" for type uint32x4_t. --- Under gcc/clang, this is a typedef to a builtin type. For MSVC, it is a typedef to this union: typedef union __n128 { unsigned __int64 n128_u64[2]; unsigned __int32 n128_u32[4]; ... } __n128; C++ mandates that only first member of union can be initialized at declaration. Thus, it can only be initialized with {uint64_t, uint64_t}. VS people proposed to use designated initializer instead: var = {.n128_u32={1, 2, 3, 8}} https://developercommunity.visualstudio.com/t/error-c2078-too-many-initializers-when-using-arm-n/402911 But, you need to use /std:c++20 for this, which is not the case in v8. --- Thus, the only solution is to implement a hack specifically for MSVC, where you build two uint64, from four uint32. --------------------------------------- Once solved, another error is reported: templated function extract_first_nonzero_index is specialized twice. This is because, with MSVC, uint32x4_t and uint64x2_t are typedef to the same __n128 union. The fix is to drop templates, and use explicit function names instead. Bug: v8:13312 Change-Id: I231d8cf01c05af01af319d56d5666c415f8b989b Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3913035 Reviewed-by: Igor Sheludko <ishell@chromium.org> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Commit-Queue: Jakob Kummerow <jkummerow@chromium.org> Cr-Commit-Position: refs/heads/main@{#83404} Refs: v8/v8@1b3a4f0
Original commit message: [msvc] fix build with neon intrinsics This compilation error was found by NodeJS when updating V8: nodejs/node-v8#240 MSVC reports an error with "too many initializer" for type uint32x4_t. --- Under gcc/clang, this is a typedef to a builtin type. For MSVC, it is a typedef to this union: typedef union __n128 { unsigned __int64 n128_u64[2]; unsigned __int32 n128_u32[4]; ... } __n128; C++ mandates that only first member of union can be initialized at declaration. Thus, it can only be initialized with {uint64_t, uint64_t}. VS people proposed to use designated initializer instead: var = {.n128_u32={1, 2, 3, 8}} https://developercommunity.visualstudio.com/t/error-c2078-too-many-initializers-when-using-arm-n/402911 But, you need to use /std:c++20 for this, which is not the case in v8. --- Thus, the only solution is to implement a hack specifically for MSVC, where you build two uint64, from four uint32. --------------------------------------- Once solved, another error is reported: templated function extract_first_nonzero_index is specialized twice. This is because, with MSVC, uint32x4_t and uint64x2_t are typedef to the same __n128 union. The fix is to drop templates, and use explicit function names instead. Bug: v8:13312 Change-Id: I231d8cf01c05af01af319d56d5666c415f8b989b Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3913035 Reviewed-by: Igor Sheludko <ishell@chromium.org> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Commit-Queue: Jakob Kummerow <jkummerow@chromium.org> Cr-Commit-Position: refs/heads/main@{#83404} Refs: v8/v8@1b3a4f0 PR-URL: #44741 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
https://ci.nodejs.org/job/node-compile-windows/46957/nodes=win-vs2019-arm64/console
The text was updated successfully, but these errors were encountered: