Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 915078 - media-video/ffmpeg-6.0-r6 ‘ff_nv12ToUV_sse2’ does not match original declaration [-Werror=lto-type-mismatch]
Summary: media-video/ffmpeg-6.0-r6 ‘ff_nv12ToUV_sse2’ does not match original declarat...
Status: RESOLVED DUPLICATE of bug 907484
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Media-video project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: lto
  Show dependency tree
 
Reported: 2023-10-02 15:57 UTC by Pietro
Modified: 2024-03-11 05:28 UTC (History)
2 users (show)

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


Attachments
media-video\:ffmpeg-6.0-r6\:20231002-160145.log (ffmpeg-6.0-r6.tar.bz2,48.63 KB, application/x-bzip)
2023-10-02 15:57 UTC, Pietro
Details
emerge --info (file_915078.txt,6.68 KB, text/plain)
2023-10-02 15:58 UTC, Pietro
Details
ffmpeg-6.0-r6-no-lto.log (ffmpeg-6.0-r6-no-lto.tar.bz2,48.58 KB, application/x-bzip)
2023-10-02 16:07 UTC, Pietro
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pietro 2023-10-02 15:57:00 UTC
Created attachment 872045 [details]
media-video\:ffmpeg-6.0-r6\:20231002-160145.log

Hello folks, 

apparently media-video/ffmpeg-6.0-r6 fails to build due to a "‘ff_nv12ToUV_sse2’ does not match original declaration [-Werror=lto-type-mismatch]" error.

>>>
skipping strip -x libswresample/x86/audio_convert.o
sed 's/MAJOR/4/' /var/tmp/portage/media-video/ffmpeg-6.0-r6/work/ffmpeg-6.0/libswresample/libswresample.v | cat > libswresample/libswresample.ver
echo skipping strip -x libavcodec/x86/vp9lpf_16bpp.o
skipping strip -x libavcodec/x86/vp9lpf_16bpp.o
echo skipping strip -x libavcodec/x86/vp9itxfm_16bpp.o
skipping strip -x libavcodec/x86/vp9itxfm_16bpp.o
echo skipping strip -x libavcodec/x86/hevc_mc.o
skipping strip -x libavcodec/x86/hevc_mc.o
echo skipping strip -x libavcodec/x86/vp9lpf.o
skipping strip -x libavcodec/x86/vp9lpf.o
cd ./libavutil/ && ln -s -f libavutil.so.58 libavutil.so
x86_64-pc-linux-gnu-gcc -shared -Wl,-soname,libswscale.so.7 -Wl,-Bsymbolic -Wl,--version-script,libswscale/libswscale.ver -Llibavcodec -Llibavdevice -Llibavfilter -Llibavformat -Llibavutil -Llibpostproc -Llibswscale -Llibswresample -Wl,-O1 -Wl,--as-needed   -Wl,--as-needed -Wl,-z,noexecstack -Wl,--warn-common -Wl,-rpath-link=:libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil -march=alderlake -O2 -pipe -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -fno-math-errno -fno-signed-zeros -flto -fno-tree-vectorize  -o libswscale/libswscale.so.7 libswscale/alphablend.o libswscale/gamma.o libswscale/half2float.o libswscale/hscale.o libswscale/hscale_fast_bilinear.o libswscale/input.o libswscale/options.o libswscale/output.o libswscale/rgb2rgb.o libswscale/slice.o libswscale/swscale.o libswscale/swscale_unscaled.o libswscale/utils.o libswscale/version.o libswscale/vscale.o libswscale/x86/hscale_fast_bilinear_simd.o libswscale/x86/input.o libswscale/x86/output.o libswscale/x86/rgb2rgb.o libswscale/x86/rgb_2_rgb.o libswscale/x86/scale.o libswscale/x86/scale_avx2.o libswscale/x86/swscale.o libswscale/x86/yuv2rgb.o libswscale/x86/yuv2yuvX.o libswscale/x86/yuv_2_rgb.o libswscale/yuv2rgb.o libswscale/log2_tab.o -lavutil -lm -latomic -pthread -lva-drm -lva -lva-x11 -lva -lvdpau -lX11 -lm -lva -latomic -lX11 
x86_64-pc-linux-gnu-gcc -shared -Wl,-soname,libpostproc.so.57 -Wl,-Bsymbolic -Wl,--version-script,libpostproc/libpostproc.ver -Llibavcodec -Llibavdevice -Llibavfilter -Llibavformat -Llibavutil -Llibpostproc -Llibswscale -Llibswresample -Wl,-O1 -Wl,--as-needed   -Wl,--as-needed -Wl,-z,noexecstack -Wl,--warn-common -Wl,-rpath-link=:libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil -march=alderlake -O2 -pipe -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -fno-math-errno -fno-signed-zeros -flto -fno-tree-vectorize  -o libpostproc/libpostproc.so.57 libpostproc/postprocess.o libpostproc/version.o -lavutil -lavutil -lm -latomic -pthread -lva-drm -lva -lva-x11 -lva -lvdpau -lX11 -lm -lva -latomic -lX11 -pthread -lva-drm -lva -lva-x11 -lva -lvdpau -lX11 -lm -lva -latomic -lX11 
x86_64-pc-linux-gnu-gcc -shared -Wl,-soname,libswresample.so.4 -Wl,-Bsymbolic -Wl,--version-script,libswresample/libswresample.ver -Llibavcodec -Llibavdevice -Llibavfilter -Llibavformat -Llibavutil -Llibpostproc -Llibswscale -Llibswresample -Wl,-O1 -Wl,--as-needed   -Wl,--as-needed -Wl,-z,noexecstack -Wl,--warn-common -Wl,-rpath-link=:libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil -march=alderlake -O2 -pipe -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -fno-math-errno -fno-signed-zeros -flto -fno-tree-vectorize  -o libswresample/libswresample.so.4 libswresample/audioconvert.o libswresample/dither.o libswresample/options.o libswresample/rematrix.o libswresample/resample.o libswresample/resample_dsp.o libswresample/swresample.o libswresample/swresample_frame.o libswresample/version.o libswresample/x86/audio_convert.o libswresample/x86/audio_convert_init.o libswresample/x86/rematrix.o libswresample/x86/rematrix_init.o libswresample/x86/resample.o libswresample/x86/resample_init.o libswresample/log2_tab.o -lavutil -lavutil -lm -latomic -pthread -lva-drm -lva -lva-x11 -lva -lvdpau -lX11 -lm -lva -latomic -lX11 -pthread -lva-drm -lva -lva-x11 -lva -lvdpau -lX11 -lm -lva -latomic -lX11 
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);
<<<

Not sure but it may related to https://bugs.gentoo.org/907484 .

Thanks
Comment 1 Pietro 2023-10-02 15:58:26 UTC
Created attachment 872046 [details]
emerge --info
Comment 2 Pietro 2023-10-02 16:01:54 UTC
Doesn't build without LTO either.
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-10-02 16:03:21 UTC
(In reply to Pietro from comment #2)
> Doesn't build without LTO either.

That sounds unlikely. Please include a build.log for both builds.
Comment 4 Pietro 2023-10-02 16:07:30 UTC
Created attachment 872047 [details]
ffmpeg-6.0-r6-no-lto.log
Comment 5 Pietro 2023-10-03 08:51:01 UTC
I realised the reason why it was failing to build without LTO is due to 
 "-Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing" in COMMON_FLAGS in make.conf, and the the variables from the nolto.conf file were all pointing to $COMMON_FLAGS.

So I edited nolto.conf file as such and I was able to build the package.
>>>
# Env setup to disable LTO for problem builds
COMMON_FLAGS_NO_LTO="-march=alderlake -O2 -pipe"
CFLAGS="${COMMON_FLAGS_NO_LTO} -fno-lto"
CXXFLAGS="${COMMON_FLAGS_NO_LTO} -fno-lto"
FCFLAGS="${COMMON_FLAGS_NO_LTO} -fno-lto"
FFLAGS="${COMMON_FLAGS_NO_LTO} -fno-lto"
<<<  

However, issue remains when compiling using LTO.

Thanks
Comment 6 Alfred Wingate 2023-11-14 10:08:20 UTC
Issue most likely introduced here when the opaque pointer wasn't added everywhere.

https://github.com/FFmpeg/FFmpeg/commit/f2de911818fbd7e73343803626b697fd0c968121
Comment 7 Kostadin Shishmanov 2023-11-14 10:39:11 UTC
https://bugs.gentoo.org/907484
Comment 8 Alfred Wingate 2024-03-11 05:28:33 UTC

*** This bug has been marked as a duplicate of bug 907484 ***