Patchwork PATCH RFA: Build system: Use AC_SYS_LARGEFILE

login
register
mail settings
Submitter Paolo Bonzini
Date Nov. 9, 2010, 2:15 p.m.
Message ID <4CD9578B.6010208@gnu.org>
Download mbox | patch
Permalink /patch/70549/
State New
Headers show

Comments

Paolo Bonzini - Nov. 9, 2010, 2:15 p.m.
> bconfig.h includes auto-host.h, which defines _LARGE_FILES.
> 
> libcpp/directives.c also fails with similar errors, although it is not
> obvious how headers are included in the wrong order
> 
> I have no objection to enabling LARGE FILES support in GCC, but the
> headers must be included in the correct order to allow bootstrap on
> AIX.

Is something like this enough?
David Edelsohn - Nov. 9, 2010, 2:19 p.m.
Paolo,

There is no problem in libcpp.  There is a warning about freopen
redefined in system.h, but I mistook that for another failure.

The main problem seems to be gengtype-lex.c, which is generated by
Flex.  Flex inserted

#include <stdio.h>

although gengtype-lex.l already includes

#include "bconfig.h"
#include "system.h"

in the correct order and system.h includes stdio.h.

I will try the gengtype-lex.l patch.

Thanks, David

On Tue, Nov 9, 2010 at 9:15 AM, Paolo Bonzini <bonzini@gnu.org> wrote:
>> bconfig.h includes auto-host.h, which defines _LARGE_FILES.
>>
>> libcpp/directives.c also fails with similar errors, although it is not
>> obvious how headers are included in the wrong order
>>
>> I have no objection to enabling LARGE FILES support in GCC, but the
>> headers must be included in the correct order to allow bootstrap on
>> AIX.
>
> Is something like this enough?
>
> Index: libcpp/configure.ac
> ===================================================================
> --- libcpp/configure.ac (revision 166028)
> +++ libcpp/configure.ac (working copy)
> @@ -13,6 +13,7 @@ AC_PROG_INSTALL
>  AC_PROG_CC
>  AC_PROG_CXX
>  AC_PROG_RANLIB
> +AC_SYS_LARGEFILE
>
>  # See if we are building gcc with C++.
>  # Do this early so setting lang to C++ affects following tests
> Index: gcc/gengtype-lex.l
> ===================================================================
> --- gcc/gengtype-lex.l  (revision 166028)
> +++ gcc/gengtype-lex.l  (working copy)
> @@ -23,6 +23,10 @@ along with GCC; see the file COPYING3.
>
>  %{
>  #include "bconfig.h"
> +
> +/* stdio.h has been included already by the flex skeleton, so
> +   defining _LARGE_FILES here would break bootstrap on AIX.  */
> +#undef _LARGE_FILES
>  #include "system.h"
>
>  #define malloc xmalloc
>

Patch

Index: libcpp/configure.ac
===================================================================
--- libcpp/configure.ac	(revision 166028)
+++ libcpp/configure.ac	(working copy)
@@ -13,6 +13,7 @@  AC_PROG_INSTALL
 AC_PROG_CC
 AC_PROG_CXX
 AC_PROG_RANLIB
+AC_SYS_LARGEFILE
 
 # See if we are building gcc with C++.
 # Do this early so setting lang to C++ affects following tests
Index: gcc/gengtype-lex.l
===================================================================
--- gcc/gengtype-lex.l	(revision 166028)
+++ gcc/gengtype-lex.l	(working copy)
@@ -23,6 +23,10 @@  along with GCC; see the file COPYING3.  
 
 %{
 #include "bconfig.h"
+
+/* stdio.h has been included already by the flex skeleton, so
+   defining _LARGE_FILES here would break bootstrap on AIX.  */
+#undef _LARGE_FILES
 #include "system.h"
 
 #define malloc xmalloc