[FFmpeg-devel] [PATCH] configure: add LIBDRM to extralibs_avutil

Giulio Benetti giulio.benetti at micronovasrl.com
Tue Sep 11 23:59:54 EEST 2018


Hello,

Il 11/09/2018 22:49, James Almer ha scritto:
> On 9/11/2018 5:29 PM, Giulio Benetti wrote:
>> When static linking programs using ffmpeg libraries, if linking against
>> libavutil, -ldrm is listed before -lavutil. This leads to linking failure
>> due to undefined reference of drmGetVersion() and drmFreeVersion().
>> This is why when pkg-config create libavutil.pc doesn't append -ldrm
>> after -lavutil.
>>
>> Create LIBDRM=-ldrm in case libdrm is enabled and add $LIBDRM to
>> extralibs_avutil.
> 
> I'm not sure i understand. libdrm is already added to avutil extralibs,
> seeing it's listed in the "avutil_suggest" line in configure. I see it's
> also added to avdevice if kmsgrab_indev is enabled.
> 
> The -ldrm ldflag, assuming the libdrm pkg-config file is correct, should
> be in $avutil_extralibs when configure dumps it into extralibs_avutil
> for the purpose of creating libavutil.pc.
> 

I point you a build failure, so it should be more clear.
I did my best to explain on commit log, but it wasn't easy.

http://autobuild.buildroot.net/results/515/5152dcca58944cf732d09fba6e6c9af8a9243c75/build-end.log

In that case .configure file is different but the point is the same.

At the end of the log you can see that -ldrm is yes present, but it 
comes too early respect to -lavutil.
This situation is valid only in the case you link *statically*.
For dynamic linking there's no problem at all.

Thanks and
Best regards
Giulio Benetti


More information about the ffmpeg-devel mailing list