Bug 244758

Summary: JSC fails to compile with clang 15 and libc++
Product: WebKit Reporter: Khem Raj <raj.khem>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: mark.lam, webkit-bug-importer, ysuzuki
Priority: P3 Keywords: Gtk, InRadar
Version: WebKit Nightly Build   
Hardware: PC   
OS: Linux   

Khem Raj
Reported 2022-09-03 02:19:42 PDT
With upcoming clang-15 and libc++ runtime, I am seeing a build failure in JSC, with clang-14 and libc++ it works ok. | In file included from /mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/webkitgtk/2.36.7-r0/build/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-3a3c4ec0-3.cpp:1: | In file included from /mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/webkitgtk/2.36.7-r0/webkitgtk-2.36.7/Source/JavaScriptCore/jit/JIT.cpp:26: | In file included from /mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/webkitgtk/2.36.7-r0/webkitgtk-2.36.7/Source/JavaScriptCore/config.h:38: | In file included from /mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/webkitgtk/2.36.7-r0/build/WTF/Headers/wtf/FastMalloc.h:26: | In file included from /mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/webkitgtk/2.36.7-r0/build/WTF/Headers/wtf/StdLibExtras.h:30: | In file included from /mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/webkitgtk/2.36.7-r0/recipe-sysroot/usr/include/c++/v1/memory:842: | In file included from /mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/webkitgtk/2.36.7-r0/recipe-sysroot/usr/include/c++/v1/__algorithm/move.h:12: | /mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/webkitgtk/2.36.7-r0/recipe-sysroot/usr/include/c++/v1/__algorithm/iterator_operations.h:100:5: error: static assertion failed due to requirement 'is_same<JSC::UnlinkedCallLinkInfo &, con st JSC::UnlinkedCallLinkInfo &>::value': It looks like your iterator's `iterator_traits<It>::reference` does not match the return type of dereferencing the iterator, i.e., calling `*it`. This is undefined behavior according to [input.iterators] and can lead to dangling reference issues at runtime, so we are flagging this. | static_assert(is_same<__deref_t<_Iter>, typename iterator_traits<__uncvref_t<_Iter> >::reference>::value, | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | /mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/webkitgtk/2.36.7-r0/recipe-sysroot/usr/include/c++/v1/__algorithm/iterator_operations.h:115:5: note: in instantiation of function template specialization 'std::_IterOps<std::_ClassicAlgP olicy>::__validate_iter_reference<WTF::SegmentedVectorIterator<JSC::UnlinkedCallLinkInfo, 8> &>' requested here | __validate_iter_reference<_Iter>(); | ^ | /mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/webkitgtk/2.36.7-r0/recipe-sysroot/usr/include/c++/v1/__algorithm/move.h:34:39: note: in instantiation of function template specialization 'std::_IterOps<std::_ClassicAlgPolicy>::__iter_ move<WTF::SegmentedVectorIterator<JSC::UnlinkedCallLinkInfo, 8> &>' requested here | *__result = _IterOps<_AlgPolicy>::__iter_move(__first); | ^ | /mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/webkitgtk/2.36.7-r0/recipe-sysroot/usr/include/c++/v1/__algorithm/move.h:97:21: note: in instantiation of function template specialization 'std::__move_impl<std::_ClassicAlgPolicy, WTF:: SegmentedVectorIterator<JSC::UnlinkedCallLinkInfo, 8>, WTF::SegmentedVectorIterator<JSC::UnlinkedCallLinkInfo, 8>, JSC::UnlinkedCallLinkInfo *>' requested here | auto __ret = std::__move_impl<_AlgPolicy>( | ^ | /mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/webkitgtk/2.36.7-r0/recipe-sysroot/usr/include/c++/v1/__algorithm/move.h:114:15: note: in instantiation of function template specialization 'std::__move<std::_ClassicAlgPolicy, WTF::Segm entedVectorIterator<JSC::UnlinkedCallLinkInfo, 8>, WTF::SegmentedVectorIterator<JSC::UnlinkedCallLinkInfo, 8>, JSC::UnlinkedCallLinkInfo *>' requested here | return std::__move<_ClassicAlgPolicy>(__first, __last, __result).second; | ^ | /mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/webkitgtk/2.36.7-r0/webkitgtk-2.36.7/Source/JavaScriptCore/jit/JIT.cpp:993:14: note: in instantiation of function template specialization 'std::__1::move<WTF::SegmentedVectorIterator<JSC ::UnlinkedCallLinkInfo, 8>, JSC::UnlinkedCallLinkInfo *>' requested here | std::move(m_unlinkedCalls.begin(), m_unlinkedCalls.end(), m_jitCode->m_unlinkedCalls.begin()); | ^
Attachments
Khem Raj
Comment 1 2022-09-03 02:28:18 PDT
here is where the error originates | /mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/webkitgtk/2.36.7-r0/webkitgtk-2.36.7/Source/JavaScriptCore/jit/JIT.cpp:993:14: note: in instantiation of function template specialization 'std::__1::move<WTF::SegmentedVectorIterator<JSC ::UnlinkedCallLinkInfo, 8>, JSC::UnlinkedCallLinkInfo *>' requested here | std::move(m_unlinkedCalls.begin(), m_unlinkedCalls.end(), m_jitCode->m_unlinkedCalls.begin()); | ^ /mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/webkitgtk/2.36.7-r0/webkitgtk-2.36.7/Source/JavaScriptCore/jit/JIT.cpp:996:14: note: in instantiation of function template specialization 'std::__1::move<WTF::SegmentedVectorIterator<JSC ::UnlinkedStructureStubInfo, 8>, JSC::UnlinkedStructureStubInfo *>' requested here | std::move(m_unlinkedStubInfos.begin(), m_unlinkedStubInfos.end(), m_jitCode->m_unlinkedStubInfos.begin()); | ^
Khem Raj
Comment 2 2022-09-03 21:08:16 PDT
Full log is here http://sprunge.us/SUk8No
Radar WebKit Bug Importer
Comment 3 2022-09-10 02:20:22 PDT
Mark Lam
Comment 4 2022-09-19 21:47:17 PDT
*** This bug has been marked as a duplicate of bug 245183 ***
Note You need to log in before you can comment on or make changes to this bug.