[MPlayer-dev-eng] [PATCH] Get rid of -D_GNU_SOURCE

Diego Biurrun diego at biurrun.de
Tue Dec 12 21:11:43 CET 2006


On Fri, Dec 08, 2006 at 02:01:19PM -0500, Rich Felker wrote:
> On Fri, Dec 08, 2006 at 07:47:03PM +0100, Diego Biurrun wrote:
> > On Fri, Dec 08, 2006 at 10:07:34AM -0500, Rich Felker wrote:
> > > On Fri, Dec 08, 2006 at 02:35:19PM +0100, Diego Biurrun wrote:
> > > > > -CFLAGS= -D__USE_UNIX98 -D_GNU_SOURCE \
> > > > > +CFLAGS= -D__USE_UNIX98 \
> > > > >  	-DHAVE_LIMITS_H -DHAVE_ERRNO_H -DHAVE_INTTYPES_H -DHAVE_UNISTD_H \
> > > > >  	-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DVERSION=\"1.2.9\"
> > > > 
> > > > ... for external libraries I'm not so sure.  If they are compiled with
> > > > _GNU_SOURCE upstream then I think we should use the same configuration.
> > > 
> > > Why? -D_GNU_SOURCE is always wrong.. If there really are GNU
> > > dependencies they should be found and removed.
> > 
> > Modifications to external libraries should be as minimal as possible
> > IMO and when we do modifications we should try to send them upstream.
> > 
> > For libdvdcss and libdvdread I'm afraid the change might introduce
> > subtle breakage and/or a library that behaves slightly different than
> > the upstream version.  This is not good.
> 
> If the code depends on GNU functions, then we'll get warnings and fix
> it once -D_GNU_SOURCE is removed.

Yes.  And we should do this for our native stuff ASAP.

> If the code depends on incorrect GNU semantics in standardized
> functions (which conflict with POSIX) then the code is already
> _BROKEN_ on non-GNU implementations, and -D_GNU_SOURCE just works
> around the problem on GNU systems. If this is the case it's better to
> let it break then find the problems and fix it rather than having
> subtle bugs. But I doubt it's the case anyway.

This is what I'm worried about.

I suggest that we do this for our native stuff, watch the fallout and
then decide for included libraries.

> If you're worried about differing from upstream we should complain to
> upstream and ask them to remove the -D_GNU_SOURCE.

Yes.  My philosophy is to differ from upstream as little as possible.

Diego



More information about the MPlayer-dev-eng mailing list