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

wm4 nfxjfg at googlemail.com
Thu Sep 4 17:44:13 CEST 2014


On Thu, 4 Sep 2014 17:27:48 +0200
Hendrik Leppkes <h.leppkes at gmail.com> wrote:

> On Wed, Sep 3, 2014 at 11:53 AM, 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>
> > ---
> > Changes v1 -> v2:
> >   - fixed wrong macro name
> >   - add a comment
> > ---
> >  libavutil/error.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/libavutil/error.c b/libavutil/error.c
> > index bd66354..dd1fb30 100644
> > --- a/libavutil/error.c
> > +++ b/libavutil/error.c
> > @@ -17,6 +17,7 @@
> >   */
> >
> >  #undef _GNU_SOURCE
> > +#define _XOPEN_SOURCE 600 /* XSI-compliant version of strerror_r */
> >  #include "avutil.h"
> >  #include "avstring.h"
> >  #include "common.h"
> > --
> > 2.1.0
> >
> > _______________________________________________
> > ffmpeg-devel mailing list
> > ffmpeg-devel at ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
>  _XOPEN_SOURCE 600 is set as a compiler parameter for all other
> toolchains that need it, including glibc and whatnot.
> We should really do the same for musl here, using special treatment is weird.
> 
> Detect musl in configure, add a new libc block, set
> -D_XOPEN_SOURCE=600 in the cflags, and it would be consistent with
> everything else.

musl makes itself undetectable to prevent exactly that:
http://openwall.com/lists/musl/2013/03/29/13


More information about the ffmpeg-devel mailing list