<div class="gmail_extra"><div class="gmail_quote">On Wed, Sep 12, 2012 at 11:42 PM, NAKAMURA Takumi <span dir="ltr"><<a href="mailto:geek4civic@gmail.com" target="_blank" class="cremed">geek4civic@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">2012/9/13 Chandler Carruth <<a href="mailto:chandlerc@google.com" class="cremed">chandlerc@google.com</a>>:<br>

> On Wed, Sep 12, 2012 at 11:10 PM, NAKAMURA Takumi <<a href="mailto:geek4civic@gmail.com" class="cremed">geek4civic@gmail.com</a>><br>
> wrote:<br>
>><br>
>> 2012/9/13 Chandler Carruth <<a href="mailto:chandlerc@google.com" class="cremed">chandlerc@google.com</a>>:<br>
>> > On Wed, Sep 12, 2012 at 10:53 PM, NAKAMURA Takumi <<a href="mailto:geek4civic@gmail.com" class="cremed">geek4civic@gmail.com</a>><br>
>> > wrote:<br>
>> >><br>
>> >> Author: chapuni<br>
>> >> Date: Thu Sep 13 00:53:23 2012<br>
>> >> New Revision: 163776<br>
>> >><br>
>> >> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=163776&view=rev" target="_blank" class="cremed">http://llvm.org/viewvc/llvm-project?rev=163776&view=rev</a><br>
>> >> Log:<br>
>> >> InitHeaderSearch.cpp: [mingw] Handle DOSish paths only on Win32 hosts.<br>
>> ><br>
>> ><br>
>> > No, this is completely wrong. The set of paths to search for headers<br>
>> > should<br>
>> > never have anything to do with the *host*, only the *target*. Please<br>
>> > revert<br>
>> > this and let's actually talk about the problem you're solving here.<br>
>><br>
>> I think Driveletter-based paths would be useless and ignored safely on<br>
>> non-Win32 hosts (including cygwin). It's host's issue really.<br>
><br>
><br>
> In what way can this possibly be a host issue?<br>
><br>
> If I build a Clang binary on my linux machine, and then on a windows machine<br>
> run it under some magical emulation layer, it will suddenly use these paths.<br>
<br>
</div>I won't imagine that! I suppose such a emulator should use posix-like<br>
path, like cygwin.<br>
<div class="im"><br>
> The header search is a strictly *target* concern, and it should be the same<br>
> regardless of the host on which the compiler is built.<br>
<br>
</div>I rather think "The header search can be affected by both host and target."<br></blockquote><div><br></div><div>I don't understand what you're talking about at all. Look at the rest of the header search code. It doesn't probe the host.</div>
<div><br></div><div>How could a darwin host know anything about about a linux target? or vice versa? And yet if I build Clang on linux I can ask it to do darwin-specific header search.</div><div><br></div><div><br></div><div>
Let me try to be more clear: Header search in Clang is *not* a host concern. Please don't try to make it a host concern, that is a completely wrong design.</div><div><br></div><div>There is only one other place in all of InitHeaderSearch.cpp where we check the host for anything, it is another '#ifdef _WIN32', and it is wrong.</div>
<div><br></div><div>There is only one part of the Driver's ToolChain logic which inspects the host, and that is the WindowsToolChain.cpp which checks if the host will allow it to compile against Win32 APIs for querying the registry. That is something utterly different from what you are adding here.</div>
</div></div>