Hi,

Back in April of this year, I rebuilt the then current FFmpeg 8.0.1 with clang 
17 and configured with --enable-lto .

For some reason, this is no longer possible, neither with v8.1.2 nor with 
v8.0.1, using the exact same compiler build and FFmpeg configure options (I use 
a framework of scripts to ensure reproducible builds).

>From my build log:
```
/opt/local/bin/clang-mp-17 -Llibavcodec -Llibavdevice -Llibavfilter 
-Llibavformat -Llibavutil -Llibswscale -Llibswresample -L/opt/local/lib 
-Wl,--enable-new-dtags -Wl,-rpath,/opt/local/lib 
-Wl,--plugin-opt=lto-partitions=3 -Wl,-rpath -Wl,/opt/local/libexec/ffmpeg8/lib 
-flto -Ofast -DHAVE_LRINTF -Wno-deprecated-declarations 
-isystem/opt/local/include -Wno-error=incompatible-pointer-types -Ofast 
-Wl,--plugin-opt=lto-partitions=3 -march=westmere -msse4.1 -msse4.2 -msse3 
-mssse3 -msse2 -msse -mmmx -mpclmul -march=westmere  -Wl,--as-needed 
-Wl,-z,noexecstack 
-Wl,-rpath-link=:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil
 -O3 -fno-math-errno -fno-signed-zeros -Qunused-arguments   -o ffmpeg8_g 
fftools/ffmpeg_dec.o fftools/ffmpeg_demux.o fftools/ffmpeg_enc.o 
fftools/ffmpeg_filter.o fftools/ffmpeg_hw.o fftools/ffmpeg_mux.o 
fftools/ffmpeg_mux_init.o fftools/ffmpeg_opt.o fftools/ffmpeg_sched.o 
fftools/graph/graphprint.o fftools/sync_queue.o fftools/thread_queu
 e.o fftools/textformat/avtextformat.o fftools/textformat/tf_compact.o 
fftools/textformat/tf_default.o fftools/textformat/tf_flat.o 
fftools/textformat/tf_ini.o fftools/textformat/tf_json.o 
fftools/textformat/tf_mermaid.o fftools/textformat/tf_xml.o 
fftools/textformat/tw_avio.o fftools/textformat/tw_buffer.o 
fftools/textformat/tw_stdout.o fftools/resources/resman.o 
fftools/resources/graph.html.o fftools/resources/graph.css.o   
fftools/cmdutils.o fftools/opt_common.o fftools/ffmpeg.o  -lavdevice -lavfilter 
-lavformat -lavcodec -lswresample -lswscale -lavutil  -lm -latomic 
-L/opt/local/lib -ldrm -L/opt/local/lib -lxcb -L/opt/local/lib -lxcb-shm 
-L/opt/local/lib -lxcb-shape -L/opt/local/lib -lxcb-xfixes -L/opt/local/lib 
-lasound -L/opt/local/lib -lsndio -pthread -lm -latomic -ldl -L/opt/local/lib 
-llcms2 -L/opt/local/lib -lvmaf -L/opt/local/lib -lass -L/opt/local/lib -lva 
-L/opt/local/lib -lvidstab -lm -L/opt/local/lib -lzimg -lOpenCL 
-L/opt/local/lib -L/usr/lib/x86_64-linux-gnu -lfontco
 nfig -lfreetype -L/opt/local/lib -lfreetype -lm -latomic -lbz2 
-L/opt/local/lib -lmodplug -L/opt/local/lib -lbluray -L/opt/local/lib -lz 
-L/opt/local/lib -lgnutls -L/opt/local/lib -Wl,-rpath,/opt/local/lib 
-lsmbclient -L/opt/local/lib -lvpx -lm -L/opt/local/lib -lvpx -lm 
-L/opt/local/lib -lvpx -lm -L/opt/local/lib -lvpx -lm -L/opt/local/lib 
-lwebpmux -lwebp -pthread -liconv -L/opt/local/lib -llcms2 -lm -latomic -llzma 
-L/opt/local/lib -laribb24 -L/opt/local/lib -ldav1d -L/opt/local/lib -lrsvg-2 
-lm -lgio-2.0 -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lintl -lcairo 
-L/opt/local/lib -lzvbi -lm -lintl -lpthread -lm /opt/local/lib/libiconv.so 
-lpng -lz -L/opt/local/lib -lfdk-aac -lmp3lame -lm -L/opt/local/lib -lopenjp2 
-L/opt/local/lib -lopus -L/opt/local/lib -lspeex -ltheoraenc -ltheoradec -logg 
-L/opt/local/lib -lvorbis -L/opt/local/lib -lvorbisenc -L/opt/local/lib -lwebp 
-L/opt/local/lib -lx264 -L/opt/local/lib -lx265 -lxvidcore -L/opt/local/lib -lz 
-L/opt/local/lib -lva -lm -lsoxr -
 latomic -lm -latomic -L/opt/local/lib -lva-drm -lva -L/opt/local/lib -lva-x11 
-lva -lvdpau -lX11 -lm -L/opt/local/lib -ldrm -lOpenCL -L/opt/local/lib -lva 
-latomic -pthread -L/opt/local/lib -lX11   
:info:build /opt/local/bin/ld: libavcodec/libavcodec.so: undefined reference to 
`ff_mlp_iirorder_3'
:info:build /opt/local/bin/ld: libavcodec/libavcodec.so: undefined reference to 
`ff_mlp_iirorder_1'
:info:build /opt/local/bin/ld: libavcodec/libavcodec.so: undefined reference to 
`ff_mlp_iirorder_2'
:info:build /opt/local/bin/ld: libavcodec/libavcodec.so: undefined reference to 
`ff_mlp_iirorder_0'
:info:build /opt/local/bin/ld: libavcodec/libavcodec.so: undefined reference to 
`ff_mlp_iirorder_4'
```

Indeed, when I run `ldd -r` on libavcodec.so, it confirms that those symbols 
are missing, but according to `nm -U` they should be present the same way they 
are in the libavcodec.so binary from the succesful april build. Or from a build 
using GCC 13 (WITH LTO), which DOES succeed:

```
> nm -U libavcodec/libavcodec.so | fgrep ff_mlp_
0000000000a51910 t ff_mlp_calculate_parity
0000000000f472c0 r ff_mlp_ch_info
0000000000e1a450 r ff_mlp_ch_layouts
00000000010db0c0 d ff_mlp_decoder
000000000109c9c0 d ff_mlp_encoder
00000000004949e1 t ff_mlp_firorder_0
00000000004949d7 t ff_mlp_firorder_1
00000000004949c8 t ff_mlp_firorder_2
00000000004949b9 t ff_mlp_firorder_3
00000000004949aa t ff_mlp_firorder_4
000000000049499b t ff_mlp_firorder_5
000000000049498c t ff_mlp_firorder_6
000000000049497d t ff_mlp_firorder_7
000000000049496e t ff_mlp_firorder_8
0000000000ea12e0 r ff_mlp_huffman_tables
0000000000494a2c t ff_mlp_iirorder_0
0000000000494a1a t ff_mlp_iirorder_1
0000000000494a08 t ff_mlp_iirorder_2
00000000004949f6 t ff_mlp_iirorder_3
00000000004949e4 t ff_mlp_iirorder_4
00000000013ddeb0 b ff_mlp_init_crc.init_static_once
00000000002bd660 t ff_mlp_pack_output
00000000010bb238 d ff_mlp_parser
00000000006a3900 t ff_mlp_read_major_sync
00000000002bd430 t ff_mlp_rematrix_channel
0000000000ca09b0 t ff_mlp_rematrix_channel_avx2_bmi2
0000000000ca0a50 t ff_mlp_rematrix_channel_avx2_bmi2.loop4
0000000000ca0b40 t ff_mlp_rematrix_channel_avx2_bmi2.loop4_shift
0000000000ca09f0 t ff_mlp_rematrix_channel_avx2_bmi2.loop8
0000000000ca0ac0 t ff_mlp_rematrix_channel_avx2_bmi2.loop8_shift
0000000000ca0aa4 t ff_mlp_rematrix_channel_avx2_bmi2.shift
0000000000ca0780 t ff_mlp_rematrix_channel_sse4
0000000000ca0840 t ff_mlp_rematrix_channel_sse4.loop4
0000000000ca0940 t ff_mlp_rematrix_channel_sse4.loop4_shift
0000000000ca07c0 t ff_mlp_rematrix_channel_sse4.loop8
0000000000ca08b0 t ff_mlp_rematrix_channel_sse4.loop8_shift
0000000000ca0891 t ff_mlp_rematrix_channel_sse4.shift
00000000006a37d0 t ff_mlp_restart_checksum
```

Googling the error I found a >10 yo bug report of exactly the same error, but 
IIRC that was on MSWin using Ming.

What might I have updated since April that causes the build to fail? I did 
update `binutils` to 2.46.0 but rolling back to the version I had installed in 
April (2.43.1) does not seem to fix the issue (at least not when I just use 
that older `ld` to regenerate libavcodec.so).

Thanks,
R.

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to