Subject: Re: bsd.lib.mk and cc -MD
To: David Laight <david@l8s.co.uk>
From: Charles M. Hannum <abuse@spamalicious.com>
List: tech-toolchain
Date: 11/16/2003 18:47:36
On Saturday 15 November 2003 05:55 pm, David Laight wrote:
> At the moment bsd.lib.mk runs 'cc ... -o prog.o.tmp' and then does
> 'ld -X -r prog.o.tmp -o prog.o' to remove unwanted local symbols.
>
> This causes problems with my attempts to pass -MD to cc in order
> to get it to create prog.d on the fly - basically it is creating
> prog.o.d instead.
>
> This could be fixed by a 'mv -f prog.o.d prog.d' done iff -MD
> is in CPPFLAGS - but that file is rather repetitious already.
>
> ISTM that 'objcopy -X' could be used instead of 'ld -X' and that
> would significantly simplify the whole makefile (since objcopy
> will use a temporary file in order to update an existing file).

This is probably okay for .o (and .po), IIRC "objcopy -X" loses badly with PIC 
code on MIPS.