tech-toolchain archive

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

Re: .debug objects build rule need some care

On Wed, May 26, 2010 at 05:28:57PM +0200, Nicolas Joly wrote:
> Hi,
> After some closer examination to the debug objects build rule, i do
> see the following problems :
> 1) The generated .debug objects needs to have a newer timestamp than
>    the sources. Which currently cannot be guaranteed due to source
>    being modified after target generation.
> 2) The second objcopy call, if failing, will mostly remains unnoticed
>    because of the rm call which will return a `good' status.
> Do the attached patch, which aims at fixing both, look acceptable ?

The touch call seems a gross hack.  What I think you should do is change all
commands to create and work on a ${target-name}.tmp file and, as the very
last command, do a "mv ${target-name}.tmp ${target-name}".  This way you
ensure that the target file is never in an inconsistent state -- only the
.tmp file (or whatever you wanna call it) can be bogus.

Julio Merino

Home | Main Index | Thread Index | Old Index