Created attachment 681067 [details, diff] timidity++-alsa-symver-lto.patch When built with link time optimization, timidity binds to the wrong version of some symbols in libasound.so.2. This happens because it uses the old 0.9 API (it defines ALSA_PCM_OLD_HW_PARAMS_API), and in this case the alsa headers emit some global asm statements with .symver directives to make the linker bind to the old versions. That doesn't work with LTO, though: the asm statements and the code referencing the affected symbols may end up in different partitions, making the .symver statements ineffective. So the real problem is in the alsa headers, but there's no easy way to fix it (at least for gcc before version 10). So I think we should fix the issue in timidity. The attached patch contains a workaround for timidity; it disables LTO for the alsa backend. With the patch applied, timidity uses the correct version of the symbols and no longer causes segmentation faults in my tests.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a6f0728398f6fe33bfcab8ff6d79a1bbf6b13a10 commit a6f0728398f6fe33bfcab8ff6d79a1bbf6b13a10 Author: Sam James <sam@gentoo.org> AuthorDate: 2021-12-22 02:46:37 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2021-12-22 02:46:37 +0000 media-sound/timidity++: add LTO workaround patch Closes: https://bugs.gentoo.org/763612 Thanks-to: Alexander Miller <alex.miller@gmx.de> Signed-off-by: Sam James <sam@gentoo.org> .../timidity++/files/timidity++-2.15.0-lto-workaround.patch | 10 ++++++++++ media-sound/timidity++/timidity++-2.15.0-r2.ebuild | 1 + 2 files changed, 11 insertions(+)