The -Wp,M options behaviour change

Jiri Olsa jolsa@redhat.com
Thu Dec 1 11:06:00 GMT 2016


On Thu, Dec 01, 2016 at 09:39:22AM +0800, Wangnan (F) wrote:
> 
> 
> On 2016/11/30 22:49, Jiri Olsa wrote:
> > On Tue, Nov 29, 2016 at 02:31:36PM +0100, Jiri Olsa wrote:
> > > hi,
> > > we noticed behaviour change in Fedora 25 gcc wrt -Wp option.
> > > 
> > > We use following command line to generate the dependency file:
> > >    gcc -Wp,-MD,krava,-MT,krava -c -o ex.o ex.c
> > > 
> > > and we get 'krava' file with:
> > >    krava: ex.c /usr/include/stdc-predef.h /usr/include/stdio.h \
> > > 
> > > But when we split -Wp option into 2 -Wp options like:
> > >    gcc -Wp,-MD,krava -Wp,MT,krava -c -o ex.o ex.c
> > > 
> > > we get:
> > >    ex.o krava: ex.c /usr/include/stdc-predef.h /usr/include/stdio.h \
> > > 
> > > notice the extra 'ex.o' target.
> > > 
> > > We see this behaviour in Fedora 25. It's ok in Fedora 24, which seems odd
> > > because both have same gcc version 6.2.1. Please check full output below.
> > more info on this.. it's not fedora version related, it's related
> > to having ccache installed (kudos to Arnaldo ;-) )
> > 
> > with ccache installed above behaviour happens in both Fedora 24 and 25
> 
> Find in ccache releasenotes (https://ccache.samba.org/releasenotes.html)
> 
> ccache 3.3.2
> 
> Release date: 2016-09-28
> 
> Bug fixes
> Fixed a regression in ccache 3.3 related to potentially bad content of
> dependency files when compiling identical source code but with different
> source paths.
> 
> Fixed a regression in ccache 3.3.1: ccache could get confused when using the
> compiler option -Wp, to pass multiple options to the preprocessor, resulting
> in missing dependency files from direct mode cache hits.
> 
> So please try a newer ccache and see the result?

cool, thanks for finding this.. I'm about to post a fix for
perf build tools anyway, so we're ok with this ccache version

jirka



More information about the Gcc-help mailing list