<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 fails when done with GCC 8.1 against Python 3"
   href="https://bugs.llvm.org/show_bug.cgi?id=38233">38233</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>LLDB build fails when done with GCC 8.1 against Python 3
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>6.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>normal
          </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>bneumeier@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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.</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>