[MPlayer-dev-eng] Why is _FILE_OFFSET_BITS=64 and _LARGEFILE_SOURCE forced?

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Thu Feb 19 15:10:53 CET 2009


On Thu, Feb 19, 2009 at 02:58:04PM +0100, Hans-Christian Egtvedt wrote:
> On Thu, 19 Feb 2009 14:27:03 +0100
> Reimar Döffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de> wrote:
> > This is almost certainly related to AVR32 support, so I think in this
> > case it was justified to ask here.
> 
> Actually it is related to uClibc. If you define _FILE_OFFSET_BITS=64
> and did not compile uClibc with largefile support, it will halt with an
> #error output. It is a check in uClibc header include/features.h.
> 
> AFAICT the -dev list is for discussing source code changes, while
> -users is for users of the source code?

Yes, your first mail just did not seem related to making source code
changes...

> > It is a user question in so far that "configure --help" has the
> > answer: --disable-largefiles   disable support for files > 2GB
> > [enable] thus largefile support must be explicitly disabled if you do
> > not want it.
> 
> That is already done, i.e. providing --disable-largefiles if largefile
> is not available in the toolchain. But the CFLAGS is still set with
> _FILE_OFFSET_BITS and _LARGEFILE_SOURCE in MPlayer source common.mak.

That seems like a bug, unless you are using FreeBSD?
The only place I see _FILE_OFFSET_BITS in configure is:
if test "$_largefiles" = yes || freebsd ; then
  CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"

So if it is in your config.mak when you specify --disable-largefiles
either you are running FreeBSD (and we will have to find out what the
point of that freebsd check is) or you have CFLAGS set in your
environment or it is a complete mystery to me (actually, after reading
to the end I realized what the issue is)...

> > The reason is that systems without it can not even play DVDs properly,
> > so hardly anyone will want it disabled.
> 
> I'll make a note of disabling DVD support if largefile is not present,
> although, I guess systems running uClibc without largefile support
> seldom wants to play DVDs.

Well, it applies to any file > 2GB, including files played over FTP or
SMB shares or whatever. They usually play but seeking is broken.

> > Also it will not usually break builds, systems without largefile
> > support usually just ignore _FILE_OFFSET_BITS and _LARGEFILE_SOURCE.
> 
> For uClibc users this is not the case.
> 
> Could the define be removed from the initial CFLAGS in common.mak, and
> added if the --disable-largefiles switch is not set?

Oh, it is in common.mak... Hm, that file is copied 1:1 from FFmpeg, you
should ask them about it IMO...
I think from our side we could just remove them since they are already
part of our OPTFLAGS unless --disable-largefiles was used, but it is
better to keep that file in-sync with the FFmpeg version, and I am
unsure what could break in FFmpeg (probably nothing that MPlayer uses,
but I do not know).



More information about the MPlayer-dev-eng mailing list