[cfe-dev] clangDriver GetTemporaryPath not correct in windows

Daniel Dunbar daniel at zuster.org
Mon Apr 20 10:36:45 PDT 2009


Hi Ether,
On Mon, Apr 20, 2009 at 12:39 AM, ether zhhb <etherzhhb at gmail.com> wrote:

> hi,
>
> In llvm/tools/clang/lib/Driver/Driver.cpp at line 1113, the statement
> llvm::sys::Path P("/tmp/cc"); will create an invalid temporary path in
> windows, and there is a "fix me" comment too :)
>
> So we just simply replace it by "llvm::sys::Path P =
> llvm::sys::Path::GetTemporaryDirectory();", is that right? if so, here
> is the patch:


Unfortunately, GetTemporaryDirectory does something rather different (it
ends up creating a temporary directory, not just returning the place to put
temporary files). The llvm::sys::Path interface needs some serious surgery
in my opinion...

I committed a fix to at least use the TMPDIR environment variable. If I
recall correctly, Windows uses something else (TEMP?) but may define this as
well? Please let me know if:

http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20090420/015926.html
does or does not fix it for you.

by the way, there is another error occur while executing clang with
> the message ": error: unable to execute command: program not
> executable".


This is probably because it isn't finding the executable in your path, or
its built in search locations. You can look at the output of "clang ...
other args ... -###" to see the command it is trying to run, and the output
of "clang -print-search-dirs" to see where it is looking for programs.

 - Daniel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20090420/1ec9c531/attachment.html>


More information about the cfe-dev mailing list