[FFmpeg-devel] [PATCH 1/4] libavutil/error: fix build with musl toolchain

Jörg Krause jkrause at posteo.de
Wed Sep 3 10:52:24 CEST 2014


On 09/02/2014 06:03 PM, wm4 wrote:
> On Tue,  2 Sep 2014 12:33:26 +0200
> Jörg Krause <jkrause at posteo.de> wrote:
>
>> Add the feature test macro which is required for building with the
>> musl toolchain.
>>
>> The feature test macro _XOPEN_SOURCE = 600 provides the XSI-compliant
>> version of strerror_r().
>>
>> Signed-off-by: Jörg Krause <jkrause at posteo.de>
>> ---
>>   libavutil/error.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/libavutil/error.c b/libavutil/error.c
>> index bd66354..d326584 100644
>> --- a/libavutil/error.c
>> +++ b/libavutil/error.c
>> @@ -17,6 +17,7 @@
>>    */
>>   
>>   #undef _GNU_SOURCE
>> +#define _XCODE_SOURCE 600
>>   #include "avutil.h"
>>   #include "avstring.h"
>>   #include "common.h"
> This looks good to me, though in the meantime I heard that others
> compile FFmpeg on musl without issues and without having to patch
> anything. I'm not sure why it's breaking in your case; maybe random
> CFLAGS were leaking from pkg-config or other configure checks, which
> makes this work for others.

I checked this with a prebuild x86_64 cross compilation musl toolchain 
from http://musl.codu.org/ and it fails for me (without the patches). Do 
you have some more information about the the successful builds you heard of?

configure does not ascertain the musl libc and so does not set the 
correct -D feature test macros. Maybe if they added the needed macros to 
the CPPFLAGS on command line?

> Also, you probably have to adjust the configure test for
> HAVE_STRERROR_R?

HAVE_STRERROR_R is found and defined to 1.


More information about the ffmpeg-devel mailing list