<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Just did some more checking and found that for Win32 to Additional
    Options *do* appear. Any ideas what's going on here?<br>
    <br>
    Regards,<br>
    Eric<br>
    <br>
    <div class="moz-cite-prefix">On 10/1/14, 6:58 AM, Eric Mader wrote:<br>
    </div>
    <blockquote cite="mid:542C32A0.30700@gmx.us" type="cite">
      <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
      I enabled verbose build logs in VS and found that the "-m64
      -fmsc-version=1800" options didn't appear:<br>
      <br>
      <font face="Courier New, Courier, monospace">1>  C:\Program
        Files (x86)\LLVM\msbuild-bin\CL.exe /c /IC:[elided] /IC:[elided]
        /IC:[elided] /IC:[elided] /IC:[elided] /IC:[elided] /Zi /nologo
        /W3 /WX- /Od /D WIN32 /D _DEBUG /D _WINDOWS /D _USRDLL /D
        [elided] /D _t_env_os_WIN32 /D [elided] /D
        _SCL_SECURE_NO_WARNINGS /D _CRT_SECURE_NO_WARNINGS /D [elided]
        /D _WIN64 /D "__x86_64__= 1" /D _WINDLL /D _UNICODE /D UNICODE
        /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope
        /Fo"Debug\x64\\" /Fd"Debug\x64\vc120.pdb" /Gd /TP /wd4068
        /wd4200 /wd4244 /wd4267 /wd4305 /wd4309 /wd4311 /wd4800
        /FIC:[elided].h /errorReport:prompt -ferror-limit=1000 -Xclang
        -fblocks [elided].cpp<br>
      </font><br>
      I added them as Additional Options for the file I'm trying to
      compile, and the size_t errors went away.<br>
      <br>
      So it looks like the problem is that these options aren't getting
      applied by the toolset, even though they are in the toolset.props
      file:<br>
      <br>
      <font face="Courier New, Courier, monospace"><Project xmlns=<a
          moz-do-not-send="true" class="moz-txt-link-rfc2396E"
          href="http://schemas.microsoft.com/developer/msbuild/2003">"http://schemas.microsoft.com/developer/msbuild/2003"</a>> 
        <br>
          <Import
Project="$(VCTargetsPath)\Platforms\$(Platform)\PlatformToolsets\v120\Microsoft.Cpp.$(Platform).v120.props"Condition="Exists('$(VCTargetsPath)\Platforms\$(Platform)\PlatformToolsets\v120\Microsoft.Cpp.$(Platform).v120.props')"/><br>
          <Import
Project="$(VCTargetsPath)\Platforms\$(Platform)\PlatformToolsets\v120\Toolset.props"Condition="Exists('$(VCTargetsPath)\Platforms\$(Platform)\PlatformToolsets\v120\Toolset.props')"/><br>
        <br>
          <PropertyGroup><br>
           
<LLVMInstallDir>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\LLVM\LLVM)</LLVMInstallDir><br>
            <LLVMInstallDir Condition="'$(LLVMInstallDir)' ==
''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\LLVM\LLVM)</LLVMInstallDir><br>
           
<ExecutablePath>$(LLVMInstallDir)\msbuild-bin;$(ExecutablePath)</ExecutablePath><br>
           
<LibraryPath>$(LLVMInstallDir)\lib\clang\3.6\lib\windows;$(LibraryPath)</LibraryPath><br>
          </PropertyGroup><br>
        <br>
          <ItemDefinitionGroup><br>
            <ClCompile><br>
              <!-- Set the value of _MSC_VER to claim for
        compatibility --><br>
              <AdditionalOptions>-m64 -fmsc-version=1800
        %(AdditionalOptions)</AdditionalOptions><br>
            </ClCompile><br>
          </ItemDefinitionGroup><br>
        </Project><br>
      </font><br>
      This file is located at C:\Program Files
(x86)\MSBuild\Microsoft.Cpp\4.0\V120\Platforms\x64\PlatformToolsets\LLVM-vs2013<br>
      <br>
      Regards,<br>
      Eric<br>
      <br>
      <div class="moz-cite-prefix">On 9/30/14, 7:31 PM, David Majnemer
        wrote:<br>
      </div>
      <blockquote
cite="mid:CAL7bZ_eqx27BT-ciJmndBx9nTNKK5VrMBKa7z3Ay0iiPZE+saQ@mail.gmail.com"
        type="cite">
        <div dir="ltr">We inject a typedef for size_t here:
          <div><a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.cpp?revision=218230&view=markup#l206">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.cpp?revision=218230&view=markup#l206</a><br>
          </div>
          <div><br>
          </div>
          <div>The typedef type is determined by calling getSizeType().</div>
          <div><br>
          </div>
          <div>SizeType is (relevantly) calculated in two places:</div>
          <div>X86_64 <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?revision=218666&view=markup#l3512">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?revision=218666&view=markup#l3512</a><br>
          </div>
          <div>X86_32 <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?revision=218666&view=markup#l3157">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?revision=218666&view=markup#l3157</a></div>
          <div><br>
          </div>
          <div>I don't see any obvious bugs here.</div>
          <div><br>
          </div>
        </div>
        <div class="gmail_extra"><br>
          <div class="gmail_quote">On Tue, Sep 30, 2014 at 6:50 PM, Eric
            Mader <span dir="ltr"><<a moz-do-not-send="true"
                href="mailto:emader@gmx.us" target="_blank">emader@gmx.us</a>></span>
            wrote:<br>
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <div bgcolor="#FFFFFF" text="#000000"> But crtdefs.h says:<br>
                <br>
                <font face="Courier New, Courier, monospace">#ifdef
                  _WIN64<br>
                  typedef unsigned __int64 size_t;<br>
                  #else<br>
                  typedef _W64 unsigned int size_t;<br>
                  #endif<br>
                </font><br>
                Which conflicts with the built-in definition, that seems
                to be equivalent to:<br>
                <br>
                <font face="Courier New, Courier, monospace">typedef
                  unsigned int size_t;</font><br>
                <br>
                What determines the built-in type of size_t? Is there
                some setting or variable I can define to change it?<br>
                <br>
                Regards,<br>
                Eric
                <div>
                  <div class="h5"><br>
                    <br>
                    <br>
                    <br>
                    <div>On 9/30/14, 3:21 PM, David Majnemer wrote:<br>
                    </div>
                    <blockquote type="cite">
                      <div dir="ltr">I believe that we provide a
                        definition of size_t inside the compiler itself
                        when clang is in MSVC compatibility mode.</div>
                      <div class="gmail_extra"><br>
                        <div class="gmail_quote">On Tue, Sep 30, 2014 at
                          5:51 PM, Eric Mader <span dir="ltr"><<a
                              moz-do-not-send="true"
                              href="mailto:emader@gmx.us"
                              target="_blank">emader@gmx.us</a>></span>
                          wrote:<br>
                          <blockquote class="gmail_quote"
                            style="margin:0 0 0 .8ex;border-left:1px
                            #ccc solid;padding-left:1ex">
                            <div bgcolor="#FFFFFF" text="#000000"> I did
                              some more investigation of the size_t size
                              error. I misunderstood what was happening.
                              It turns out that size_t is already
                              defined before my prefix header is
                              included. I added the following
                              static_asserts to the font of the header:<br>
                              <br>
                              <font face="Courier New, Courier,
                                monospace">static_assert(sizeof(size_t)
                                != 4, "sizeof(size_t) == 4");<br>
                                static_assert(sizeof(size_t) != 8,
                                "sizeof(size_t) == 8");<br>
                              </font><br>
                              The first static_assert fires:<br>
                              <br>
                              <font face="Courier New, Courier,
                                monospace">1>Build started 9/30/2014
                                2:29:54 PM.<br>
                                1>clang-cl.exe : warning : argument
                                unused during compilation: '/Gm-'<br>
                                1>clang-cl.exe : warning : argument
                                unused during compilation: '/GS'<br>
                                1>clang-cl.exe : warning : argument
                                unused during compilation: '/fp:precise'<br>
                                1>clang-cl.exe : warning : argument
                                unused during compilation:
                                '/FdDebug\x64\vc120.pdb'<br>
                                1>clang-cl.exe : warning : argument
                                unused during compilation: '/Gd'<br>
                                1>  In file included from
                                <built-in>:187:<br>
                                1>  In file included from <command
                                line>:19:<br>
                                1>[elided header file name](9,1):
                                error : static_assert failed
                                "sizeof(size_t) == 4"<br>
                                1>  static_assert(sizeof(size_t) !=
                                4, "sizeof(size_t) == 4");<br>
                                1>  ^             ~~~~~~~~~~~~~~~~~~~<br>
                              </font><br>
                              Later on, I get an error saying that
                              crtdefs.h is trying to redefine size_t
                              from an unsigned int to an unsigned long
                              long...<br>
                              <br>
                              Perhaps one of my preprocessor defines is
                              causing these errors:<br>
                              <br>
                              <font face="Courier New, Courier,
                                monospace">WIN32<br>
                                _DEBUG<br>
                                _WINDOWS<br>
                                _USRDLL<br>
                                _SCL_SECURE_NO_WARNINGS<br>
                                _CRT_SECURE_NO_WARNINGS<br>
                                _WIN64<br>
                                _x86_64_ = 1<br>
                              </font><br>
                              (I added the "SECURE_NO_WARNINGS" defines
                              when I ported an earlier version of this
                              code to VS 2005; don't remember why any
                              more...)<br>
                              (There are a couple of other defines that
                              are specific to the DLL I'm trying to
                              build)<br>
                              <br>
                              Regards,<br>
                              Eric Mader
                              <div>
                                <div><br>
                                  <br>
                                  <div>On 9/30/14, 1:01 PM, Eric Mader
                                    wrote:<br>
                                  </div>
                                  <blockquote type="cite"> Hi Reid,<br>
                                    <br>
                                    I copied the x64 toolsets by hand;
                                    they got installed to C:\Program
                                    Files (x86)\LLVM\tools\msbuild\x64;
                                    they just didn't get moved correctly
                                    by install.bat.<br>
                                    <br>
                                    I just verified that the LLVM-vs2013
                                    toolset.props is correct.<br>
                                    <br>
                                    If it is a bitness problem, perhaps
                                    I'm failing to define something
                                    correctly?<br>
                                    <br>
                                    Regards,<br>
                                    Eric<br>
                                    <br>
                                    <div>On 9/30/14, 11:29 AM, Reid
                                      Kleckner wrote:<br>
                                    </div>
                                    <blockquote type="cite">
                                      <div dir="ltr">This looks like
                                        some kind of bitness conflict.
                                        If you are building for win64,
                                        are you sure clang is getting
                                        the -m64 argument?
                                        <div><br>
                                        </div>
                                        <div>I recall that you copied
                                          the win32 platform toolset xml
                                          files over by hand, and I
                                          don't think they will have the
                                          correct flags. If you see this
                                          line in the x64 toolset.props
                                          file, replace -m32 with -m64
                                          and try again:</div>
                                        <div><AdditionalOptions>-m32

                                          -fmsc-version=1700
                                          %(AdditionalOptions)</AdditionalOptions><br>
                                        </div>
                                        <div><br>
                                        </div>
                                        <div>In the meantime, I think
                                          Hans is trying to fix the
                                          installation of those xml
                                          files and hopefully that will
                                          fix issues for other users
                                          going forwards.</div>
                                      </div>
                                      <div class="gmail_extra"><br>
                                        <div class="gmail_quote">On Tue,
                                          Sep 30, 2014 at 1:55 PM, Eric
                                          Mader <span dir="ltr"><<a
                                              moz-do-not-send="true"
                                              href="mailto:emader@gmx.us"
                                              target="_blank">emader@gmx.us</a>></span>
                                          wrote:<br>
                                          <blockquote
                                            class="gmail_quote"
                                            style="margin:0 0 0
                                            .8ex;border-left:1px #ccc
                                            solid;padding-left:1ex">
                                            <div bgcolor="#FFFFFF"
                                              text="#000000"> I'm
                                              getting compile errors
                                              because size_t is getting
                                              redefined. My "forced
                                              include file" starts with:<br>
                                              <br>
                                              <font face="Courier New,
                                                Courier, monospace">#if
                                                BUILDING_FOR_WINDOWS<br>
                                                #define NOMINMAX<br>
                                                <br>
                                                /* deal with the fact
                                                that windef.h also
                                                defines BOOL */<br>
                                                #define BOOL WINBOOL<br>
                                                <br>
                                                #include
                                                <windows.h><br>
                                                #include
                                                <intrin.h><br>
                                                <br>
                                                #undef BOOL<br>
                                                #endif<br>
                                              </font><br>
                                              Looking at the
                                              preprocessor expansion of
                                              a typical .cpp file, I see
                                              that crtdefs.h defines
                                              size_t like this:<br>
                                              <br>
                                              <font face="Courier New,
                                                Courier, monospace">typedef

                                                unisgned __int64 size_t;<br>
                                              </font><br>
                                              Later on,
                                              <LLVM>\lib\clang\3.6.0\includes\stddef.h
                                              defines it as:<br>
                                              <br>
                                              <font face="Courier New,
                                                Courier, monospace">typedef

                                                unsigned int size_t;<br>
                                              </font><br>
                                              Is there some other magic
                                              I need to do to get these
                                              to work?<br>
                                              <br>
                                              I'm also seeing a bunch of
                                              errors like this having to
                                              do with intrinsics:<br>
                                              <br>
                                              <font face="Courier New,
                                                Courier, monospace">1> 

                                                In file included from
                                                C:\Program Files
                                                (x86)\Microsoft Visual
                                                Studio
                                                12.0\VC\include\algorithm:6:<br>
                                                1>  In file included
                                                from C:\Program Files
                                                (x86)\Microsoft Visual
                                                Studio
                                                12.0\VC\include\xmemory:6:<br>
                                                1>  In file included
                                                from C:\Program Files
                                                (x86)\Microsoft Visual
                                                Studio
                                                12.0\VC\include\xmemory0:909:<br>
                                                1>  In file included
                                                from C:\Program Files
                                                (x86)\LLVM\msbuild-bin\..\lib\clang\3.6.0\include\intrin.h:34:<br>
                                                1>  In file included
                                                from C:\Program Files
                                                (x86)\LLVM\msbuild-bin\..\lib\clang\3.6.0\include\x86intrin.h:29:<br>
                                                1>  In file included
                                                from C:\Program Files
                                                (x86)\LLVM\msbuild-bin\..\lib\clang\3.6.0\include\immintrin.h:28:<br>
                                                1>C:\Program Files
                                                (x86)\LLVM\msbuild-bin\..\lib\clang\3.6.0\include\mmintrin.h(52,40):
                                                error : cannot
                                                initialize a parameter
                                                of type
                                                '__attribute__((__vector_size__(2
                                                * sizeof(int)))) int'
                                                (vector of 2 'int'
                                                values) with an rvalue
                                                of type '__v2si' (aka
                                                'int')<br>
                                                1>      return
                                                __builtin_ia32_vec_ext_v2si((__v2si)__m,
                                                0);<br>
                                                1>                                        



                                                ^~~~~~~~~~~<br>
                                              </font><br>
                                              I suspect that these might
                                              be caused by the same
                                              thing as the size_t
                                              problem...<br>
                                              <br>
                                              Regards,<br>
                                              Eric Mader<br>
                                              <br>
                                              <br>
                                              <br>
                                            </div>
                                            <br>
_______________________________________________<br>
                                            LLVM Developers mailing list<br>
                                            <a moz-do-not-send="true"
                                              href="mailto:LLVMdev@cs.uiuc.edu"
                                              target="_blank">LLVMdev@cs.uiuc.edu</a> 
                                                   <a
                                              moz-do-not-send="true"
                                              href="http://llvm.cs.uiuc.edu"
                                              target="_blank">http://llvm.cs.uiuc.edu</a><br>
                                            <a moz-do-not-send="true"
                                              href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev"
                                              target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
                                            <br>
                                          </blockquote>
                                        </div>
                                        <br>
                                      </div>
                                    </blockquote>
                                    <br>
                                    <br>
                                    <fieldset></fieldset>
                                    <br>
                                    <pre>_______________________________________________
LLVM Developers mailing list
<a moz-do-not-send="true" href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a moz-do-not-send="true" href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a>
<a moz-do-not-send="true" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
</pre>
                                  </blockquote>
                                  <br>
                                </div>
                              </div>
                            </div>
                            <br>
_______________________________________________<br>
                            LLVM Developers mailing list<br>
                            <a moz-do-not-send="true"
                              href="mailto:LLVMdev@cs.uiuc.edu"
                              target="_blank">LLVMdev@cs.uiuc.edu</a>   
                                 <a moz-do-not-send="true"
                              href="http://llvm.cs.uiuc.edu"
                              target="_blank">http://llvm.cs.uiuc.edu</a><br>
                            <a moz-do-not-send="true"
                              href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev"
                              target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
                            <br>
                          </blockquote>
                        </div>
                        <br>
                      </div>
                    </blockquote>
                    <br>
                  </div>
                </div>
              </div>
            </blockquote>
          </div>
          <br>
        </div>
      </blockquote>
      <br>
    </blockquote>
    <br>
  </body>
</html>