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

Fails to build with libc++ 19 #16259

Open
jbeich opened this issue Oct 28, 2024 · 2 comments · May be fixed by #16261
Open

Fails to build with libc++ 19 #16259

jbeich opened this issue Oct 28, 2024 · 2 comments · May be fixed by #16261

Comments

@jbeich
Copy link
Contributor

jbeich commented Oct 28, 2024

Regressed by llvm/llvm-project@c3668779c135. From error log:

$ export CC=clang CXX=clang++ CXXFLAGS=-stdlib=libc++
$ cmake -G Ninja -B _build
$ cmake --build _build
[...]
/usr/include/c++/v1/string:820:42: error: implicit instantiation of undefined template 'std::char_traits<unsigned long>'
  static_assert(is_same<_CharT, typename traits_type::char_type>::value,
                                         ^
rpcs3/Emu/Cell/PPUAnalyser.h:184:25: note: in instantiation of template class 'std::basic_string<unsigned int>' requested here
        std::basic_string<u32> applied_patches;
                               ^
rpcs3/Emu/Cell/lv2/sys_prx.h:198:26: note: in instantiation of template class 'std::basic_string<bool>' requested here
        std::basic_string<bool> m_loaded_flags;
                                ^
rpcs3/Emu/System.cpp:1228:39: note: in instantiation of template class 'std::basic_string_view<unsigned char>' requested here
                                        const std::basic_string_view<u8> dirname{reinterpret_cast<const u8*>(game_data.data()), game_data.size()};
                                                                         ^
rpcs3/util/logs.cpp:401:52: note: in instantiation of template class 'std::basic_string<unsigned long>' requested here
        /*constinit thread_local*/ std::basic_string<u64> args;
                                                          ^
rpcs3/util/logs.cpp:410:7: note: in instantiation of member function 'std::basic_string<unsigned long>::resize' requested here
        args.resize(args_count);
             ^
Utilities/bin_patch.cpp:912:38: note: in instantiation of template class 'std::basic_string<unsigned int>' requested here
        const usz old_applied_size = applied.size();
                                            ^
Utilities/bin_patch.cpp:992:14: note: in instantiation of member function 'std::basic_string<unsigned int>::push_back' requested here
                                        applied.push_back(::narrow<u32>(&p - patch.data_list.data())); // Remember index in case of failure to allocate any memory
                                                ^
Utilities/bin_patch.cpp:1012:11: note: in instantiation of member function 'std::basic_string<unsigned int>::resize' requested here
                applied.resize(old_applied_size);
                        ^
/usr/include/c++/v1/string_view:300:42: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>'
  static_assert(is_same<_CharT, typename traits_type::char_type>::value,
                                         ^
Utilities/File.cpp:296:31: note: in instantiation of template class 'std::basic_string_view<unsigned char>' requested here
                        std::basic_string_view<u8> data_view;
                                                   ^
Utilities/File.cpp:332:61: note: in instantiation of function template specialization 'std::__1::operator==<unsigned char, std::char_traits<unsigned char>>' requested here
                return _rhs.type_view == _lhs.type_view && _rhs.data_view == _lhs.data_view;
                                                                          ^
rpcs3/Crypto/unedat.cpp:617:15: note: in instantiation of template class 'std::basic_string_view<unsigned char>' requested here
        for (usz i = std::basic_string_view<u8>(buf.get() + 0x30, file_name.size()).find_last_of('.'); i < buf_len; i++)
                     ^
rpcs3/Crypto/unedat.cpp:617:78: note: in instantiation of member function 'std::basic_string_view<unsigned char>::find_last_of' requested here
        for (usz i = std::basic_string_view<u8>(buf.get() + 0x30, file_name.size()).find_last_of('.'); i < buf_len; i++)
                                                                                    ^
rpcs3/Emu/Cell/PPUAnalyser.h:180:8: note: while declaring the implicit move constructor for 'main_ppu_module'
struct main_ppu_module : public ppu_module
       ^
rpcs3/Emu/Cell/PPUAnalyser.h:184:25: note: in instantiation of template class 'std::basic_string<unsigned int>' requested here
        std::basic_string<u32> applied_patches;
                               ^
rpcs3/Loader/PSF.cpp:78:45: note: in instantiation of template class 'std::basic_string_view<unsigned char>' requested here
                fmt::append(out, "%s: %s\n", entry.first, std::basic_string_view<u8>(reinterpret_cast<const u8*>(entry.second.as_string().data()), entry.second.size()));
                                                          ^

Affects future versions of FreeBSD, macOS and Chimera Linux. See also related downstream bug.

@oltolm
Copy link
Contributor

oltolm commented Oct 28, 2024

I fixed it in a branch in my fork. I can submit a PR later.

@Nekotekina
Copy link
Member

It's a bit complicated... It should be some sort of FixedVector in some cases, or probably just vector in another.

@oltolm oltolm linked a pull request Oct 28, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

3 participants