All versions of dav1d in-tree currently seems broken with lto,
0.9.0, 0.8.2, 0.8.0
https://code.videolan.org/videolan/dav1d/-/issues/362 might be relevant. Clang+no-lto works.
No clue about gcc+lto.
Probably a dupe of bug #791544. Tl;DR is: dav1d greps raw ELF to detect platform properties.
Ah, your link is about runtime failures. Never mind me.
Yes, it compiles fine, but runtime segfaults. The link seems to state that gcc+lto is fine too, so it's somehow clang+lto related.
Seems like +clang -lto works fine. So I suggest to check if tc-is-clang && is-flagq "-flto*" -> strip lto out with filter-flags "-flto*", and post some elog to user about it.
Since the breakage happens in runtime, and not in build-time.