https://bugs.llvm.org/show_bug.cgi?id=44225

            Bug ID: 44225
           Summary: LLDB build error in llvmorg-9.0.1-rc1 with Python 2
           Product: lldb
           Version: 9.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: release blocker
          Priority: P
         Component: All Bugs
          Assignee: lldb-dev@lists.llvm.org
          Reporter: chrs...@google.com
                CC: jdevliegh...@apple.com, llvm-b...@lists.llvm.org

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: https://docs.python.org/3/c-api/memory.html

Looking at the cherry-picks between llvmorg-9.0.0-rc5 and llvmorg-9.0.1-rc1, I
suspect that this is caused by https://reviews.llvm.org/D69793.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
lldb-dev mailing list
lldb-dev@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev

Reply via email to