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

Error compiling for MIPS #3529

Open
tpimh opened this issue Feb 23, 2024 · 2 comments
Open

Error compiling for MIPS #3529

tpimh opened this issue Feb 23, 2024 · 2 comments

Comments

@tpimh
Copy link

tpimh commented Feb 23, 2024

When building for MIPS, I get the following errors in SPVRemapper.cpp:

In file included from /source/glslang/SPIRV/SPVRemapper.cpp:36:
/source/glslang/SPIRV/SPVRemapper.h: In member function ‘spv::Id& spv::spirvbin_t::asId(unsigned int)’:
/source/glslang/SPIRV/SPVRemapper.h:162:72: error: cannot bind non-const lvalue reference of type ‘spv::Id&’ {aka ‘unsigned int&’} to a value of type ‘__gnu_cxx::__alloc_traits<std::allocator<long unsigned int>, long unsigned int>::value_type’ {aka ‘long unsigned int’}
  162 |    spv::Id&        asId(unsigned word)                { return spv[word]; }
      |                                                                        ^
/source/glslang/SPIRV/SPVRemapper.h: In member function ‘const spv::Id& spv::spirvbin_t::asId(unsigned int) const’:
/source/glslang/SPIRV/SPVRemapper.h:163:72: warning: returning reference to temporary [-Wreturn-local-addr]
  163 |    const spv::Id&  asId(unsigned word)          const { return spv[word]; }
      |                                                                        ^
/source/glslang/SPIRV/SPVRemapper.cpp: In member function ‘void spv::spirvbin_t::mapRemainder()’:
/source/glslang/SPIRV/SPVRemapper.cpp:369:32: error: no matching function for call to ‘max(spv::spirvbin_t::spirword_t&, spv::Id)’
  369 |             maxBound = std::max(maxBound, localId(id) + 1);
      |                        ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/local/include/c++/13.2.0/string:51,
                 from /source/glslang/SPIRV/SPVRemapper.h:39:
/usr/local/include/c++/13.2.0/bits/stl_algobase.h:257:5: note: candidate: ‘template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)’
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/local/include/c++/13.2.0/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
/source/glslang/SPIRV/SPVRemapper.cpp:369:32: note:   deduced conflicting types for parameter ‘const _Tp’ (‘long unsigned int’ and ‘spv::Id’ {aka ‘unsigned int’})
  369 |             maxBound = std::max(maxBound, localId(id) + 1);
      |                        ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/13.2.0/bits/stl_algobase.h:303:5: note: candidate: ‘template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)’
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/local/include/c++/13.2.0/bits/stl_algobase.h:303:5: note:   template argument deduction/substitution failed:
/source/glslang/SPIRV/SPVRemapper.cpp:369:32: note:   deduced conflicting types for parameter ‘const _Tp’ (‘long unsigned int’ and ‘spv::Id’ {aka ‘unsigned int’})
  369 |             maxBound = std::max(maxBound, localId(id) + 1);
      |                        ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/local/include/c++/13.2.0/functional:67,
                 from /source/glslang/SPIRV/SPVRemapper.h:71:
/usr/local/include/c++/13.2.0/bits/stl_algo.h:5795:5: note: candidate: ‘template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)’
 5795 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/local/include/c++/13.2.0/bits/stl_algo.h:5795:5: note:   template argument deduction/substitution failed:
/source/glslang/SPIRV/SPVRemapper.cpp:369:32: note:   mismatched types ‘std::initializer_list<_Tp>’ and ‘long unsigned int’
  369 |             maxBound = std::max(maxBound, localId(id) + 1);
      |                        ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/13.2.0/bits/stl_algo.h:5805:5: note: candidate: ‘template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)’
 5805 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/local/include/c++/13.2.0/bits/stl_algo.h:5805:5: note:   template argument deduction/substitution failed:
/source/glslang/SPIRV/SPVRemapper.cpp:369:32: note:   mismatched types ‘std::initializer_list<_Tp>’ and ‘long unsigned int’
  369 |             maxBound = std::max(maxBound, localId(id) + 1);
      |                        ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
@arcady-lunarg
Copy link
Contributor

Well that's annoying. The issue is spv::Id is defined as unsigned int whereas the underlying type of the vector is spirword_t which is defined as uint32_t which sounds like on your system is unsigned long.

@tpimh
Copy link
Author

tpimh commented Feb 24, 2024

As I understand, I need to modify platform specific type definitions, but I can't find them.

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

2 participants