Skip to content
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

2024.3 Build Failure #5904

Open
ewhac opened this issue Dec 4, 2024 · 1 comment
Open

2024.3 Build Failure #5904

ewhac opened this issue Dec 4, 2024 · 1 comment

Comments

@ewhac
Copy link

ewhac commented Dec 4, 2024

  • Git revision 0cfe9e721.
  • GCC version 12.4.0. ("We only test against GCC 9." Yeah, I saw that, but GCC is at v14 now, which is even pickier than GCC 12, so you still might want to put a pin in this one.)

spirv-tools is compiled as part of Yocto's "Quick Build" example (MACHINE="genericx86_64"). The build konks out trying to compile source/val/function.cpp with the following error:

/home/ewhac/devel/yoc-generic/poky/build/tmp/hosttools/g++ -DSPIRV_COLOR_TERMINAL -DSPIRV_LINUX -DSPIRV_TIMER_ENABLED -DSPIRV_Tools_EXPORTS -I/home/ewhac/devel/yoc-generic/poky/build/tmp/work/x86_64-linux/spirv-tools-native/1.3.290.0/git -I/home/ewhac/devel/yoc-generic/poky/build/tmp/work/x86_64-linux/spirv-tools-native/1.3.290.0/git/include -I/home/ewhac/devel/yoc-generic/poky/build/tmp/work/x86_64-linux/spirv-tools-native/1.3.290.0/build -isystem/home/ewhac/devel/yoc-generic/poky/build/tmp/work/x86_64-linux/spirv-tools-native/1.3.290.0/recipe-sysroot-native/usr/include -O2 -pipe -fvisibility-inlines-hidden -g -std=c++17 -fPIC -DSPIRV_CHECK_CONTEXT -fno-rtti -Wall -Wextra -Wnon-virtual-dtor -Wno-missing-field-initializers -Werror -Wno-long-long -Wshadow -Wundef -Wconversion -Wno-sign-conversion -fno-exceptions -MD -MT source/CMakeFiles/SPIRV-Tools.dir/val/function.cpp.o -MF source/CMakeFiles/SPIRV-Tools.dir/val/function.cpp.o.d -o source/CMakeFiles/SPIRV-Tools.dir/val/function.cpp.o -c /home/ewhac/devel/yoc-generic/poky/build/tmp/work/x86_64-linux/spirv-tools-native/1.3.290.0/git/source/val/function.cpp
In file included from /usr/include/c++/12/bits/hashtable_policy.h:35,
                 from /usr/include/c++/12/bits/hashtable.h:35,
                 from /usr/include/c++/12/unordered_map:46,
                 from /usr/include/c++/12/functional:61,
                 from /home/ewhac/devel/yoc-generic/poky/build/tmp/work/x86_64-linux/spirv-tools-native/1.3.290.0/git/source/val/function.h:18,
                 from /home/ewhac/devel/yoc-generic/poky/build/tmp/work/x86_64-linux/spirv-tools-native/1.3.290.0/git/source/val/function.cpp:15:
In static member function ‘static _Up* std::__copy_move<_IsMove, true, std::random_access_iterator_tag>::__copy_m(_Tp*, _Tp*, _Up*) [with _Tp = spvtools::val::BasicBlock* const; _Up = spvtools::val::BasicBlock*; bool _IsMove = false]’,
    inlined from ‘_OI std::__copy_move_a2(_II, _II, _OI) [with bool _IsMove = false; _II = spvtools::val::BasicBlock* const*; _OI = spvtools::val::BasicBlock**]’ at /usr/include/c++/12/bits/stl_algobase.h:501:30,
    inlined from ‘_OI std::__copy_move_a1(_II, _II, _OI) [with bool _IsMove = false; _II = spvtools::val::BasicBlock* const*; _OI = spvtools::val::BasicBlock**]’ at /usr/include/c++/12/bits/stl_algobase.h:528:42,
    inlined from ‘_OI std::__copy_move_a(_II, _II, _OI) [with bool _IsMove = false; _II = spvtools::val::BasicBlock* const*; _OI = spvtools::val::BasicBlock**]’ at /usr/include/c++/12/bits/stl_algobase.h:535:31,
    inlined from ‘_OI std::copy(_II, _II, _OI) [with _II = spvtools::val::BasicBlock* const*; _OI = spvtools::val::BasicBlock**]’ at /usr/include/c++/12/bits/stl_algobase.h:626:7,
    inlined from ‘static _ForwardIterator std::__uninitialized_copy<true>::__uninit_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = spvtools::val::BasicBlock* const*; _ForwardIterator = spvtools::val::BasicBlock**]’ at /usr/include/c++/12/bits/stl_uninitialized.h:147:27,
    inlined from ‘_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = spvtools::val::BasicBlock* const*; _ForwardIterator = spvtools::val::BasicBlock**]’ at /usr/include/c++/12/bits/stl_uninitialized.h:185:15,
    inlined from ‘_ForwardIterator std::__uninitialized_copy_a(_InputIterator, _InputIterator, _ForwardIterator, allocator<_Tp>&) [with _InputIterator = spvtools::val::BasicBlock* const*; _ForwardIterator = spvtools::val::BasicBlock**; _Tp = spvtools::val::BasicBlock*]’ at /usr/include/c++/12/bits/stl_uninitialized.h:372:37,
    inlined from ‘void std::vector<_Tp, _Alloc>::_M_assign_aux(_ForwardIterator, _ForwardIterator, std::forward_iterator_tag) [with _ForwardIterator = spvtools::val::BasicBlock* const*; _Tp = spvtools::val::BasicBlock*; _Alloc = std::allocator<spvtools::val::BasicBlock*>]’ at /usr/include/c++/12/bits/vector.tcc:339:35,
    inlined from ‘std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = spvtools::val::BasicBlock*; _Alloc = std::allocator<spvtools::val::BasicBlock*>]’ at /usr/include/c++/12/bits/stl_vector.h:787:21,
    inlined from ‘spv_result_t spvtools::val::Function::RegisterLoopMerge(uint32_t, uint32_t)’ at /home/ewhac/devel/yoc-generic/poky/build/tmp/work/x86_64-linux/spirv-tools-native/1.3.290.0/git/source/val/function.cpp:91:71:
/usr/include/c++/12/bits/stl_algobase.h:434:30: error: ‘void* __builtin_memcpy(void*, const void*, long unsigned int)’ forming offset 8 is out of the bounds [0, 8] of object ‘<anonymous>’ with type ‘spvtools::val::BasicBlock* const [1]’ [-Werror=array-bounds]
  434 |             __builtin_memmove(__result, __first, sizeof(_Tp) * _Num);
      |             ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ewhac/devel/yoc-generic/poky/build/tmp/work/x86_64-linux/spirv-tools-native/1.3.290.0/git/source/val/function.cpp: In member function ‘spv_result_t spvtools::val::Function::RegisterLoopMerge(uint32_t, uint32_t)’:
/home/ewhac/devel/yoc-generic/poky/build/tmp/work/x86_64-linux/spirv-tools-native/1.3.290.0/git/source/val/function.cpp:91:71: note: ‘<anonymous>’ declared here
   91 |     continue_target_headers_[&continue_target_block] = {current_block_};
      |                                                                       ^
cc1plus: all warnings being treated as errors

The build is configured by Yocto as follows (reformatted for clarity). $oecmake_sitefile is empty:

        cmake \
          -G 'Ninja' -DCMAKE_MAKE_PROGRAM=ninja \
          $oecmake_sitefile \
          /home/ewhac/devel/yoc-generic/poky/build/tmp/work/x86_64-linux/spirv-tools-native/1.3.290.0/git \
              -DCMAKE_INSTALL_PREFIX:PATH=/home/ewhac/devel/yoc-generic/poky/build/tmp/work/x86_64-linux/spirv-tools-native/1.3.290.0/recipe-sysroot-native/usr \
              -DCMAKE_INSTALL_BINDIR:PATH=bin \
              -DCMAKE_INSTALL_SBINDIR:PATH=sbin \
              -DCMAKE_INSTALL_LIBEXECDIR:PATH=libexec \
              -DCMAKE_INSTALL_SYSCONFDIR:PATH=/home/ewhac/devel/yoc-generic/poky/build/tmp/work/x86_64-linux/spirv-tools-native/1.3.290.0/recipe-sysroot-native/etc \
              -DCMAKE_INSTALL_SHAREDSTATEDIR:PATH=../com \
              -DCMAKE_INSTALL_LOCALSTATEDIR:PATH=/home/ewhac/devel/yoc-generic/poky/build/tmp/work/x86_64-linux/spirv-tools-native/1.3.290.0/recipe-sysroot-native/var \
              -DCMAKE_INSTALL_LIBDIR:PATH=lib \
              -DCMAKE_INSTALL_INCLUDEDIR:PATH=include \
              -DCMAKE_INSTALL_DATAROOTDIR:PATH=share \
              -DPYTHON_EXECUTABLE:PATH=/usr/bin/python3 \
              -DPython_EXECUTABLE:PATH=/usr/bin/python3 \
              -DPython3_EXECUTABLE:PATH=/usr/bin/python3 \
              -DLIB_SUFFIX= \
              -DCMAKE_INSTALL_SO_NO_EXE=0 \
              -DCMAKE_TOOLCHAIN_FILE:FILEPATH=/home/ewhac/devel/yoc-generic/poky/build/tmp/work/x86_64-linux/spirv-tools-native/1.3.290.0/toolchain.cmake \
              -DCMAKE_NO_SYSTEM_FROM_IMPORTED=1 
              -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON \
              -DFETCHCONTENT_FULLY_DISCONNECTED=ON \
              -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON  \
              -DSPIRV-Headers_SOURCE_DIR=/home/ewhac/devel/yoc-generic/poky/build/tmp/work/x86_64-linux/spirv-tools-native/1.3.290.0/recipe-sysroot-native/usr \
              -DSPIRV_TOOLS_BUILD_STATIC=OFF \
              -DBUILD_SHARED_LIBS=ON \
              -DSPIRV_SKIP_TESTS=ON   \
              -Wno-dev
@ewhac
Copy link
Author

ewhac commented Dec 5, 2024

This patch allows the suite to compile. However, my C++-fu is not strong, so I have no idea if this is correct:

diff --git a/source/val/function.cpp b/source/val/function.cpp
index 290574b85..c986ce6cc 100644
--- a/source/val/function.cpp
+++ b/source/val/function.cpp
@@ -88,7 +88,7 @@ spv_result_t Function::RegisterLoopMerge(uint32_t merge_id,
   merge_block_header_[&merge_block] = current_block_;
   if (continue_target_headers_.find(&continue_target_block) ==
       continue_target_headers_.end()) {
-    continue_target_headers_[&continue_target_block] = {current_block_};
+    continue_target_headers_[&continue_target_block] = std::vector<BasicBlock *> { current_block_ };
   } else {
     continue_target_headers_[&continue_target_block].push_back(current_block_);
   }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant