[cfe-dev] Trying again - building 64bit code on Windows

Ivan Garramona via cfe-dev cfe-dev at lists.llvm.org
Mon Aug 24 20:50:22 PDT 2015


2015-08-24 23:15 GMT-03:00 Edward Diener via cfe-dev <cfe-dev at lists.llvm.org
>:

> On 8/24/2015 6:27 PM, Hans Wennborg via cfe-dev wrote:
>
>> On Mon, Aug 24, 2015 at 2:36 PM, Edward Diener via cfe-dev
>> <cfe-dev at lists.llvm.org> wrote:
>>
>>> Is clang built form the latest svn source capable of creating 64-bit
>>> code on
>>> a Microsoft Windows 64-bit OS ?
>>>
>>
>> Yes. We build 64-bit Chromium on Windows with Clang continuously.
>>
>> If yes, is this done through the -m64 option
>>> or do I have to build clang from source in some particular way to enable
>>> the
>>> functionality ?
>>>
>>
>> Yes, using clang-cl -m64 is how we do it.
>>
>
> Evidently to build a version of clang on Windows targeting mingw-64/gcc,
> which can compile 64-bit code, one must build clang with a 64-bit version
> of mingw-64/gcc. This may be apparent to you and other clang developers but
> it was not apparent to me.
>

If i understand you correctly (english is not my native language), you are
saying that Clang must be a 64bit app, to be able to produce 64bit apps?

Where did you get that? I have a 32bit Clang here (built with 32bit mingw)
which is perfectly capable of producing 64bit apps. I just tried it,
targeting both Mingw and MSVC.

Heres the command line i used:
$ clang++ test2.cpp -static -m64 --sysroot=/c/Dev/Mingw64/

You have to put the mingw64bit/bin folder in the PATH. I did this before i
ran the command:
$ export PATH="/c/Dev/Mingw64/bin/:PATH"

After i did this, both Mingws were on the PATH, but the 64bit comes first,
otherwise Clang would run the 32bit linker.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150825/c4285817/attachment.html>


More information about the cfe-dev mailing list