Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 831128 - media-video/ffmpeg: fix mixed strip usage
Summary: media-video/ffmpeg: fix mixed strip usage
Status: RESOLVED FIXED
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: PullRequest
Depends on:
Blocks:
 
Reported: 2022-01-13 11:52 UTC by Adrian Ratiu
Modified: 2022-01-14 14:01 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adrian Ratiu 2022-01-13 11:52:29 UTC
Even though stripping is disabled in the ffmpeg ebuild (--disable-stripping), some test binaries get stripped during the configure phase and this causes Clang builds to use the GNU strip instead of LLLVM strip.

To fix this we need to specify the following line to configure such that the proper GNU / LLVM version of strip is used:

--strip="$(tc-getSTRIP)"

Reproducible: Always

Steps to Reproduce:
I'm using a patch which creates wrappers for GNU binutils/GCC which fails the build if they get called in Clang-enabled builds.

Actual Results:  
GNU strip is called instead of LLVM strip.

Expected Results:  
The proper GNU or LLVM version of strip should be called.

I'll open a PR on Github.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-01-13 12:05:37 UTC
Not that this is a barrier for fixing it (duh), but at some point, it'd be great to unleash some variant of the wrappers/patches you're using to get more coverage on this.

It's a bit like gcc-config[-native-symlinks] (ditto binutils-config, python-exec)) on steroids.

Thanks for yet another one of these!
Comment 2 Adrian Ratiu 2022-01-13 17:55:32 UTC
Thank you Sam for all your support.

Yes, I would like to push my toolchain blocklisting patches eventually, but until then I'm very focused on fixing the discovered bugs.

Beside this type of ebuild fixes, I also have various patches pending in upstream projects like this one (https://github.com/brltty/brltty/pull/353) which will eventually be merged and trickle down to more distros as packages are uprev'd.

Where necessary I might take a more proactive approach and post backports to Gentoo before a new revision is released with the toolchain fix. 

Can you please merge the fix for this bug when you have some time? Thanks again!
Comment 3 Larry the Git Cow gentoo-dev 2022-01-14 13:58:25 UTC
The bug has been referenced in the following commit(s):

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

commit cc00a665f6f530f46069d28707a63775f518423d
Author:     Adrian Ratiu <adrian.ratiu@collabora.com>
AuthorDate: 2022-01-13 11:59:09 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-01-14 13:56:07 +0000

    media-video/ffmpeg: fix mixed strip usage
    
    Even though stripping is disabled for compiled binaries
    (--disable-stripping), some configure phase test binaries
    get stripped and this causes Clang builds to use the GNU
    strip instead of LLLVM strip.
    
    Fix this by specifying to configure the proper version of
    strip to be used via --strip="$(tc-getSTRIP)"
    
    Bug: https://bugs.gentoo.org/831128
    Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
    Closes: https://github.com/gentoo/gentoo/pull/23770
    Signed-off-by: Sam James <sam@gentoo.org>

 media-video/ffmpeg/ffmpeg-4.2.4-r1.ebuild | 1 +
 media-video/ffmpeg/ffmpeg-4.3.1-r1.ebuild | 1 +
 media-video/ffmpeg/ffmpeg-4.3.2-r1.ebuild | 1 +
 media-video/ffmpeg/ffmpeg-4.4-r1.ebuild   | 1 +
 media-video/ffmpeg/ffmpeg-4.4.1-r1.ebuild | 1 +
 media-video/ffmpeg/ffmpeg-9999.ebuild     | 1 +
 6 files changed, 6 insertions(+)
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-01-14 14:01:28 UTC
(In reply to adi from comment #2)
> Thank you Sam for all your support.
> 
> Yes, I would like to push my toolchain blocklisting patches eventually, but
> until then I'm very focused on fixing the discovered bugs.
> 
> Beside this type of ebuild fixes, I also have various patches pending in
> upstream projects like this one (https://github.com/brltty/brltty/pull/353)
> which will eventually be merged and trickle down to more distros as packages
> are uprev'd.
> 
> Where necessary I might take a more proactive approach and post backports to
> Gentoo before a new revision is released with the toolchain fix. 
> 
> Can you please merge the fix for this bug when you have some time? Thanks
> again!

Sounds good to me. Just let me know if I'm needed. Backports are welcome too (although preferred when merged upstream, that's not always possible).

Merged -- had to fix the copyright years (`pkgdev commit` and `repoman commit` will both do this for you, but `pkgcheck scan --commits` would detect it too) and should've fixed the Bug -> Closes tag but didn't realise :)

As for that PR, looks good, but I actually wonder why / if they're using LD at all. It's much easier for everyone if they're not invoking ld directly and can just dump the check entirely.