https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119627
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Jonathan Wakely from comment #1) > (In reply to Andrew Sayers from comment #0) > > ./cross-compiled: symbol lookup error: ./cross-compiled: undefined symbol: > > _ZNSt12__shared_ptrINSt10filesystem7__cxx114_DirELN9__gnu_cxx12_Lock_policyE2 > > EEC1EOS5_, version GLIBCXX_3.4.26 > > > > I assume that's an unrelated error, and it's easily worked around > > by not cross-compiling with `-O0`. > > I think that was Bug 108636 and is fixed in GCC 12.3 (you should really use > the latest release on the branch, which is currently 12.4) Actually no, you're getting a missing symbol at runtime, not at link-time. That suggests you're not using the right libstdc++.so.6 at runtime. Which might also explain the memory errors.