autoconf: AC_SYS_LARGEFILE should output to CPPFLAGS

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

autoconf: AC_SYS_LARGEFILE should output to CPPFLAGS

Thorsten Glaser-2
On Wed, 25 Jan 2017, Thorsten Glaser wrote:

> Looking at the source, AC_SYS_LARGEFILE calls AC_DEFINE_UNQUOTED,
> which appends to DEFS (which I agree with Tom Dickey is wrong) as
> Florian Weimer said, but — even more confusingly — only when
> AC_CONFIG_HEADERS is not used.
>
> If AC_CONFIG_HEADERS is used, the definition is only written to
> its output file (config.h by default).
>
> This is even more unfortunate, because now, if any program includes
> a glibc system header before "config.h", the definition will be
> ignored, because it comes too late.
>
> CPPFLAGS is r̲e̲a̲l̲l̲y̲ the correct place for this. Again.

Let’s keep track of t̲h̲i̲s̲ bug here <[hidden email]>.
Again, please forward this upstream, too.

The workaround I was forced to use in a real-world package is thus:
https://anonscm.debian.org/cgit/pkg-remote/xrdp.git/plain/debian/patches/lfs.diff?id=e17430063641d44f5596b5bfc1b32ac4ba39f9f1

This feels completely wrong (and breaks with nōn-GCC compilers).

Thanks in advance,
//mirabilos (current hat: Debian Developer)
--
tarent solutions GmbH
Rochusstraße 2-4, D-53123 Bonn • http://www.tarent.de/
Tel: +49 228 54881-393 • Fax: +49 228 54881-235
HRB 5168 (AG Bonn) • USt-ID (VAT): DE122264941
Geschäftsführer: Dr. Stefan Barth, Kai Ebenrett, Boris Esser, Alexander Steeg

_______________________________________________
Autoconf mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/autoconf
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: autoconf: AC_SYS_LARGEFILE should output to CPPFLAGS

Eric Blake-3
On 01/25/2017 10:57 AM, Thorsten Glaser wrote:

> On Wed, 25 Jan 2017, Thorsten Glaser wrote:
>
>> Looking at the source, AC_SYS_LARGEFILE calls AC_DEFINE_UNQUOTED,
>> which appends to DEFS (which I agree with Tom Dickey is wrong) as
>> Florian Weimer said, but — even more confusingly — only when
>> AC_CONFIG_HEADERS is not used.
>>
>> If AC_CONFIG_HEADERS is used, the definition is only written to
>> its output file (config.h by default).
>>
>> This is even more unfortunate, because now, if any program includes
>> a glibc system header before "config.h", the definition will be
>> ignored, because it comes too late.
>>
>> CPPFLAGS is r̲e̲a̲l̲l̲y̲ the correct place for this. Again.
>
> Let’s keep track of t̲h̲i̲s̲ bug here <[hidden email]>.
> Again, please forward this upstream, too.
>
> The workaround I was forced to use in a real-world package is thus:
> https://anonscm.debian.org/cgit/pkg-remote/xrdp.git/plain/debian/patches/lfs.diff?id=e17430063641d44f5596b5bfc1b32ac4ba39f9f1
If the real-world package is not including config.h first, then that is
a bug in the real-world package that should be fixed there.  Autoconf
clearly documents that if you create config.h, it MUST be included
first, before any system headers.

--
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


_______________________________________________
Autoconf mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/autoconf

signature.asc (617 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: autoconf: AC_SYS_LARGEFILE should output to CPPFLAGS

Thorsten Glaser-2
severity 852617 wishlist
tags 852617 = upstream
thanks

On Wed, 25 Jan 2017, Eric Blake wrote:

> If the real-world package is not including config.h first, then that is
> a bug in the real-world package that should be fixed there.  Autoconf

OK, I’ve (separately) reported the bug to xrdp upstream.

> clearly documents that if you create config.h, it MUST be included
> first, before any system headers.

Still not happy with this… it used to “just work”, and this change
is very likely to break existing software (unless — actually, even
if — that requirement was documented “always”, i.e. not added later).

Would you at least *consider* moving the definition back to some
command line argument? (Changing severity to wishlist now; if not,
we can likely close the bug, but I’d still like you to please at
least consider doing the change.)

bye,
//mirabilos
--
tarent solutions GmbH
Rochusstraße 2-4, D-53123 Bonn • http://www.tarent.de/
Tel: +49 228 54881-393 • Fax: +49 228 54881-235
HRB 5168 (AG Bonn) • USt-ID (VAT): DE122264941
Geschäftsführer: Dr. Stefan Barth, Kai Ebenrett, Boris Esser, Alexander Steeg

_______________________________________________
Autoconf mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/autoconf
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: autoconf: AC_SYS_LARGEFILE should output to CPPFLAGS

Zack Weinberg-2
On Wed, Jan 25, 2017 at 12:21 PM, Thorsten Glaser <[hidden email]> wrote:
>
> Would you at least *consider* moving the definition back to some
> command line argument? (Changing severity to wishlist now; if not,
> we can likely close the bug, but I’d still like you to please at
> least consider doing the change.)

As far as I can tell from the Git history, AC_SYS_LARGEFILE has
*always* used AC_DEFINE_UNQUOTED to define the various preprocessor
macros that it can define (_FILE_OFFSET_BITS, _LARGE_FILES, and
_DARWIN_USE_64_BIT_INODE).  That part of the code has been unchanged
since AC_SYS_LARGEFILE was added to specific.m4.

I can see how you got the impression from the documentation that these
are added to CC instead, but that's actually talking about a different
thing that AC_SYS_LARGEFILE can do -- on *one* system, namely IRIX 6,
it may try adding "-n32" to CC.  As a general rule, whenever the
Autoconf manual says that something defines preprocessor macros, you
can assume that it does that with AC_DEFINE(_UNQUOTED).

You're talking about this like it's a regression.  Can you please
verify that it really was an Autoconf upgrade that broke the build of
whatever program you're having trouble with, and if so, report what
the older version was?

zw

_______________________________________________
Autoconf mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/autoconf
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: autoconf: AC_SYS_LARGEFILE should output to CPPFLAGS

Thorsten Glaser-2
On Wed, 25 Jan 2017, Zack Weinberg wrote:

> As far as I can tell from the Git history, AC_SYS_LARGEFILE has
> *always* used AC_DEFINE_UNQUOTED to define the various preprocessor
> macros that it can define (_FILE_OFFSET_BITS, _LARGE_FILES, and
> _DARWIN_USE_64_BIT_INODE).

Interesting, as I recall seeing -D_FILE_OFFSET_BITS=64 on various
compiler command lines when working under GNU. (I normally work
under BSD at home, so I don’t know where exactly.)

> That part of the code has been unchanged
> since AC_SYS_LARGEFILE was added to specific.m4.

Interesting, when was that? (That is, before 2.13? Anything before
that, even I consider ancient ☻)

bye,
//mirabilos
--
tarent solutions GmbH
Rochusstraße 2-4, D-53123 Bonn • http://www.tarent.de/
Tel: +49 228 54881-393 • Fax: +49 228 54881-235
HRB 5168 (AG Bonn) • USt-ID (VAT): DE122264941
Geschäftsführer: Dr. Stefan Barth, Kai Ebenrett, Boris Esser, Alexander Steeg

_______________________________________________
Autoconf mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/autoconf
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: autoconf: AC_SYS_LARGEFILE should output to CPPFLAGS

Zack Weinberg-2
On Wed, Jan 25, 2017 at 1:02 PM, Thorsten Glaser <[hidden email]> wrote:

> On Wed, 25 Jan 2017, Zack Weinberg wrote:
>
>> As far as I can tell from the Git history, AC_SYS_LARGEFILE has
>> *always* used AC_DEFINE_UNQUOTED to define the various preprocessor
>> macros that it can define (_FILE_OFFSET_BITS, _LARGE_FILES, and
>> _DARWIN_USE_64_BIT_INODE).
>
> Interesting, as I recall seeing -D_FILE_OFFSET_BITS=64 on various
> compiler command lines when working under GNU. (I normally work
> under BSD at home, so I don’t know where exactly.)

Is it possible that those programs were not using a config.h?

>> That part of the code has been unchanged
>> since AC_SYS_LARGEFILE was added to specific.m4.
>
> Interesting, when was that? (That is, before 2.13? Anything before
> that, even I consider ancient ☻)

2000-06-08.  According to NEWS, it was not in 2.13 (which was released
1999-05-01), but it was in the very next release, 2.50 (2001-05-21).
The ChangeLog entry for the addition says "Import AC_SYS_LARGEFILE
from largefile.m4 serial 12", so that sounds like there was an add-on
.m4 file with the same functionality floating around prior to that - I
don't know where to find copies of that file.

zw

_______________________________________________
Autoconf mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/autoconf
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: autoconf: AC_SYS_LARGEFILE should output to CPPFLAGS

Paul Eggert
On 01/25/2017 10:24 AM, Zack Weinberg wrote:
> The ChangeLog entry for the addition says "Import AC_SYS_LARGEFILE
> from largefile.m4 serial 12", so that sounds like there was an add-on
> .m4 file with the same functionality floating around prior to that - I
> don't know where to find copies of that file.

It's from gnulib, which in turn got it from coreutils.

Gnulib still has m4/largefile.m4, although now it's merely a copy of
what's in (the next version of) Autoconf. That is, people use the Gnulib
largefile.m4 because they don't want to wait for the next release of
Autoconf to come out.


_______________________________________________
Autoconf mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/autoconf
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: autoconf: AC_SYS_LARGEFILE should output to CPPFLAGS

Thorsten Glaser-2
In reply to this post by Zack Weinberg-2
On Wed, 25 Jan 2017, Zack Weinberg wrote:

> > Interesting, as I recall seeing -D_FILE_OFFSET_BITS=64 on various
> > compiler command lines when working under GNU. (I normally work
> > under BSD at home, so I don’t know where exactly.)
>
> Is it possible that those programs were not using a config.h?

Hm right, that could have been possible… although I also vaguely
recall seeing it on short compile lines, so there would have been
very few -DHAVE_* on it (but that’s not impossible either).

> 2000-06-08.  According to NEWS, it was not in 2.13 (which was released
> 1999-05-01), but it was in the very next release, 2.50 (2001-05-21).
> The ChangeLog entry for the addition says "Import AC_SYS_LARGEFILE
> from largefile.m4 serial 12", so that sounds like there was an add-on
> .m4 file with the same functionality floating around prior to that - I

Hm, possible as well then. (I mostly use 2.13 for old software,
2.61 for new software, when building on my BSD. Debian has more
up-to-date autoconf, and only that, nowadays.)

> don't know where to find copies of that file.

Me either. Well, if it’s this obscure… I could almost say this
issue can be closed, especially since we seem to be going for‐
wards with the documentation issue. (It can still be confusing
for people switching from no config.h to using config.h, but
the suggested documentation change addresses this somewhat
explicitly.)

bye,
//mirabilos
--
15:41⎜<Lo-lan-do:#fusionforge> Somebody write a testsuite for helloworld :-)

_______________________________________________
Autoconf mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/autoconf
Loading...