Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 907484 - media-video/ffmpeg-6.0-r1 fails to compile (lto): src/libswscale/x86/swscale.c:323:1: error: type of ‘ff_nv12ToUV_avx’ does not match original declaration [-Werror=lto-type-mismatch]
Summary: media-video/ffmpeg-6.0-r1 fails to compile (lto): src/libswscale/x86/swscale....
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Gentoo Media-video project
URL: http://ffmpeg.org/pipermail/ffmpeg-de...
Whiteboard:
Keywords: PATCH, PullRequest
: 915078 (view as bug list)
Depends on:
Blocks: lto
  Show dependency tree
 
Reported: 2023-05-31 12:31 UTC by Kostadin Shishmanov
Modified: 2024-03-11 05:28 UTC (History)
5 users (show)

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


Attachments
build log compressed with zstd (build.log.zst,57.28 KB, application/zstd)
2023-05-31 12:31 UTC, Kostadin Shishmanov
Details
Add opaque parameter (add-missing-parameter.patch,1.01 KB, patch)
2023-11-14 11:05 UTC, Alfred Wingate
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kostadin Shishmanov 2023-05-31 12:31:13 UTC
Created attachment 862966 [details]
build log compressed with zstd

It fails even with -fno-lto added to CFLAGS with package.env, because for some reason the build readds -flto to the right of it at some point.



USE="X bzip2 dav1d encode gnutls gpl iconv lcms mp3 network opengl postproc pulseaudio sdl svg threads truetype vaapi vorbis vulkan x264 xvid zlib"

CFLAGS="-O2 -pipe -flto=auto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing" 

src/libswscale/x86/swscale.c:323:1: error: type of ‘ff_nv12ToUV_avx’ does not match original declaration [-Werror=lto-type-mismatch]
  323 | INPUT_FUNCS(avx);
      | ^
src/libswscale/x86/rgb2rgb_template.c:1821:6: note: type mismatch in parameter 8
 1821 | void RENAME(ff_nv12ToUV)(uint8_t *dstU, uint8_t *dstV,
      |      ^
src/libswscale/x86/rgb2rgb_template.c:1821:6: note: ‘ff_nv12ToUV_avx’ was previously declared here
src/libswscale/x86/swscale.c:321:1: error: type of ‘ff_nv12ToUV_sse2’ does not match original declaration [-Werror=lto-type-mismatch]
  321 | INPUT_FUNCS(sse2);
      | ^
src/libswscale/x86/rgb2rgb_template.c:1821:6: note: type mismatch in parameter 8
 1821 | void RENAME(ff_nv12ToUV)(uint8_t *dstU, uint8_t *dstV,
      |      ^
src/libswscale/x86/rgb2rgb_template.c:1821:6: note: ‘ff_nv12ToUV_sse2’ was previously declared here
Comment 1 Kostadin Shishmanov 2023-07-03 19:50:44 UTC
Did a bisect and this is the first bad commit unless i messed something up:
https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/f2de911818fbd7e73343803626b697fd0c968121

f2de911818fbd7e73343803626b697fd0c968121 is the first bad commit
commit f2de911818fbd7e73343803626b697fd0c968121
Author: Timo Rothenpieler <timo@rothenpieler.org>
Date:   Wed Aug 10 15:12:24 2022 +0200

    swscale: add opaque parameter to input functions

 libswscale/hscale.c           |  12 ++--
 libswscale/input.c            | 149 +++++++++++++++++++++++-------------------
 libswscale/swscale_internal.h |  17 +++--
 libswscale/x86/swscale.c      |  13 ++--
 4 files changed, 106 insertions(+), 85 deletions(-
Comment 2 Alfred Wingate 2023-11-14 11:05:48 UTC
Created attachment 874783 [details, diff]
Add opaque parameter

Setting it to NULL should be fine as its initialised as such and only set to anything meaningful here. https://github.com/FFmpeg/FFmpeg/commit/aca569aad26f33fe68eb36c5c689b2dc4de77084
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-11-14 12:20:15 UTC
Can you send it upstream please?
Comment 5 Alfred Wingate 2023-12-02 13:27:01 UTC
Merged into master

https://github.com/FFmpeg/FFmpeg/commit/e5ce473040ae3e78da80b8a7c6ee35778b21d53c
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-01-24 09:40:35 UTC
(In reply to Alfred Wingate from comment #5)
> Merged into master
> 
> https://github.com/FFmpeg/FFmpeg/commit/
> e5ce473040ae3e78da80b8a7c6ee35778b21d53c

Mind backporting it?
Comment 7 Larry the Git Cow gentoo-dev 2024-01-24 10:58:59 UTC
The bug has been referenced in the following commit(s):

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

commit 38d66d124c45525244dfeb7b994efda5e480549b
Author:     Alfred Wingate <parona@protonmail.com>
AuthorDate: 2024-01-24 10:19:15 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-01-24 10:57:53 +0000

    media-video/ffmpeg: add patch for fixing lto-type-mismatch
    
    Bug: https://bugs.gentoo.org/907484
    Signed-off-by: Alfred Wingate <parona@protonmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/34986
    Signed-off-by: Sam James <sam@gentoo.org>

 ...mpeg-6.0.1-r1.ebuild => ffmpeg-6.0.1-r2.ebuild} |  1 +
 ...mpeg-6.1.1-r1.ebuild => ffmpeg-6.1.1-r2.ebuild} |  1 +
 .../files/ffmpeg-6.0-fix-lto-type-mismatch.patch   | 41 ++++++++++++++++++++++
 3 files changed, 43 insertions(+)
Comment 8 Pietro 2024-02-13 14:41:16 UTC
media-video/ffmpeg-6.0.1-r2 compiles fine with "-Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing".

Thank you :)
Comment 9 Eli Schwartz gentoo-dev 2024-03-06 07:14:22 UTC
Yeah, this is fixed by the above commit.
Comment 10 Alfred Wingate 2024-03-11 05:28:33 UTC
*** Bug 915078 has been marked as a duplicate of this bug. ***