Created attachment 470468 [details] build.log I emerging @system to use LTO and alsa-lib failed to build : /tmp/portage/media-libs/alsa-lib-1.1.3/temp/ccjqiOsd.lto.o /tmp/portage/media-libs/alsa-lib-1.1.3/temp/ccjqiOsd.lto.o:<artificial>:function snd1_pcm_direct_prepare: error: undefined reference to 'snd_timer_params_set_filter' /tmp/portage/media-libs/alsa-lib-1.1.3/temp/ccjqiOsd.lto.o:<artificial>:function snd_pcm_hw_sw_params: error: undefined reference to 'snd_timer_params_set_filter .... collect2: error: ld returned 1 exit status make[2]: *** [Makefile:490: libasound.la] Error 1 make[2]: Leaving directory '/tmp/portage/media-libs/alsa-lib-1.1.3/work/alsa-lib-1.1.3-abi_x86_32.x86/src' make[1]: *** [Makefile:544: all-recursive] Error 1 make[1]: Leaving directory '/tmp/portage/media-libs/alsa-lib-1.1.3/work/alsa-lib-1.1.3-abi_x86_32.x86/src' make: *** [Makefile:402: all-recursive] Error 1
Created attachment 470470 [details] emerge --info
I get a different error with GCC7.1 and LTO. Please let me know if I should open a new report. ... [LTRANS] Size of mmap'd section hsa: 0 bytes /tmp/portage/media-libs/alsa-lib-1.1.3/temp/ccoOdbbh.s: Assembler messages: /tmp/portage/media-libs/alsa-lib-1.1.3/temp/ccoOdbbh.s: Error: invalid attempt to declare external version name as default in symbol `snd_pcm_forward@@ALSA_0.9.0rc8' /tmp/portage/media-libs/alsa-lib-1.1.3/temp/ccoOdbbh.s: Error: invalid attempt to declare external version name as default in symbol `snd_pcm_hw_params_get_access@@ALSA_0.9.0rc4' /tmp/portage/media-libs/alsa-lib-1.1.3/temp/ccoOdbbh.s: Error: invalid attempt to declare external version name as default in symbol `snd_pcm_hw_params_set_access_first@@ALSA_0.9.0rc4' /tmp/portage/media-libs/alsa-lib-1.1.3/temp/ccoOdbbh.s: Error: invalid attempt to declare external version name as default in symbol `snd_pcm_hw_params_get_format@@ALSA_0.9.0rc4' /tmp/portage/media-libs/alsa-lib-1.1.3/temp/ccoOdbbh.s: Error: invalid attempt to declare external version name as default in symbol `snd_pcm_hw_params_get_channels@@ALSA_0.9.0rc4' /tmp/portage/media-libs/alsa-lib-1.1.3/temp/ccoOdbbh.s: Error: invalid attempt to declare external version name as default in symbol `snd_pcm_hw_params_get_rate@@ALSA_0.9.0rc4' /tmp/portage/media-libs/alsa-lib-1.1.3/temp/ccoOdbbh.s: Error: invalid attempt to declare external version name as default in symbol `snd_pcm_hw_params_get_period_size@@ALSA_0.9.0rc4' /tmp/portage/media-libs/alsa-lib-1.1.3/temp/ccoOdbbh.s: Error: invalid attempt to declare external version name as default in symbol `snd_pcm_hw_params_get_buffer_size@@ALSA_0.9.0rc4' make[3]: *** [/tmp/portage/media-libs/alsa-lib-1.1.3/temp/ccsn8ism.mk:2: /tmp/portage/media-libs/alsa-lib-1.1.3/temp/ccSv3S5Q.ltrans0.ltrans.o] Error 1 ....
Created attachment 472164 [details] build.log-GCC7
Created attachment 472166 [details] emerge --info GCC7
(In reply to Petross404(Petros S) from comment #2) > I get a different error with GCC7.1 and LTO. Please let me know if I should > open a new report. > > ... > /tmp/portage/media-libs/alsa-lib-1.1.3/temp/ccoOdbbh.s: Assembler messages: > /tmp/portage/media-libs/alsa-lib-1.1.3/temp/ccoOdbbh.s: Error: invalid > attempt to declare external version name as default in symbol > `snd_pcm_forward@@ALSA_0.9.0rc8' After using -flto-partition=none, I eliminated the assembler error due to wrong partitioning [1] and the first linker error (undefined reference) re-appeared. Before using -flto-partition=none, I even tried to append __attribute__((used)) infront of : a) snd_timer_params_set_filter (alsa-lib-1.1.4.1/include/pcm.h) b) snd_timer_params_set_filter (alsa-lib-1.1.4.1/include/timer.h) but it wouldn't cut it; assembler continued to fail. So, is disabling LTO's partitioning, the way to go for LTO'ed alsa-lib? Can someone confirm this? [1]http://marxin.github.io/posts/gentoo-linux-packages-with-gcc-4-dot-9-lto/ (#Assembly usage)
(In reply to Petross404(Petros S) from comment #5) > a) snd_timer_params_set_filter (alsa-lib-1.1.4.1/include/pcm.h) I meant snd_pcm_hw_params_get_format.
can confirm, emerge --info '=media-libs/alsa-lib-1.1.6-r1::gentoo' : https://paste.pound-python.org/show/R4n2OlIRQ0Ze6tQmRoIe/ emerge -pqv '=media-libs/alsa-lib-1.1.6-r1::gentoo' https://paste.pound-python.org/show/fNsOhcdyDrjaBHY9qdOA/ The complete build log : https://paste.pound-python.org/show/ZLOvVylcFyy4WzlQOBuk/
*** Bug 638550 has been marked as a duplicate of this bug. ***
*** Bug 640834 has been marked as a duplicate of this bug. ***
setting -flto-partition=one allows alsa-lib to be compiled with lto.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=31c929441087eb65c4cdcfc61b29acb3a50cb954 commit 31c929441087eb65c4cdcfc61b29acb3a50cb954 Author: Sam James <sam@gentoo.org> AuthorDate: 2022-06-18 15:19:42 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2022-06-18 15:19:47 +0000 media-libs/alsa-lib: filter LTO It's unsafe to use with alsa-lib (fails to build, can work with a hack, but that hack implies other issues). Closes: https://bugs.gentoo.org/616108 Closes: https://bugs.gentoo.org/669086 Signed-off-by: Sam James <sam@gentoo.org> media-libs/alsa-lib/alsa-lib-1.2.7.1.ebuild | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b380de62b52d318e12857c54a3d99c9c21e3b165 commit b380de62b52d318e12857c54a3d99c9c21e3b165 Author: Sam James <sam@gentoo.org> AuthorDate: 2022-07-17 15:06:41 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2022-07-17 15:06:54 +0000 media-libs/alsa-lib: use new filter-lto Bug: https://bugs.gentoo.org/616108 Bug: https://bugs.gentoo.org/669086 Signed-off-by: Sam James <sam@gentoo.org> media-libs/alsa-lib/alsa-lib-1.2.7.2.ebuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)