Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 916067 - media-video/ffmpeg-6 doesn't build with USE=-pic
Summary: media-video/ffmpeg-6 doesn't build with USE=-pic
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Media-video project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: binutils-2.41
  Show dependency tree
 
Reported: 2023-10-21 11:10 UTC by Bartosz Stebel
Modified: 2024-01-03 06:40 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log.xz,62.62 KB, application/x-xz)
2023-10-23 17:24 UTC, Bartosz Stebel
Details
emerge --info ffmpeg (einfo_ffmpeg.txt,11.00 KB, text/plain)
2023-10-23 18:03 UTC, Bartosz Stebel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bartosz Stebel 2023-10-21 11:10:31 UTC
Fails to link with
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: read-only segment has dynamic relocations
collect2: error: ld returned 1 exit status

It was failing in a similar way for ffmpeg-4 too, I upgraded to 6 thinking it'd fix it.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-10-21 13:56:42 UTC
Please always include the full build.log and emerge --info.
Comment 2 Alexey Chernyak 2023-10-22 23:30:31 UTC
Can build it by manually re-running each failed x86_64-pc-linux-gnu-gcc command from within the ../work/ffmpeg-6.0-abi_x86_32.x86 directory with these additional flags:

-Wl,-z,notext

and re-rebuilding 6 times with:

FEATURES="noclean keepwork" emerge -1a media-video/ffmpeg

The 6 problematic libraries are as follows:

 * QA Notice: The following files contain runtime text relocations
 *  Text relocations force the dynamic linker to perform extra
 *  work at startup, waste system resources, and may pose a security
 *  risk.  On some architectures, the code may not even function
 *  properly, if at all.
 *  For more information, see:
 * 
 *    https://wiki.gentoo.org/wiki/Hardened/HOWTO_locate_and_fix_textrels
 * 
 *  Please include the following list of files in your report:
 * TEXTREL usr/lib/libavutil.so.58.2.100
 * TEXTREL usr/lib/libpostproc.so.57.1.100
 * TEXTREL usr/lib/libswscale.so.7.1.100
 * TEXTREL usr/lib/libavcodec.so.60.3.100
 * TEXTREL usr/lib/libswresample.so.4.10.100
 * TEXTREL usr/lib/libavfilter.so.9.3.100
Comment 3 Mike Gilbert gentoo-dev 2023-10-23 15:39:37 UTC
Please attach a build log and provide emerge --info. Then change the bug status to UNCONFIRMED.
Comment 4 Bartosz Stebel 2023-10-23 17:24:59 UTC
Created attachment 873317 [details]
build.log
Comment 5 Bartosz Stebel 2023-10-23 18:03:46 UTC
Created attachment 873334 [details]
emerge --info ffmpeg
Comment 6 Bartosz Stebel 2023-10-23 18:04:21 UTC
I'd swear I added the log, must've missed the "file too big" error. Done.
Comment 7 Larry the Git Cow gentoo-dev 2024-01-03 06:39:37 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dba143d2e7f2485076b975290c8cff16202a5f6d

commit dba143d2e7f2485076b975290c8cff16202a5f6d
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-01-03 06:38:03 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-01-03 06:38:03 +0000

    media-video/ffmpeg: enable USE=pic by default
    
    binutils-2.41 is configured in Gentoo to reject textrels by default which
    the non-PIC-safe x86 (32-bit) asm requires.
    
    Start by defaulting USE=pic to on in general but we can remove the USE flag
    later and then just pass --disable-asm for 32-bit x86.
    
    Bug: https://bugs.gentoo.org/916067
    Bug: https://bugs.gentoo.org/920808
    Signed-off-by: Sam James <sam@gentoo.org>

 media-video/ffmpeg/ffmpeg-4.4.4-r8.ebuild | 2 +-
 media-video/ffmpeg/ffmpeg-5.1.4-r1.ebuild | 4 ++--
 media-video/ffmpeg/ffmpeg-6.0-r10.ebuild  | 4 ++--
 media-video/ffmpeg/ffmpeg-6.0-r9.ebuild   | 4 ++--
 media-video/ffmpeg/ffmpeg-6.0.1.ebuild    | 4 ++--
 media-video/ffmpeg/ffmpeg-6.1-r3.ebuild   | 4 ++--
 media-video/ffmpeg/ffmpeg-6.1.1.ebuild    | 2 +-
 media-video/ffmpeg/ffmpeg-9999.ebuild     | 4 ++--
 8 files changed, 14 insertions(+), 14 deletions(-)