<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - _umul128 symbol not found with clang-cl"
   href="http://llvm.org/bugs/show_bug.cgi?id=21714">21714</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>_umul128 symbol not found with clang-cl
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Frontend
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>nicolasweber@gmx.de
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>This program builds fine with cl, but not with clang-cl:

D:\src\llvm-ninja-rel64> type davidben.cc
#include <intrin.h>
#include <stdint.h>
#include <stdio.h>

int main() {
  uint64_t lo, hi;
  lo = _umul128(1234, 5678, &hi);
  printf("0x%08llx%08llx\n", hi, lo);
  return 0;
}
D:\src\llvm-ninja-rel64>cl davidben.cc
Microsoft (R) C/C++ Optimizing Compiler Version 18.00.21005.1 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

davidben.cc
Microsoft (R) Incremental Linker Version 12.00.21005.1
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:davidben.exe
davidben.obj

D:\src\llvm-ninja-rel64>where cl
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64\cl.exe

D:\src\llvm-ninja-rel64>bin\clang-cl.exe davidben.cc
davidben-13b75d.obj : error LNK2019: unresolved external symbol _umul128
referenced in function main
davidben.exe : fatal error LNK1120: 1 unresolved externals
clang-cl.exe: error: linker command failed with exit code 1120 (use -v to see
invocation)


With 32bit cl, things don't work:

D:\src\llvm-ninja-rel64>where cl
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\cl.exe
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64\cl.exe

D:\src\llvm-ninja-rel64>cl davidben.cc
Microsoft (R) C/C++ Optimizing Compiler Version 18.00.21005.1 for x86
Copyright (C) Microsoft Corporation.  All rights reserved.

davidben.cc
davidben.cc(7) : error C3861: '_umul128': identifier not found



But adding -m64 to clang-cl doesn't help (this is with `vcvarsall amd64` again
so that the right link.exe is on the path):

D:\src\llvm-ninja-rel64>bin\clang-cl.exe -m64 davidben.cc
D:\src\llvm-ninja-rel64>bin\clang-cl.exe -m64 davidben.cc
davidben-4d91fd.obj : error LNK2019: unresolved external symbol _umul128
referenced in function main
davidben.exe : fatal error LNK1120: 1 unresolved externals
clang-cl.exe: error: linker command failed with exit code 1120 (use -v to see
invocation)</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>