Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 801172

Summary: media-libs/dav1d: broken with lto (at least clang+lto)
Product: Gentoo Linux Reporter: Joonas Niilola <juippis>
Component: Current packagesAssignee: Luca Barbato <lu_zero>
Status: CONFIRMED ---    
Severity: normal CC: sam, telans
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=791544
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 618550    

Description Joonas Niilola gentoo-dev 2021-07-08 08:35:53 UTC
All versions of dav1d in-tree currently seems broken with lto,
0.9.0, 0.8.2, 0.8.0

Using clang+lto

https://code.videolan.org/videolan/dav1d/-/issues/362 might be relevant. Clang+no-lto works.

No clue about gcc+lto.
Comment 1 Sergei Trofimovich (RETIRED) gentoo-dev 2021-07-08 08:38:55 UTC
Probably a dupe of bug #791544. Tl;DR is: dav1d greps raw ELF to detect platform properties.
Comment 2 Sergei Trofimovich (RETIRED) gentoo-dev 2021-07-08 08:40:00 UTC
Ah, your link is about runtime failures. Never mind me.
Comment 3 Joonas Niilola gentoo-dev 2021-07-08 09:11:53 UTC
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.
Comment 4 Joonas Niilola gentoo-dev 2021-07-10 16:34:17 UTC
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.
Comment 5 Joonas Niilola gentoo-dev 2022-06-30 12:17:00 UTC
Looking at the upstream bug report, this seems resolved in 1.0.0. So bug can be closed when 1.0.0 is stabilized and <1.0.0 cleaned, I guess.
Comment 6 James Beddek 2022-07-04 13:31:22 UTC
(In reply to Joonas Niilola from comment #5)
> Looking at the upstream bug report, this seems resolved in 1.0.0. So bug can
> be closed when 1.0.0 is stabilized and <1.0.0 cleaned, I guess.

I don't believe I ever got round to filing a Gentoo bug related to the dav1d one. The fix was to pass through `-Dstack_alignment=16` to emesonargs when tc-is-clang + lto. Nothing was changed on dav1d's side as from their point of view it's a clang bug.

https://github.com/llvm/llvm-project/issues/39981
https://github.com/llvm/llvm-project/issues/40602