On Wed, 2 May 2018, Steve Ellcey wrote:

> I tracked this down to driver::maybe_run_linker where it sees the linker
> flags and increments num_linker_inputs, this causes the routine to call
> the linker.   This patch checks to see if we are creating precompiled
> header files and avoids calling the linker in that case.

Making it a global check like this, with an early exit from 
driver::maybe_run_linker, seems wrong to me.  I think the correct logical 
check is, for each output file, whether it is a precompiled header - if it 
is, then num_linker_inputs should not be incremented for that particular 
output file (but if there are other output files that are not precompiled 
headers, or if there are linker input files, num_linker_inputs should 
still be incremented for *those*).  Then the existing logic in the rest of 
driver::maybe_run_linker should run as usual (including the logic to warn 
about explicit linker input files when linking is not done).

-- 
Joseph S. Myers
jos...@codesourcery.com

Reply via email to