gpgme-config largefile support missmatch?

Marcus Brinkmann marcus.brinkmann at ruhr-uni-bochum.de
Thu Jun 16 17:27:22 CEST 2011


On 06/16/2011 03:44 PM, Bernhard Reiter wrote:
> I did read the section in the gpgme manual before I had posted the question.
>
> As I understood it, either gpgme-config --cflags is wrong
> by not printing "-D_FILE_OFFSET_BITS=64 -DLARGEFILE_SOURCE=1"
> or the section in "Building the Source" is missleading that recommends:
>   gcc -c foo.c `gpgme-config --cflags`
> if would need to hint upon that largefile options might also be necessary
> in addition.

gpgme-config and largefile support are two different sections in the manual,
and have nothing to do with each other.

The reason is that the cflags to locate the header file are only relevant for
that one source file.  The largefile support however must be consistent across
the whole application domain.  It's worse than you think.  For example, if two
applications exchange file descriptors over a pipe, then both applications
must agree on the largefile support in order to handle descriptors to large
files correctly.  No isolated compiler flag alone can ensure that.  (BTW, if
systems using for example dbus-daemon and descriptor passing over dbus
channels get this right, it is probably by accident rather than by being
conscious about the issue!  POSIX/C programming has many pitfalls, many of
them are quite obscure.  Tread carefully.)

Accidently compiling some files with and some files without largefile support
would only make the matter more confusing.

> BTW: gpgme-config --help
> outputs the line
>   [--thread={ pth pthread pthread}]
> shouldn't this be
>   [--thread={ pth pthread}]
> ?

It is correct here.

Thanks,
Marcus




More information about the Gnupg-devel mailing list