Skip to content

rust-gpu master / spirv-tools fails to build on latest nix #370

@Firestar99

Description

@Firestar99

Compiling spirv-tools fails with:

 cargo:warning=In file included from /nix/store/8adzgnxs3s0pbj22qhk9zjxi1fqmz3xv-gcc-14.3.0/include/c++/14.3.0/algorithm:60,
  cargo:warning=                 from spirv-tools/source/opt/ir_context.h:18,
  cargo:warning=                 from spirv-tools/source/opt/amd_ext_to_khr.h:18,
  cargo:warning=                 from spirv-tools/source/opt/amd_ext_to_khr.cpp:15:
  cargo:warning=In static member function 'static _Up* std::__copy_move<_IsMove, true, std::random_access_iterator_tag>::__copy_m(_Tp*, _Tp*, _Up*) [with _Tp = const unsigned int; _Up = unsigned int; bool _IsMove = false]',
  cargo:warning=    inlined from '_OI std::__copy_move_a2(_II, _II, _OI) [with bool _IsMove = false; _II = const unsigned int*; _OI = unsigned int*]' at /nix/store/8adzgnxs3s0pbj22qhk9zjxi1fqmz3xv-gcc-14.3.0/include/c++/14.3.0/bits/stl_algobase.h:521:30,
  cargo:warning=    inlined from '_OI std::__copy_move_a1(_II, _II, _OI) [with bool _IsMove = false; _II = const unsigned int*; _OI = unsigned int*]' at /nix/store/8adzgnxs3s0pbj22qhk9zjxi1fqmz3xv-gcc-14.3.0/include/c++/14.3.0/bits/stl_algobase.h:548:42,
  cargo:warning=    inlined from '_OI std::__copy_move_a(_II, _II, _OI) [with bool _IsMove = false; _II = const unsigned int*; _OI = unsigned int*]' at /nix/store/8adzgnxs3s0pbj22qhk9zjxi1fqmz3xv-gcc-14.3.0/include/c++/14.3.0/bits/stl_algobase.h:555:31,
  cargo:warning=    inlined from '_OI std::copy(_II, _II, _OI) [with _II = const unsigned int*; _OI = unsigned int*]' at /nix/store/8adzgnxs3s0pbj22qhk9zjxi1fqmz3xv-gcc-14.3.0/include/c++/14.3.0/bits/stl_algobase.h:651:7,
  cargo:warning=    inlined from 'static _ForwardIterator std::__uninitialized_copy<true>::__uninit_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = const unsigned int*; _ForwardIterator = unsigned int*]' at /nix/store/8adzgnxs3s0pbj22qhk9zjxi1fqmz3xv-gcc-14.3.0/include/c++/14.3.0/bits/stl_uninitialized.h:147:27,
  cargo:warning=    inlined from '_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = const unsigned int*; _ForwardIterator = unsigned int*]' at /nix/store/8adzgnxs3s0pbj22qhk9zjxi1fqmz3xv-gcc-14.3.0/include/c++/14.3.0/bits/stl_uninitialized.h:185:15,
  cargo:warning=    inlined from '_ForwardIterator std::__uninitialized_copy_a(_InputIterator, _InputIterator, _ForwardIterator, allocator<_Tp>&) [with _InputIterator = const unsigned int*; _ForwardIterator = unsigned int*; _Tp = unsigned int]' at /nix/store/8adzgnxs3s0pbj22qhk9zjxi1fqmz3xv-gcc-14.3.0/include/c++/14.3.0/bits/stl_uninitialized.h:373:37,
  cargo:warning=    inlined from 'void std::vector<_Tp, _Alloc>::_M_range_initialize_n(_Iterator, _Iterator, size_type) [with _Iterator = const unsigned int*; _Tp = unsigned int; _Alloc = std::allocator<unsigned int>]' at /nix/store/8adzgnxs3s0pbj22qhk9zjxi1fqmz3xv-gcc-14.3.0/include/c++/14.3.0/bits/stl_vector.h:1719:37:
  cargo:warning=/nix/store/8adzgnxs3s0pbj22qhk9zjxi1fqmz3xv-gcc-14.3.0/include/c++/14.3.0/bits/stl_algobase.h:452:30: error: 'void* __builtin_memcpy(void*, const void*, long unsigned int)' writing between 5 and 9223372036854775807 bytes into a region of size 4 [-Werror=stringop-overflow=]
  cargo:warning=  452 |             __builtin_memmove(__result, __first, sizeof(_Tp) * _Num);
  cargo:warning=      |             ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=In file included from /nix/store/8adzgnxs3s0pbj22qhk9zjxi1fqmz3xv-gcc-14.3.0/include/c++/14.3.0/x86_64-unknown-linux-gnu/bits/c++allocator.h:33,
  cargo:warning=                 from /nix/store/8adzgnxs3s0pbj22qhk9zjxi1fqmz3xv-gcc-14.3.0/include/c++/14.3.0/bits/allocator.h:46,
  cargo:warning=                 from /nix/store/8adzgnxs3s0pbj22qhk9zjxi1fqmz3xv-gcc-14.3.0/include/c++/14.3.0/string:43,
  cargo:warning=                 from /nix/store/8adzgnxs3s0pbj22qhk9zjxi1fqmz3xv-gcc-14.3.0/include/c++/14.3.0/bits/locale_classes.h:40,
  cargo:warning=                 from /nix/store/8adzgnxs3s0pbj22qhk9zjxi1fqmz3xv-gcc-14.3.0/include/c++/14.3.0/bits/ios_base.h:41,
  cargo:warning=                 from /nix/store/8adzgnxs3s0pbj22qhk9zjxi1fqmz3xv-gcc-14.3.0/include/c++/14.3.0/ios:44,
  cargo:warning=                 from /nix/store/8adzgnxs3s0pbj22qhk9zjxi1fqmz3xv-gcc-14.3.0/include/c++/14.3.0/ostream:40,
  cargo:warning=                 from /nix/store/8adzgnxs3s0pbj22qhk9zjxi1fqmz3xv-gcc-14.3.0/include/c++/14.3.0/iostream:41,
  cargo:warning=                 from spirv-tools/source/opt/ir_context.h:19:
  cargo:warning=In member function '_Tp* std::__new_allocator<_Tp>::allocate(size_type, const void*) [with _Tp = unsigned int]',
  cargo:warning=    inlined from 'static _Tp* std::allocator_traits<std::allocator<_CharT> >::allocate(allocator_type&, size_type) [with _Tp = unsigned int]' at /nix/store/8adzgnxs3s0pbj22qhk9zjxi1fqmz3xv-gcc-14.3.0/include/c++/14.3.0/bits/alloc_traits.h:515:28,
  cargo:warning=    inlined from 'std::_Vector_base<_Tp, _Alloc>::pointer std::_Vector_base<_Tp, _Alloc>::_M_allocate(std::size_t) [with _Tp = unsigned int; _Alloc = std::allocator<unsigned int>]' at /nix/store/8adzgnxs3s0pbj22qhk9zjxi1fqmz3xv-gcc-14.3.0/include/c++/14.3.0/bits/stl_vector.h:383:33,
  cargo:warning=    inlined from 'void std::vector<_Tp, _Alloc>::_M_range_initialize_n(_Iterator, _Iterator, size_type) [with _Iterator = const unsigned int*; _Tp = unsigned int; _Alloc = std::allocator<unsigned int>]' at /nix/store/8adzgnxs3s0pbj22qhk9zjxi1fqmz3xv-gcc-14.3.0/include/c++/14.3.0/bits/stl_vector.h:1716:23:
  cargo:warning=/nix/store/8adzgnxs3s0pbj22qhk9zjxi1fqmz3xv-gcc-14.3.0/include/c++/14.3.0/bits/new_allocator.h:151:55: note: destination object of size 4 allocated by 'operator new'
  cargo:warning=  151 |         return static_cast<_Tp*>(_GLIBCXX_OPERATOR_NEW(__n * sizeof(_Tp)));
  cargo:warning=      |                                                       ^
[...]
  cargo:warning=cc1plus: all warnings being treated as errors
[...]
  cargo:warning=ToolExecError: command did not execute successfully (status code exit status: 1): LC_ALL="C" "g++" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "spirv-tools/" "-I" "spirv-tools/include" "-I" "generated/" "-I" "spirv-headers/include" "-I" "spirv-headers/include/spirv/unified1" "-Wall" "-Wextra" "-Wall" "-Wextra" "-Wnon-virtual-dtor" "-Wno-missing-field-initializers" "-Werror" "-std=c++17" "-fno-exceptions" "-fno-rtti" "-Wno-long-long" "-Wshadow" "-Wundef" "-Wconversion" "-Wno-sign-conversion" "-Wno-deprecated-declarations" "-DSPIRV_CHECK_CONTEXT" "-DSPIRV_LINUX" "-o" "/home/firestar99/workspace/rust-gpu/target/release/build/spirv-tools-sys-892921dd731f0c93/out/942b8c9adc6a33b2-amd_ext_to_khr.o" "-c" "spirv-tools/source/opt/amd_ext_to_khr.cpp"

System Info

rust-gpu master df1628a

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions