[lldb-dev] [Bug 38233] New: LLDB build fails when done with GCC 8.1 against Python 3

via lldb-dev lldb-dev at lists.llvm.org
Thu Jul 19 15:33:14 PDT 2018


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

            Bug ID: 38233
           Summary: LLDB build fails when done with GCC 8.1 against Python
                    3
           Product: lldb
           Version: 6.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: lldb-dev at lists.llvm.org
          Reporter: bneumeier at gmail.com
                CC: llvm-bugs at lists.llvm.org

I don't know whether the issue is triggered by doing the build with GCC 8.1, or
by building on a system with only Python 3, or both, but the build of LLDB
crashes with:

------
[ 89%] Building CXX object
tools/lldb/source/Plugins/ScriptInterpreter/Python/CMakeFiles/lldbPluginScriptInterpreterPython.dir/PythonDataObjects.cpp.o
/usr/src/llvm/llvm-6.0.0/tools/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp:
In member function 'llvm::StringRef lldb_private::PythonString::GetString()
const':
/usr/src/llvm/llvm-6.0.0/tools/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp:410:30:
error: invalid conversion
from 'const char*' to 'char*' [-fpermissive]
   c = PyUnicode_AsUTF8AndSize(m_py_obj, &size);
       ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
At global scope:
cc1plus: warning: unrecognized command line option '-Wno-vla-extension'
cc1plus: warning: unrecognized command line option '-Wno-deprecated-register'
make[2]: ***
[tools/lldb/source/Plugins/ScriptInterpreter/Python/CMakeFiles/lldbPluginScriptInterpreterPython.dir/build.make:63:
tools/lldb/source/Plugins/ScriptInterpreter/Python/CMakeFiles/lldbPluginScriptInterpreterPython.dir/PythonDataObjects.cpp.o]
Error 1
make[1]: *** [CMakeFiles/Makefile2:80120:
tools/lldb/source/Plugins/ScriptInterpreter/Python/CMakeFiles/lldbPluginScriptInterpreterPython.dir/all]
Error 2
make: *** [Makefile:152: all] Error 2
-------------

I was able to work around the problem by removing the Python 2 part of
the conditional and replacing:

char *c;
c = PyUnicode_AsUTF8AndSize(m_py_obj, &size);

with:

const char *c = PyUnicode_AsUTF8AndSize(m_py_obj, &size);

That's obviously not ideal, but is a tolerable workaround for my purposes and I
don't have ready access to Python 2 on this system so I'm not sure how to
reconcile 2 and 3 properly.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20180719/e208a908/attachment.html>


More information about the lldb-dev mailing list