On Fri, 11 Nov 2022 at 21:00, Stephan Bergmann <sberg...@redhat.com> wrote: > > On 11/11/22 06:30, Jonathan Wakely via Gcc-patches wrote: > > As discussed in the PR, this makes it three times faster to construct > > iostreams objects. > > > > Tested x86_64-linux. Pushed to trunk. > > I haven't yet tried to track down what's going on, but with various > versions of Clang (e.g. clang-15.0.4-1.fc37.x86_64): > > > $ cat test.cc > > #include <regex> > > int main(int, char ** argv) { > > std::regex_traits<char>().transform(argv[0], argv[0] + 1); > > } > > > $ clang++ --gcc-toolchain=... -fsanitize=undefined -O2 test.cc > > /usr/bin/ld: /tmp/test-c112b1.o: in function > > `std::__cxx11::basic_string<char, std::char_traits<char>, > > std::allocator<char> > > > std::__cxx11::regex_traits<char>::transform<char*>(char*, char*) const': > > test.cc:(.text._ZNKSt7__cxx1112regex_traitsIcE9transformIPcEENS_12basic_stringIcSt11char_traitsIcESaIcEEET_S9_[_ZNKSt7__cxx1112regex_traitsIcE9transformIPcEENS_12basic_stringIcSt11char_traitsIcESaIcEEET_S9_]+0x1b): > > undefined reference to `std::__cxx11::collate<char> const* > > std::__try_use_facet<std::__cxx11::collate<char> >(std::locale const&)' > > clang-15: error: linker command failed with exit code 1 (use -v to see > > invocation)
That should be present, andis present in my builds: _ZSt15__try_use_facetINSt7__cxx117collateIcEEEPKT_RKSt6locale std::__cxx11::collate<char> const* std::__try_use_facet<std::__cxx11::collate<char> >(std::locale const&) version status: compatible GLIBCXX_3.4.31 type: function status: added Was this a clean build, or incremental? I'm guessing the latter. The makefile deps for libstdc++ don't really support incremental builds. More precisely, the lack of deps. That symbol should be defined in src/c++11/cxx11-locale-inst.o which wasn't changed by the patch, but it includes src/c++11/locale-inst.cc which was changed. So an incremental rebuild will only rebuild the latter, and so you won't get the new symbols that should be in the former. But if you're seeing that with a clean build I'll have to investigate.