mpv-player / mpv-build

🔨 Helper scripts to compile mpv on Linux
http://mpv.io
408 stars 107 forks source link

debian: disable LTO #173

Closed wsldankers closed 2 years ago

wsldankers commented 2 years ago

Newer versions of Ubuntu (and future versions of Debian) enable LTO by default for package builds. This is apparently incompatible with how we compile mpv using static builds of ffmpeg and libass.

Fixes https://github.com/mpv-player/mpv-build/issues/158

Further reading:

avih commented 2 years ago

This is apparently incompatible with how we compile mpv using static builds of ffmpeg and libass

Do we know what's incompatible? mpv-build doesn't do any tricks while building libass and ffmpeg, so why would that be incompatible with LTO?

wsldankers commented 2 years ago

Do we know what's incompatible? mpv-build doesn't do any tricks while building libass and ffmpeg, so why would that be incompatible with LTO?

I do not know.

avih commented 2 years ago

I do not know.

I'll merge it for now, but IMO it's worth figuring out what the actual issue is, and maybe report upstream if needed.

TheOneric commented 2 years ago

Do we know what's incompatible?

The linked Debian wiki page or the logs from linked in the linked Ubuntu page show that ffmpeg fails to build with the lto settings used with optimize=+lto. This can be easily verified locally by setting CC="gcc" CFLAGS="-O2 -gdwarf -flto=auto -ffat-lto-objects" OBJFLAGS="-flto=auto -ffat-lto-objects" LDFLAGS="-flto=auto" and enabling shared-libraries when building ffmpeg; with --disable-inline-asm it works.

libass has no issues with lto and builds perfectly fine with both asm and lto enabled.