bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] build: workaround for some cpp that causes an infinite recur


From: Akim Demaille
Subject: Re: [PATCH] build: workaround for some cpp that causes an infinite recursion
Date: Fri, 16 Jan 2015 09:30:50 +0100

> Le 15 janv. 2015 à 16:29, PHO <address@hidden> a écrit :
> 
> Yes. I just checked out the repository and reproduced exactly the same
> problem. My workaround still did the trick.

OK, so I'll install this. I'm not a big fan of top_builddir, since
that's exactly ",".  I installed the appended version of your
patch.  Is there a more complete name to thank than "Pho"?

commit fb540e024d5e658b8844d53870ceaff5059e5ed1
Author: Akim Demaille <address@hidden>
Date:   Fri Jan 16 09:25:37 2015 +0100

    build: avoid infinite recursions on include_next
    
    On MacOS X 10.5 PPC with Apple's GCC 4.0.1:
    
      % uname -a
      Darwin aria.cielonegro.org 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 
16:57:0
      1 PDT 2009; root:xnu-1228.15.4~1/RELEASE_PPC Power Macintosh
      % gcc --version
      powerpc-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5493)
      Copyright (C) 2005 Free Software Foundation, Inc.
      This is free software; see the source for copying conditions.  There is NO
      warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR 
PURPOSE.
    
    building in place enters into an infinite recursion on "#include_next":
    
      % gmake V=1
      [snip]
      depbase=`echo lib/math.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
      gcc -std=gnu99    -I. -Ilib -I. -I./lib   -g -O2 -MT lib/math.o -MD -MP 
-MF $depbase.Tpo -c -o lib/math.o lib/math.c &&\
      mv -f $depbase.Tpo $depbase.Po
      In file included from lib/math.h:27,
                       from lib/math.h:27,
                       from lib/math.h:27,
                       from lib/math.h:27,
      [snip]
                       from lib/math.h:27,
                       from lib/math.h:27,
                       from lib/math.c:3:
      lib/math.h:27:23: error: #include nested too deeply
      Makefile:3414: recipe for target 'lib/math.o' failed
      gmake[2]: *** [lib/math.o] Error 1
    
    Using -I./lib instead of -Ilib fixes the problem.
    
    Reported by Pho.
    <https://lists.gnu.org/archive/html/bison-patches/2014-01/msg00000.html>
    
    * Makefile.am (AM_CPPFLAGS): Use -I./lib instead of -Ilib.

diff --git a/Makefile.am b/Makefile.am
index fd3db0f..b6135cb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -39,8 +39,9 @@ AM_YFLAGS = -d -v -Werror -Wall -Wno-yacc --report=all
 
 # Initialization before completion by local.mk's.
 AM_CFLAGS = $(WARN_CFLAGS)
-# Find builddir/src/scan-code.c etc.
-AM_CPPFLAGS = -I. -Ilib -I$(top_srcdir) -I$(top_srcdir)/lib
+# Find builddir/src/scan-code.c etc.  For some reason "-I./lib"
+# instead of "-Ilib" avoids infinite recursions on #include_next.
+AM_CPPFLAGS = -I. -I./lib -I$(top_srcdir) -I$(top_srcdir)/lib
 BUILT_SOURCES =
 CLEANFILES =
 DISTCLEANFILES =
diff --git a/THANKS b/THANKS
index b984910..875ac96 100644
--- a/THANKS
+++ b/THANKS
@@ -113,6 +113,7 @@ Peter Fales               address@hidden
 Peter Hamorsky            address@hidden
 Peter Simons              address@hidden
 Petr Machata              address@hidden
+Pho                       address@hidden
 Piotr Gackiewicz          address@hidden
 Quentin Hocquet           address@hidden
 Quoc Peyrot               address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]