stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Black <>
Subject Re: svn commit: r463535 - in /incubator/stdcxx/trunk: etc/config/makefile.common etc/config/makefile.rules util/cmdopt.cpp util/display.cpp util/output.cpp util/runall.cpp util/target.h
Date Thu, 19 Oct 2006 17:05:12 GMT
Martin Sebor wrote:
> $ echo foo; echo bar | wc -l
> foo
> 1
> Here's a simple experiment that tries to duplicate what you're
> doing in the patch. AFAICT, it doesn't behave the way we want.
> What am I missing?
> Martin


What happened was I was focusing on the return code propagation, and 
overlooked the output.  I had assumed that the output was being 
correctly propagated, as it was being displayed on the console, but this 
assumption was incorrect.  Attached is a different approach to the 
solution, where the output is redirected to the target log file, then 
echoed back to the console (and teed to LOGFILE) after the 
compile/linking completes.

A disadvantage of this method is that the output may live in the disk 
buffer for a time before being flushed.  If the system happens to crash 
during this time, the log will be lost.  If the crash was caused by the 
compiler or linker, this would lead to a loss of potentially useful 

I tried altering things to use a command similar to the following, but 
the result propagation failed (It seemed to work in bash, but the 
behavior wasn't quite the same in gmake).
{ $(COMMAND) 2>&1 ; cache=$$?; } | tee $@.log; (exit $$cache)

--Andrew Black

View raw message