[cfe-dev] Distinguishing between clang Window versions

Nico Weber thakis at chromium.org
Wed Jul 9 17:44:56 PDT 2014


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

> On 7/9/2014 6:22 PM, Nico Weber wrote:
>
>> On Wed, Jul 9, 2014 at 3:01 PM, Edward Diener
>> <eldlistmailingz at tropicsoft.com
>> <mailto: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>
>>         <mailto: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++.
>>
>
> However clang also creates a clang.exe driver, which is exactly the same
> file as clang-cl.exe, when building clang with VC++.


I think that's something we want to change. clang.exe should be the
gcc-like driver and clang-cl.exe the msvs-like driver, no matter what
compiler is used to compile clang.


>
>
>
>>     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.
>>
>
> Yes, but the explanation is pretty terse and then the clang docs are
> sometimes missing any explanation for a particular option, leaving the
> end-user to do random guesswork or ask on the clang mailing lists.
>
>
> _______________________________________________
> 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/ca6d5b19/attachment.html>


More information about the cfe-dev mailing list