[llvm] r303912 - Update the documentation and CMake file for Visual Studio generators.

Aaron Ballman via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 6 05:34:24 PST 2017


On Wed, Dec 6, 2017 at 6:17 AM, Vassil Vassilev <v.g.vassilev at gmail.com> wrote:
> Hi Aaron,
>
>   We are building on 32bit and we were wondering what's the best way to
> suppress that warning?

There is not a particularly good way to silence the warning, that I'm
aware of (I'm not a CMake expert, so maybe Chris has a suggestion).

That being said, be aware that compiling with the 32-bit toolchain is
likely to lead to a lot of sadness. The compiler and the linker both
run out of heap space frequently, and so linking things like libclang
or any of the executables can take multiple attempts (I would often
have to attempt to build 5+ times before everything would finally
link). The best approach, if you can use it, is to use the 64-bit
toolchain to build a 32-bit executable. However, if you can't use it,
then you can either ignore the warning or try to find a way to silence
it.

~Aaron

>
> Many thanks!
> Vassil
>
> On 5/25/17 11:01 PM, Aaron Ballman via llvm-commits wrote:
>>
>> Author: aaronballman
>> Date: Thu May 25 16:01:30 2017
>> New Revision: 303912
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=303912&view=rev
>> Log:
>> Update the documentation and CMake file for Visual Studio generators.
>>
>> By default, CMake uses a 32-bit toolchain, even when on a 64-bit platform
>> targeting a 64-bit build. However, due to the size of the binaries involved,
>> this can cause linker instabilities (such as the linker running out of
>> memory). Guide people to the correct solution to get CMake to use the native
>> toolchain.
>>
>> Modified:
>>      llvm/trunk/CMakeLists.txt
>>      llvm/trunk/docs/GettingStartedVS.rst
>>
>> Modified: llvm/trunk/CMakeLists.txt
>> URL:
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/CMakeLists.txt?rev=303912&r1=303911&r2=303912&view=diff
>>
>> ==============================================================================
>> --- llvm/trunk/CMakeLists.txt (original)
>> +++ llvm/trunk/CMakeLists.txt Thu May 25 16:01:30 2017
>> @@ -44,6 +44,13 @@ if (NOT PACKAGE_VERSION)
>>
>> "${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}${LLVM_VERSION_SUFFIX}")
>>   endif()
>>   +if ((CMAKE_GENERATOR MATCHES "Visual Studio") AND
>> (CMAKE_GENERATOR_TOOLSET STREQUAL ""))
>> +  message(WARNING "Visual Studio generators use the x86 host compiler by
>> "
>> +                  "default, even for 64-bit targets. This can result in
>> linker "
>> +                  "instability and out of memory errors. To use the
>> 64-bit "
>> +                  "host compiler, pass -Thost=x64 on the CMake command
>> line.")
>> +endif()
>> +
>>   project(LLVM
>>     ${cmake_3_0_PROJ_VERSION}
>>     ${cmake_3_0_LANGUAGES}
>>
>> Modified: llvm/trunk/docs/GettingStartedVS.rst
>> URL:
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/GettingStartedVS.rst?rev=303912&r1=303911&r2=303912&view=diff
>>
>> ==============================================================================
>> --- llvm/trunk/docs/GettingStartedVS.rst (original)
>> +++ llvm/trunk/docs/GettingStartedVS.rst Thu May 25 16:01:30 2017
>> @@ -100,6 +100,10 @@ Here's the short story for getting up an
>>      * CMake generates project files for all build types. To select a
>> specific
>>        build type, use the Configuration manager from the VS IDE or the
>>        ``/property:Configuration`` command line option when using MSBuild.
>> +   * By default, the Visual Studio project files generated by CMake use
>> the
>> +     32-bit toolset. If you are developing on a 64-bit version of Windows
>> and
>> +     want to use the 64-bit toolset, pass the ``-Thost=x64`` flag when
>> +     generating the Visual Studio solution. This requires CMake 3.8.0 or
>> later.
>>     6. Start Visual Studio
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
>
>


More information about the llvm-commits mailing list