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 21:57:33 +0100

On Sat, Jan 8, 2011 at 8:42 PM, Ralf Wildenhues <address@hidden> wrote:
>> 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.
>
> What are your portability requirements?  Which systems do you need to
> support, which binutils and GCC versions can you assume, which other
> compilers?  Which make implementation (never mind) and version?

Our main development environment is GNU/Linux, and it's OK to be
pretty aggressive in what we require (for instance, when the next
automake version with gnu-make support is out we'll likely require
that). There's some people building on Windows (under cygwin) and OSX,
but for now the priority is to get our main target system rolling
again.

>
> If new-enough GCC/binutils, then you can use @FILE support; but it's
> also tricky to get the list of files written out without hitting the
> limit.  So, I refer again to the trick used in GCC, which Paolo referred
> you to already: Setup:
>
> # write_entries_to_file - writes each entry in a list
> # to the specified file.  Entries are written in chunks of
> # $(write_entries_to_file_split) to accomodate systems with
> # severe command-line-length limitations.
> # Parameters:
> # $(1): variable containing entries to iterate over
> # $(2): output file
> write_entries_to_file_split = 50
> write_entries_to_file = $(shell rm -f $(2) || :) $(shell touch $(2)) \
>        $(foreach range, \
>          $(shell i=1; while test $$i -le $(words $(1)); do \
>             echo $$i; i=`expr $$i + $(write_entries_to_file_split)`; done), \
>          $(shell echo "$(wordlist $(range), \
>                          $(shell expr $(range) + 
> $(write_entries_to_file_split) - 1), $(1))" \
>             | tr ' ' '\012' >> $(2)))
>
>
> Usage:
>
> target: deps
>        @: $(call write_entries_to_file,$(FILES),$(temp_file_name))
>        do something with $(temp_file_name)
>
> CLEANFILES += $(temp_file_name)

So, I used this and rewrote the link rule to use the @ syntax for ld
in passing the object file list. Unfortunately I seem to be hitting
another bug in gold (the linker I use), since it seems to try to open
all the files referenced in the file at once and it runs out of
descriptors... Not sure why it does not try to do that when passing
the files in the arg list though.

I guess I can try to generate a number of files instead of one, but
this is getting more complicated :/

Any idea to bypass this whole mess?

Xan

>
>
> Note this breaks on EBCDIC systems (yeah, I knew you didn't care).
>
> Cheers,
> Ralf
>



reply via email to

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