automake
[Top][All Lists]
Advanced

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

Re: Any way to get rid of -MP parameter to gcc for dependency creation?


From: Xan Lopez
Subject: Re: Any way to get rid of -MP parameter to gcc for dependency creation?
Date: Sat, 8 Jan 2011 20:28:35 +0100

Btw, weird coincidence...

just yesterday there was some refactoring in WebKit that made our
build fail with the good ol' "Argument list too long" error. This time
it happens at the link stage, I guess the object list we are passing
to ld is too long. In the past it was ok to require a patched make to
make the dist tarballs, but requiring a patched make just to compile
the code is obviously a no-no, so we need to solve this somehow.

So, two questions:

a) If we end up doing a gnu-make mode, would it be possible to fix
this somehow in automake? (see old thread for reference
http://www.mail-archive.com/address@hidden/msg02266.html)

b) Any suggestion to workaround it in the meanwhile? We are thinking
of rewriting the link rule and passing ld a file with the list of
objects, since that seems to be supported.

Xan

On Fri, Jan 7, 2011 at 7:44 PM, Ralf Wildenhues <address@hidden> wrote:
> * Xan Lopez wrote on Fri, Jan 07, 2011 at 01:35:48PM CET:
>> On Fri, Jan 7, 2011 at 7:31 AM, Ralf Wildenhues wrote:
>>
>> > Can you, just for the sake of measuring performance, edit the generated
>> > GNUmakefile and remove Automake's 'all' rule from it; something like
>> >  sed -i '/^all: .*BUILT_SOURCES/,/^$/d' GNUmakefile
>> >
>> > It should really prove a big, not a small win, otherwise it's not worth
>> > looking at this further.
>>
>> Indeed, it cuts the total time almost exactly in half.
>
> Very well then.
>
>> Will this also go into the gnu-make mode or is it something we'd have
>> to hack locally?
>
> Good question.  The answer has two parts:
>
> - Overriding the 'all' rule in the .am file should probably be possible,
>  under the expectation that the author knows what she's doing.  We
>  should ensure two things however: warn (without -Wno-override), and
>  ensure that 'all' remains the first target mentioned in the Makefile
>  (this could probably also be done by just adding a stub 'all:' dummy
>  in $output_all).  It should be noted however that any such overriding
>  must be considered a hack, as the details of the 'all' rule are
>  Automake internals.
>
> - Generally avoiding make recursion upon config headers or BUILT_SOURCES
>  is trickier than avoiding -MP.  Most projects using Automake will
>  probably work with something like this:
>
>    %.$(OBJEXT): | $(BUILT_SOURCES) $(generated_headers)
>    %.lo: | $(BUILT_SOURCES) $(generated_headers)
>
>  but BUILT_SOURCES are also used for other things than generated
>  header files, and there might be other files depending on them.
>  So we need some way for users to be able to specify such sets of files
>  if we want to remove this recursion reliably.  And then we need to
>  consider the possibility that BUILT_SOURCES of the latter kind depend
>  on object files to be created beforehand.  Users get fairly annoyed if
>  the build tools creates circular dependencies upon benign input files.
>  ;-)
>
> With the first part addressed, at least you will be able to hack locally
> by merely providing some extra code in GNUmakefile.am (without the need
> to post-process a generated file).
>
> BTW, a similar optimization can probably be made for other recursions,
> e.g., check, and maybe also install; but the latter has more
> complications.
>
> Cheers,
> Ralf
>



reply via email to

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