V8 v10.4.132.8 - OSX compile error

70 views
Skip to first unread message

Angelo Dell'Aera

unread,
Jun 20, 2022, 8:32:51 AM6/20/22
to v8-dev

Just wanted to report that I observed the following error while compiling 
V8 v10.4.132.8 on OSX platform. The error is NOT reproducible on Linux.

Ciao,
Angelo

[1401/1848] CXX obj/v8_base_without_compiler/simd.o
FAILED: obj/v8_base_without_compiler/simd.o
../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/v8_base_without_compiler/simd.o.d -DDCHECK_ALWAYS_ON=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_LIBCPP_HAS_NO_ALIGNED_ALLOCATION -DCR_XCODE_VERSION=1240 -DCR_CLANG_REVISION=\"llvmorg-15-init-11722-g3f3a235a-2\" -D__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES=0 -D_DEBUG -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DCPPGC_VERIFY_HEAP -DV8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=64 -DENABLE_GDB_JIT_INTERFACE -DOBJECT_PRINT -DVERIFY_HEAP -DV8_TRACE_MAPS -DV8_ENABLE_ALLOCATION_TIMEOUT -DV8_ENABLE_FORCE_SLOW_PATH -DV8_ENABLE_DOUBLE_CONST_STORE_CHECK -DV8_INTL_SUPPORT -DENABLE_HANDLE_ZAPPING -DV8_CODE_COMMENTS -DV8_ENABLE_DEBUG_CODE -DV8_ENABLE_HEAP_SNAPSHOT_VERIFY -DV8_SNAPSHOT_NATIVE_CODE_COUNTERS -DV8_ATOMIC_OBJECT_FIELD_WRITES -DV8_ENABLE_LAZY_SOURCE_POSITIONS -DV8_SHARED_RO_HEAP -DV8_WIN64_UNWINDING_INFO -DV8_ENABLE_REGEXP_INTERPRETER_THREADED_DISPATCH -DV8_SHORT_BUILTIN_CALLS -DV8_ENABLE_SYSTEM_INSTRUMENTATION -DV8_ENABLE_WEBASSEMBLY -DV8_ALLOCATION_FOLDING -DV8_ALLOCATION_SITE_TRACKING -DV8_ADVANCED_BIGINT_ALGORITHMS -DV8_ENABLE_CHECKS -DV8_DEPRECATION_WARNINGS -DV8_IMMINENT_DEPRECATION_WARNINGS -DCPPGC_CAGED_HEAP -DCPPGC_YOUNG_GENERATION -DV8_TARGET_ARCH_X64 -DV8_HAVE_TARGET_OS -DV8_TARGET_OS_MACOS -DDEBUG -DU_USING_ICU_NAMESPACE=0 -DU_ENABLE_DYLOAD=0 -DUSE_CHROMIUM_ICU=1 -DU_ENABLE_TRACING=1 -DU_ENABLE_RESOURCE_TRACING=0 -DU_STATIC_IMPLEMENTATION -DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE -I../.. -Igen -I../../include -Igen/include -I../../third_party/icu/source/common -I../../third_party/icu/source/i18n -I../../third_party/zlib -Wall -Wextra -Wimplicit-fallthrough -Wunreachable-code-aggressive -Wthread-safety -Wunguarded-availability -Wno-missing-field-initializers -Wno-unused-parameter -Wloop-analysis -Wno-unneeded-internal-declaration -Wenum-compare-conditional -Wno-psabi -Wno-ignored-pragma-optimize -Wno-unqualified-std-cast-call -Xclang -no-opaque-pointers -Wshadow -fno-delete-null-pointer-checks -fno-ident -fno-strict-aliasing -fstack-protector-strong -fcolor-diagnostics -fmerge-all-constants -fcrash-diagnostics-dir=../../tools/clang/crashreports -mllvm -instcombine-lower-dbg-declare=0 -ffp-contract=off -arch x86_64 -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -ffile-compilation-dir=. -no-canonical-prefixes -ftrivial-auto-var-init=pattern -fno-omit-frame-pointer -g2 -gdwarf-aranges -Xclang -debug-info-kind=limited -isysroot ../../../../../../../../Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -mmacosx-version-min=10.13 -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wmissing-field-initializers -Wno-shadow -Wunreachable-code -Wshorten-64-to-32 -O3 -fvisibility=default -Wexit-time-destructors -Wno-undefined-bool-conversion -Wno-tautological-undefined-compare -std=c++17 -Wno-trigraphs -fno-aligned-new -fno-exceptions -fno-rtti -c ../../src/objects/simd.cc -o obj/v8_base_without_compiler/simd.o
../../src/objects/simd.cc:246:3: error: static_assert failed due to requirement 'std::is_same<unsigned long, unsigned int>::value || std::is_same<unsigned long, unsigned long long>::value || std::is_same<unsigned long, double>::value'
static_assert(std::is_same<T, uint32_t>::value ||
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../src/objects/simd.cc:315:12: note: in instantiation of function template specialization 'v8::internal::(anonymous namespace)::fast_search_avx<unsigned long>' requested here
return fast_search_avx(array, array_len, index, search_element);
^
../../src/objects/simd.cc:380:12: note: in instantiation of function template specialization 'v8::internal::(anonymous namespace)::search<unsigned long>' requested here
return search<Tagged_t>(array, array_len, from_index,
^
../../src/objects/simd.cc:391:10: note: in instantiation of function template specialization 'v8::internal::(anonymous namespace)::ArrayIndexOfIncludes<v8::internal::(anonymous namespace)::ArrayIndexOfIncludesKind::OBJECTORSMI>' requested here
return ArrayIndexOfIncludes<ArrayIndexOfIncludesKind::OBJECTORSMI>(
^
../../src/objects/simd.cc:154:3: error: static_assert failed due to requirement 'std::is_same<unsigned long, unsigned int>::value || std::is_same<unsigned long, unsigned long long>::value || std::is_same<unsigned long, double>::value'
static_assert(std::is_same<T, uint32_t>::value ||
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../src/objects/simd.cc:317:12: note: in instantiation of function template specialization 'v8::internal::(anonymous namespace)::fast_search_noavx<unsigned long>' requested here
return fast_search_noavx(array, array_len, index, search_element);
^
../../src/objects/simd.cc:380:12: note: in instantiation of function template specialization 'v8::internal::(anonymous namespace)::search<unsigned long>' requested here
return search<Tagged_t>(array, array_len, from_index,
^
../../src/objects/simd.cc:391:10: note: in instantiation of function template specialization 'v8::internal::(anonymous namespace)::ArrayIndexOfIncludes<v8::internal::(anonymous namespace)::ArrayIndexOfIncludesKind::OBJECTORSMI>' requested here
return ArrayIndexOfIncludes<ArrayIndexOfIncludesKind::OBJECTORSMI>(
^
2 errors generated.

Maddie Zhan

unread,
Jul 27, 2022, 3:50:24 AM7/27/22
to v8-dev
Hit the same error on both Intel and M1 Mac running macOS Monterey 12.4, with XCode 13.3.

Compiling V8 v10.4.132.20, the same codebase compiled just fine for Linux and Windows.

[513/1352] CXX obj/v8_base_without_compiler/simd.o
FAILED: obj/v8_base_without_compiler/simd.o
../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/v8_base_without_compiler/simd.o.d -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FORTIFY_SOURCE=2 -D_LIBCPP_HAS_NO_ALIGNED_ALLOCATION -DCR_XCODE_VERSION=1330 -DCR_CLANG_REVISION=\"llvmorg-15-init-11722-g3f3a235a-2\" -D__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES=0 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DV8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=64 -DENABLE_GDB_JIT_INTERFACE -DV8_ATOMIC_OBJECT_FIELD_WRITES -DV8_ENABLE_LAZY_SOURCE_POSITIONS -DV8_SHARED_RO_HEAP -DV8_WIN64_UNWINDING_INFO -DV8_ENABLE_REGEXP_INTERPRETER_THREADED_DISPATCH -DV8_SHORT_BUILTIN_CALLS -DV8_ENABLE_SYSTEM_INSTRUMENTATION -DV8_ENABLE_WEBASSEMBLY -DV8_ALLOCATION_FOLDING -DV8_ALLOCATION_SITE_TRACKING -DV8_ADVANCED_BIGINT_ALGORITHMS -DV8_DEPRECATION_WARNINGS -DV8_IMMINENT_DEPRECATION_WARNINGS -DCPPGC_CAGED_HEAP -DCPPGC_YOUNG_GENERATION -DV8_TARGET_ARCH_X64 -DV8_HAVE_TARGET_OS -DV8_TARGET_OS_MACOS -I../.. -Igen -I../../include -Igen/include -I../../third_party/zlib -Wall -Werror -Wextra -Wimplicit-fallthrough -Wunreachable-code-aggressive -Wthread-safety -Wunguarded-availability -Wno-missing-field-initializers -Wno-unused-parameter -Wloop-analysis -Wno-unneeded-internal-declaration -Wenum-compare-conditional -Wno-psabi -Wno-ignored-pragma-optimize -Wno-unqualified-std-cast-call -Xclang -no-opaque-pointers -Wshadow -fno-delete-null-pointer-checks -fno-ident -fno-strict-aliasing -fstack-protector -fcolor-diagnostics -fmerge-all-constants -fcrash-diagnostics-dir=../../tools/clang/crashreports -mllvm -instcombine-lower-dbg-declare=0 -ffp-contract=off -arch x86_64 -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -ffile-compilation-dir=. -no-canonical-prefixes -fno-omit-frame-pointer -g0 -isysroot ../../../../../../../Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -mmacosx-version-min=10.13 -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wmissing-field-initializers -Wno-shadow -Wunreachable-code -Wshorten-64-to-32 -O3 -fvisibility=default -Wexit-time-destructors -std=c++17 -Wno-trigraphs -fno-aligned-new -fno-excepti

Sam Cao

unread,
Jul 27, 2022, 4:32:52 AM7/27/22
to v8-dev
Hi Angelo and Maddie,

The root cause is unsigned long is missed the static_assert. Here is the git patch for your reference. I just had it built successfully.

--- a/src/objects/simd.cc
+++ b/src/objects/simd.cc
@@ -153,6 +153,7 @@ inline uintptr_t fast_search_noavx(T* array, uintptr_t array_len,
                                    uintptr_t index, T search_element) {

   static_assert(std::is_same<T, uint32_t>::value ||
                 std::is_same<T, uint64_t>::value ||
+                std::is_same<T, unsigned long>::value ||
                 std::is_same<T, double>::value);
 
 #if !(defined(__SSE3__) || defined(NEON64))
@@ -245,6 +246,7 @@ TARGET_AVX2 inline uintptr_t fast_search_avx(T* array, uintptr_t array_len,
                                              T search_element) {

   static_assert(std::is_same<T, uint32_t>::value ||
                 std::is_same<T, uint64_t>::value ||
+                std::is_same<T, unsigned long>::value ||
                 std::is_same<T, double>::value);
 
   const int target_align = 32;


Cheers,
Sam

Angelo Dell'Aera

unread,
Jul 28, 2022, 9:45:25 AM7/28/22
to v8-dev

It seems like the bug was fixed in branch 10.5 by this patch [1]. 

I was able to successfully compile branch 10.5 on both Linux and MacOS. And I suppose 
the patch will be back-ported to branch 10.4 sooner or later.
Reply all
Reply to author
Forward
0 new messages