Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <54119475.1090208@posteo.de>
Date: Thu, 11 Sep 2014 14:24:21 +0200
From: Jörg Krause <jkrause@...teo.de>
To: musl@...ts.openwall.com
Subject: Re: why is there no __MUSL__ macro?


On 09/11/2014 01:17 PM, Jens wrote:
>
> On Thu, 11 Sep 2014, Jörg Krause wrote:
>> Hi,
>>
>> I am trying to add support for the musl toolchain to FFmpeg.
>>
>> FFmpeg needs support for library features defined in POSIX.1-2001 
>> with XSI extension and the standards
>> below. Currently configure probes the host and target libc by 
>> checking for defined macros like __GLIBC__ and
>> __UCLIBC__. In case of glibc and uclibc it sets -D_XOPEN_SOURCE=600 
>> properly.
>>
>> After this it checks for some combinations of hardware and the probed 
>> libc to set some more compile options,
>> if necessary.
>>
>> I know that musl does not have a macro __MUSL__ and I have read the 
>> explanation. However, I don't understand
>> what's meant by "[..] it's a bug to assume a certain implementation 
>> has particular properties rather than
>> testing." and how does it affect the way FFmpeg probes for the libc.
>
> Maybe the explanation in the FAQ could be a bit more verbose.

Maybe that would help :-)

> But if you stop and think for a bit you'll realize that __MUSL__ would 
> tell you next to nothing. musl and any other libc that is maintained 
> will change with time. You cannot assume a specific functionality by 
> checking for __MUSL__. Bugs will be fixed, functionality will be 
> implemented etc.

I see.

>
> Even if you could check for a specific version of musl you will do 
> most people a disservice since their libc/version wont be handled.
> If instead you check for a specific functionality, it will be 
> independent of libc and version of libc.

I am not sure what you mean with "check for a specific functionality"?

>
> A somewhat limited build of ffmpeg, atleast, works fine with musl:
> OPTPREFIX=opt/av
> configure --prefix=/$OPTPREFIX \
>  --enable-gpl\
>  --enable-small --disable-ffplay --disable-ffprobe --disable-ffserver\
>  --enable-libmp3lame\
>  --enable-libx264 \
>  --disable-network --cc=musl-gcc

I'm using a musl cross-compiling toolchain and the limited build even 
without mp3 and x264 fails for me:

./configure --enable-cross-compile\
  --cross-prefix=/home/joerg/x86_64-linux-musl/bin/x86_64-linux-musl-\
  --arch=x86_64 --target-os=linux\
  --prefix=/home/joerg/test/ffmpeg\
  --enable-gpl\
  --enable-small --disable-ffplay --disable-ffprobe --disable-ffserver\
  --disable-network
[...]
make: *** [libavformat/segment.o] Error 1

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.