[cfe-dev] Distinguishing between clang Window versions

Nico Weber thakis at chromium.org
Wed Jul 9 15:22:21 PDT 2014


On Wed, Jul 9, 2014 at 3:01 PM, Edward Diener <
eldlistmailingz at tropicsoft.com> wrote:

> On 7/9/2014 2:40 PM, Reid Kleckner wrote:
>
>> On Wed, Jul 9, 2014 at 7:09 AM, Edward Diener
>> <eldlistmailingz at tropicsoft.com
>> <mailto:eldlistmailingz at tropicsoft.com>> wrote:
>>
>>     I see where a build of clang on Windows using VC++ produces both
>>     clang.exe and clang-cl.exe and that they are both the same
>>     executables. Nonetheless depending on the -target ( or default
>>     -target ) passed to the clang driver we have different build
>>     expectations in Boost Build. In Windows When the target mode is VC++
>>     clang emulates VC++ in various ways and when the target mode is
>>     mingw/gcc clang emulates mingw/gcc. Even with the latter on Windows
>>     there are a few subtle differences from clang on Linux. That is why
>>     Boost Build needs to treat them differently from within its .jam
>> files.
>>
>>
>> What kinds of properties of a compiler do you normally check in Boost
>> Build?  If you're willing to do a test compile, you can look for '#if
>> defined(__clang__) && defined(_MSC_VER)' or '#if defined(__clang__) &&
>> defined(__GNUC__)'.
>>
>
> That is another possibility which I will bring up in Boost Build.
>
> Essentially we need to find out as easily as possible whether a clang
> executable on Windows targets vc++ or gcc/mingw,


I think going forward, the idea is that "clang" will try to be
gcc-compatible (i.e. target minw), while "clang-cl" will try to be
cl-compatible and targes vc++.


> while also taking into account the -target option on the command line.
>
> BTW I could not find in the latest clang 3.5 documentation any mention of
> the -target option. Likewise, and I am sure you have heard it before, an
> alphabetical list of all clang options in the documentation, with
> explanations for each one, would be greatly appreciated.


clang --help prints a list of all driver options, with at least some help
text.


>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140709/598247b4/attachment.html>


More information about the cfe-dev mailing list