<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - LLDB build error in llvmorg-9.0.1-rc1 with Python 2"
   href="https://bugs.llvm.org/show_bug.cgi?id=44225">44225</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>LLDB build error in llvmorg-9.0.1-rc1 with Python 2
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lldb
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>9.0
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>release blocker
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>lldb-dev@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>chrschn@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>jdevlieghere@apple.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>LLDB fails to build against Python 2.X, I get the following error message:

/path/to/llvm-build/src/lldb/source/Plugins/ScriptInterpreter/Python/PythonReadline.cpp:52:25:
error: use of undeclared identifier 'PyMem_RawMalloc'; did you mean
'PyMem_Malloc'?
    char *ret = (char *)PyMem_RawMalloc(1);
                        ^~~~~~~~~~~~~~~
                        PyMem_Malloc
/path/to/llvm-build/workstation-sysroot/usr/include/python2.7/pymem.h:52:20:
note: 'PyMem_Malloc' declared here
PyAPI_FUNC(void *) PyMem_Malloc(size_t);
                   ^
/path/to/llvm-build/src/lldb/source/Plugins/ScriptInterpreter/Python/PythonReadline.cpp:60:23:
error: use of undeclared identifier 'PyMem_RawMalloc'; did you mean
'PyMem_Malloc'?
  char *ret = (char *)PyMem_RawMalloc(n + 2);
                      ^~~~~~~~~~~~~~~
                      PyMem_Malloc
/path/to/llvm-build/workstation-sysroot/usr/include/python2.7/pymem.h:52:20:
note: 'PyMem_Malloc' declared here
PyAPI_FUNC(void *) PyMem_Malloc(size_t);
                   ^
1 warning and 2 errors generated.


According to the Python documentation, PyMem_RawMalloc() was only introduced in
3.4: <a href="https://docs.python.org/3/c-api/memory.html">https://docs.python.org/3/c-api/memory.html</a>

Looking at the cherry-picks between llvmorg-9.0.0-rc5 and llvmorg-9.0.1-rc1, I
suspect that this is caused by <a href="https://reviews.llvm.org/D69793">https://reviews.llvm.org/D69793</a>.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>