[FFmpeg-devel] ffmpeg problems with gcc 4.3

Bernhard Rosenkraenzer bero
Mon Jul 16 18:32:32 CEST 2007

I just tried compiling ffmpeg with a gcc 4.3 snapshot. It results in

libavcodec/libavcodec.a(mpeg12.o): In function `mpeg_decode_slice':
mpeg12.c:(.text+0x1606): undefined reference to `XVMC_init_block'
libavcodec/libavcodec.a(snow.o): In function `encode_q_branch':
snow.c:(.text+0xa2cf): undefined reference to `ff_epzs_motion_search'
snow.c:(.text+0xa3b7): undefined reference to `ff_get_mb_score'

What seems to be going on:

XVMC_init_block is defined as "inline void" in xvmcvideo.c (which, apparently, 
causes gcc 4.3 to optimize away the function's symbol entry -- it's just 
being inlined where it's invoked).

It's also called (and retrieved with "extern void") in mpeg12.c -- but since 
the symbol is being optimized away from xvmcvideo.c, that lookup results in 

The problem with ff_epzs_motion_search and ff_get_mb_score is similar - 
they're declared inline but not defined in files including it (this also 
triggers a new compiler warning in gcc 4.3).

Possible fixes include uninlining (probably causing a performance hit), 
copying the definitions to all files that use them (causing a maintenance 
nightmare), moving them to a separate file and #including them where they're 
needed (quite ugly if it's done directly because some of the inline functions 
rely on static functions defined in the same .c file), and, of course, 
screaming at the gcc developers ;)

I've attached a patch that makes it work (doing the header thing), but I'm the 
first to admit it's ugly.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: libavcodec-gcc-4.3.patch
Type: text/x-diff
Size: 18210 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070716/7673f052/attachment.patch>

More information about the ffmpeg-devel mailing list