https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91067
--- Comment #17 from Viktor Ostashevskyi <ostash at ostash dot kiev.ua> --- Ok, got following today with GCC 9.2 with "-O2 -fno-inline -flto=20": ld.bfd: /tmp/tests.oKru4z.ltrans32.ltrans.o: in function `std::__shared_ptr<void, (__gnu_cxx::_Lock_policy)2>::operator=(std::__shared_ptr<void, (__gnu_cxx::_Lock_policy)2>&&)': c++/9.2.0/bits/shared_ptr_base.h:1265: undefined reference to `std::__shared_ptr<std::filesystem::_Dir, (__gnu_cxx::_Lock_policy)2>::__shared_ptr(std::__shared_ptr<std::filesystem::_Dir, (__gnu_cxx::_Lock_policy)2>&&)' Code base is huge, so it is hard to minimize test case. Even not sure whether LTO or libstdc++ is guilty.