[FFmpeg-devel] [PATCH] restoring binary compatibility with ffmpeg 0.5
Michael Niedermayer
michaelni
Thu Jun 10 14:43:31 CEST 2010
On Thu, Jun 10, 2010 at 12:57:42PM +0200, Reinhard Tartler wrote:
> On Thu, Jun 10, 2010 at 11:38:52 (CEST), Michael Niedermayer wrote:
>
> > On Thu, Jun 10, 2010 at 09:52:13AM +0100, M?ns Rullg?rd wrote:
> >> Reinhard Tartler <siretart at tauware.de> writes:
> >>
> >> > On Wed, Jun 09, 2010 at 19:41:33 (CEST), Michael Niedermayer wrote:
> >> >
> >> >> On Wed, Jun 09, 2010 at 03:42:13PM +0200, Reinhard Tartler wrote:
> >> >>> Two questions:
> >> >>> a) doesn't this attribute need to be at symbol declaration and not
> >> >>> definition?
> >> >>
> >> >> The way i understand it, it needs to be at the definition
> >> >> at the declaration it possibly means a weak refernce which is something
> >> >> that is 0 (instead of failing to link) if no definition is found
> >> >
> >> > I see.
> >> >
> >> > I've now tried your suggestion to (re)introduce the functions like you
> >> > propose:
> >> >
> >> > #if LIBAVFORMAT_VERSION_MAJOR < 53
> >> > [...]
> >> > void __attribute__((weak)) av_init_packet(AVPacket *pkt)
> >> > {
> >> > abort();
> >> > }
> >> > #endif
> >> >
> >> > building a shared libavformat.so works without warnings/errors regarding
> >> > symbol collisions and results this
> >> >
> >> > $ readelf -s /tmp/ffmpeg-trunk/lib/libavformat.so | grep av_init_packet@
> >> > 466: 000abc00 8 FUNC WEAK DEFAULT 13 av_init_packet@@LIBAVFORMAT_52
> >> >
> >> > I guess this is exactly what you've expected here.
> >> >
> >> > With this setup, I've now tried both the ffplay binary from this
> >> > compilation and the system /usr/bin/ffplay (based on version 0.5.2). In
> >> > *both* cases, it seems that the binary at runtime picks up the version
> >> > in libavformat:
> >> >
> >> >>> readelf -s /tmp/ffmpeg-trunk/bin/ffplay | grep av_init_packet
> >> > 49: 00000000 0 FUNC GLOBAL DEFAULT UND av_init_packet at LIBAVFORMAT_52 (10)
> >> >
> >> >>> /tmp/ffmpeg-trunk/bin/ffplay /tmp/foo.avi
> >> > FFplay version SVN-r23556, Copyright (c) 2003-2010 the FFmpeg developers
> >> > built on Jun 10 2010 08:09:17 with gcc 4.4.3
> >> > configuration: --enable-avfilter --enable-libvpx --enable-shared --disable-static --enable-gpl --prefix=/tmp/ffmpeg-trunk --enable-postproc --enable-libvorbis
> >> > libavutil 50.18. 0 / 50.18. 0
> >> > libavcodec 52.75. 1 / 52.75. 1
> >> > libavformat 52.68. 0 / 52.68. 0
> >> > libavdevice 52. 2. 0 / 52. 2. 0
> >> > libavfilter 1.20. 0 / 1.20. 0
> >> > libswscale 0.11. 0 / 0.11. 0
> >> > libpostproc 51. 2. 0 / 51. 2. 0
> >> > zsh: abort /tmp/ffmpeg-trunk/bin/ffplay /srv/media/UDS-Sevilla.avi
> >>
> >> This is what I would expect. The weak attribute is only used when
> >> combining relocatable object files in to an executable or shared
> >> object, not during runtime dynamic linking.
> >
> > until reinhard posts a readelf of libavcodec that shows a global
> > av_init_packet at LIBAVFORMAT_52 this conclusion is unfounded
>
> Right, I did not change the version tag in libavcodec. But also adding
> it doesn't matter:
>
> $ readelf -s /tmp/ffmpeg-trunk/lib/libavcodec.so | grep av_init_packet@
> 1280: 000c3d90 88 FUNC GLOBAL DEFAULT 13 av_init_packet@@LIBAVFORMAT_52
>
> $ readelf -s /tmp/ffmpeg-trunk/lib/libavformat.so | grep av_init_packet@
> 466: 000abc00 8 FUNC WEAK DEFAULT 13 av_init_packet@@LIBAVFORMAT_52
>
> $ readelf -s /tmp/ffmpeg-trunk/bin/ffplay | grep av_init_packet@
> 49: 00000000 0 FUNC GLOBAL DEFAULT UND av_init_packet at LIBAVFORMAT_52 (10)
>
> $ /tmp/ffmpeg-trunk/bin/ffplay /srv/media/UDS-Sevilla.avi
> FFplay version SVN-r23556, Copyright (c) 2003-2010 the FFmpeg developers
> built on Jun 10 2010 08:09:17 with gcc 4.4.3
> configuration: --enable-avfilter --enable-libvpx --enable-shared --disable-static --enable-gpl --prefix=/tmp/ffmpeg-trunk --enable-postproc --enable-libvorbis
> libavutil 50.18. 0 / 50.18. 0
> libavcodec 52.75. 1 / 52.75. 1
> libavformat 52.68. 0 / 52.68. 0
> libavdevice 52. 2. 0 / 52. 2. 0
> libavfilter 1.20. 0 / 1.20. 0
> libswscale 0.11. 0 / 0.11. 0
> libpostproc 51. 2. 0 / 51. 2. 0
> zsh: abort /tmp/ffmpeg-trunk/bin/ffplay /srv/media/UDS-Sevilla.avi
>
> $ /usr/bin/ffplay /srv/media/UDS-Sevilla.avi
> FFplay version SVN-r0.5.1-4:0.5.1-1ubuntu1, Copyright (c) 2003-2009 Fabrice Bellard, et al.
> configuration: --extra-version=4:0.5.1-1ubuntu1 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --disable-stripping --disable-vhook --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394 --enable-shared --disable-static
> libavutil 49.15. 0 / 49.15. 0
> libavcodec 52.20. 1 / 52.75. 1
> libavformat 52.31. 0 / 52.68. 0
> libavdevice 52. 1. 0 / 52. 2. 0
> libavfilter 0. 4. 0 / 0. 4. 0
> libswscale 0. 7. 1 / 0.11. 0
> libpostproc 51. 2. 0 / 51. 2. 0
> built on Mar 4 2010 12:35:30, gcc: 4.4.3
> zsh: abort /usr/bin/ffplay /srv/media/UDS-Sevilla.avi
>
>
> anything else I can/should try?
for the record it works with export LD_DYNAMIC_WEAK=1
and the default of this variable has changed over time ;)
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Observe your enemies, for they first find out your faults. -- Antisthenes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100610/fc63d5c9/attachment.pgp>
More information about the ffmpeg-devel
mailing list