public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
* Now problem with make recursion in 1.16.0
@ 2016-10-11 20:11 Grant Edwards
  2016-10-11 22:14 ` Grant Edwards
  0 siblings, 1 reply; 2+ messages in thread
From: Grant Edwards @ 2016-10-11 20:11 UTC (permalink / raw)
  To: crossgcc

I'm trying to rebuild a toolchain using ctng-1.16.0 (updating isn't
really an option at this point in time).

At some point within the past year, the build worked fine.  Now it
fails.  The build script, configuration files, and all source files
are under version control.  I'm positive they haven't changed.  What
probably has changed are the versions of make and autotools that are
running on the build host.

Here's the output from my build process:

  ** removing existing crosstool-NG directory

  ** unpacking crosstool-ng-1.16.0.tar.bz2

  ** copying patches into crosstool-ng
  ‘patches-1.16.0/ppl/0.11.2/400-fix-redefinition-numeric-limits.patch’ -> ‘crosstool-ng-1.16.0/patches/ppl/0.11.2/400-fix-redefinition-numeric-limits.patch’
  ~/nobackup/crosstool/crosstool-ng-1.16.0 ~/nobackup/crosstool

  ** configuring crosstool-NG with --local
  checking build system type... x86_64-unknown-linux-gnu
  checking host system type... x86_64-unknown-linux-gnu
  checking for a BSD-compatible install... /usr/bin/install -c
  [...]
  configure: overiding all of --prefix and the likes, because --enable-local was set
  configure: creating ./config.status
  config.status: creating Makefile

  ** building crosstool-NG
  Makefile:115: *** Recursion detected, bailing out....  Stop.
  Makefile:120: recipe for target 'build' failed
  make: *** [build] Error 2

Looking at the Makefile, I see this:

  # Somehow, the new auto-completion for make in the recent distributions
  # trigger a behavior where our Makefile calls itself recursively, in a
  # never-ending loop (except on lack of ressources, swap, PIDs...)
  # Avoid this situation by cutting the recursion short at the first
  # level.
  # This has the side effect of only showing the real targets, and hiding our
  # internal ones. :-)
  ifneq ($(MAKELEVEL),0)
  $(error Recursion detected, bailing out...)
  endif

Can somebody explain what "auto-completion" is being referred to?

How is immediately failing when recursion is detected supposed to work
around the problem?

-- 
Grant Edwards               grant.b.edwards        Yow! I've read SEVEN
                                  at               MILLION books!!
                              gmail.com            


--
For unsubscribe information see http://sourceware.org/lists.html#faq

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Now problem with make recursion in 1.16.0
  2016-10-11 20:11 Now problem with make recursion in 1.16.0 Grant Edwards
@ 2016-10-11 22:14 ` Grant Edwards
  0 siblings, 0 replies; 2+ messages in thread
From: Grant Edwards @ 2016-10-11 22:14 UTC (permalink / raw)
  To: crossgcc

On 2016-10-11, Grant Edwards <grant.b.edwards@gmail.com> wrote:

> I'm trying to rebuild a toolchain using ctng-1.16.0 (updating isn't
> really an option at this point in time).
>
> At some point within the past year, the build worked fine.  Now it
> fails.  The build script, configuration files, and all source files
> are under version control.  I'm positive they haven't changed.  What
> probably has changed are the versions of make and autotools that are
> running on the build host.

The ct-ng Makefile wants to be run with '-R -r' flags.  So, it checks
the MAKEFLAGS, and if it's not happy it munges them a bit and then
calls itself recrusively with the MAKEFLAGS it wants.

The problem is that the MAKEFLAGS munging it does doesn't result in
MAKEFLAGS that make the child happy, so it would recurse forever if
not caught and failed by the MAKELEVEL check.

The ct-ng Makefile is checking to see if the MAKEFLAGS contain Rr or
-Rr, but there's no guarantee of the order the flag characters are
going to show up.  In my case, the initial make adds "-Rr" to
MAKEFLAGS, but what the child gets is 'rR' which doesn't satisfy it,
so the whole thing repeats.

I doubt that anybody cares, but here's the patch to Makefile.in that
fixes the problem:

------------------------------------------------------------------------------
diff -r -U5 orig/crosstool-ng-1.16.0/Makefile.in fixed/crosstool-ng-1.16.0/Makefile.in
--- orig/crosstool-ng-1.16.0/Makefile.in	2012-08-04 16:41:28.000000000 -0500
+++ fixed/crosstool-ng-1.16.0/Makefile.in	2016-10-11 16:42:14.798098680 -0500
@@ -24,11 +24,15 @@
 # Note: dual test, because if -R and -r are given on the command line
 # (who knows?), MAKEFLAGS contains 'Rr' instead of '-Rr', while adding
 # '-Rr' to MAKEFLAGS adds it literaly ( and does not add 'Rr' )
 ifeq ($(filter Rr,$(MAKEFLAGS)),)
 ifeq ($(filter -Rr,$(MAKEFLAGS)),)
+ifeq ($(filter rR,$(MAKEFLAGS)),)
+ifeq ($(filter -rR,$(MAKEFLAGS)),)
 CT_MAKEFLAGS += -Rr
+endif # No -rR
+endif # No rR
 endif # No -Rr
 endif # No Rr
 
 # Remove any suffix rules
 .SUFFIXES:
------------------------------------------------------------------------------

-- 
Grant Edwards               grant.b.edwards        Yow! Let me do my TRIBUTE
                                  at               to FISHNET STOCKINGS ...
                              gmail.com            


--
For unsubscribe information see http://sourceware.org/lists.html#faq

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-10-11 22:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-11 20:11 Now problem with make recursion in 1.16.0 Grant Edwards
2016-10-11 22:14 ` Grant Edwards

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).