Summary: | media-video/mplayer-1.3.0-r4 fails to build with -flto: undefined reference to `sse_int32_map_factor', `sse_int32_80h' | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Alexander Miller <alex.miller> |
Component: | Current packages | Assignee: | Gentoo Media-video project <media-video> |
Status: | UNCONFIRMED --- | ||
Severity: | normal | CC: | ago, kredba, l_indien, sam |
Priority: | Normal | Keywords: | PATCH |
Version: | unspecified | ||
Hardware: | AMD64 | ||
OS: | Linux | ||
See Also: |
https://bugs.gentoo.org/show_bug.cgi?id=461634 https://trac.mplayerhq.hu/ticket/2408 |
||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 618550 | ||
Attachments: | mplayer-1.3.0-fix-lto-linking.patch |
Bug still present in 1.4-r1, but the patch for version 1.3.0 still works with the newer release :) Iade Gesso, PhD Can you submit this upstream please? Thanks. *** Bug 861140 has been marked as a duplicate of this bug. *** Yes, sure, here it is: https://trac.mplayerhq.hu/ticket/2408 (In reply to Jocelyn Mayer from comment #4) > Yes, sure, here it is: > https://trac.mplayerhq.hu/ticket/2408 Thank you! while waiting for this patch to be validated upstream, as you said you feel it too invasive in #861140, there are several possibility to avoid this issue. The proposal I got, from what I think the worse to the best: » Put a restriction in the ebuild to block USE="libass" and LTO together (inside pkg_setup ?) » Globally disable sse4 support when havind USE="libass" and LTO together adding --disable--sse4 in myconf inside src_configure » When LTO is requested, lightly patch libmpcodecs/vf_ass.c to disable use of sse4 there: --- MPlayer-1.4/libmpcodecs/vf_ass.c 2022-12-28 00:44:19.772746286 +0100 +++ MPlayer-1.4/libmpcodecs/vf_ass.c 2022-12-28 00:44:45.937417351 +0100 @@ -20,8 +20,6 @@ */ #include "config.h" +#undef HAVE_SSE4_INLINE +#define HAVE_SSE4_INLINE 0 #include <stdio.h> #include <stdlib.h> All the 3 should make the trick, the last one seems the least problematic for global optimization. |
Created attachment 523834 [details, diff] mplayer-1.3.0-fix-lto-linking.patch With LTO, building mplayer fails during the final link. Here's the relevant part of the build log: x86_64-pc-linux-gnu-gcc -o mplayer [...many objects, libs, and options...] [...unrelated warnings...] /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/portage/media-video/mplayer-1.3.0-r4/temp/cc2me1CP.ltrans18.ltrans.o: warning: relocation against `sse_int32_map_factor' in readonly section `.text' /tmp/portage/media-video/mplayer-1.3.0-r4/temp/cc2me1CP.ltrans18.ltrans.o: In function `render_frame_yuv420p_sse4': <artificial>:(.text+0xb1b): undefined reference to `sse_int32_map_factor' <artificial>:(.text+0xb24): undefined reference to `sse_int32_map_factor' <artificial>:(.text+0xb2d): undefined reference to `sse_int32_map_factor' <artificial>:(.text+0xb36): undefined reference to `sse_int32_map_factor' <artificial>:(.text+0xb3e): undefined reference to `sse_int32_80h' <artificial>:(.text+0xb46): undefined reference to `sse_int32_80h' <artificial>:(.text+0xb4e): undefined reference to `sse_int32_80h' <artificial>:(.text+0xb56): undefined reference to `sse_int32_80h' <artificial>:(.text+0xc93): undefined reference to `sse_int32_map_factor' <artificial>:(.text+0xc9c): undefined reference to `sse_int32_map_factor' <artificial>:(.text+0xca5): undefined reference to `sse_int32_map_factor' <artificial>:(.text+0xcae): undefined reference to `sse_int32_map_factor' <artificial>:(.text+0xcb6): undefined reference to `sse_int32_80h' <artificial>:(.text+0xcbe): undefined reference to `sse_int32_80h' <artificial>:(.text+0xcc6): undefined reference to `sse_int32_80h' <artificial>:(.text+0xcce): undefined reference to `sse_int32_80h' /tmp/portage/media-video/mplayer-1.3.0-r4/temp/cc2me1CP.ltrans18.ltrans.o: In function `render_frame_yuv422_sse4': <artificial>:(.text+0x1143): undefined reference to `sse_int32_map_factor' <artificial>:(.text+0x114c): undefined reference to `sse_int32_map_factor' <artificial>:(.text+0x1154): undefined reference to `sse_int32_80h' <artificial>:(.text+0x115c): undefined reference to `sse_int32_80h' /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: warning: creating a DT_TEXTREL in a shared object. collect2: error: ld returned 1 exit status make: *** [Makefile:747: mplayer] Error 1 * ERROR: media-video/mplayer-1.3.0-r4::gentoo failed (compile phase): * emake failed This is due to some inline assembler which uses direct symbol references. Because gcc doesn't parse asm statements, it doesn't know these variables are referenced from the code, and when partitioning it may omit them from the units where they're needed. The attached patch disables direct references and adds named constraints where missing. That fixes the build for me.