[cfe-commits] [patch] -MF option is ignored

David Blaikie dblaikie at gmail.com
Sat Sep 15 08:20:36 PDT 2012


Could you include the test cases you described in your email (& any
others you think might be relevant) as actual test cases in your
patch?

On Sat, Sep 15, 2012 at 3:02 AM, Dimitry Andric <dimitry at andric.com> wrote:
> As reported in PR 13851, clang (trunk r163208) seems to ignore any -MF
> option that is used in combination with -E -M or -E -MM.  For example:
>
>   $ clang -E -MM -MF .depend helloworld.c
>   clang: warning: argument unused during compilation: '-MF .depend'
>
> and no dependency file is generated, the dependency information is
> dumped to standard output instead.
>
> It does work when also compiling, e.g if -MD or -MMD is used:
>
>   $ clang -MMD -MF .depend -c helloworld.c
>   $ cat .depend
>   helloworld.o: helloworld.c
>
> Looking at Clang::AddPreprocessingOptions() in lib/Driver/Tools.cpp, it
> seems the check for a -MF option is done too late: if dependency output
> is requested in any way, the DepFile is always the default filename,
> which is standard output if -E is used.
>
> I propose the attached patch to fix this.
>
> -Dimitry
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>



More information about the cfe-commits mailing list