[PySide] Problems building pyside 1.2.1 on AIX (shiboken problem)

Albert Chin pyside at mlists.thewrittenword.com
Thu Apr 17 00:21:17 CEST 2014


I've tried building pyside-1.2.1 on AIX. I've been able to
successfully build it on Solaris, HP-UX, and Linux. The build on AIX
errors with:
  cd /opt/build/pyside-qt4.8+1.2.1/PySide/QtGui && /opt/TWWfsw/gcc44/bin/g++   -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQtGui_EXPORTS -O2 -fPIC -I/opt/TWWfsw/libqt48/include/gcc44 -I/opt/TWWfsw/libqt48/include/gcc44/QtGui -I/opt/TWWfsw/libqt48/include/gcc44/QtCore -I/opt/build/pyside-qt4.8+1.2.1/PySide/QtGui/QtGui -I/opt/build/pyside-qt4.8+1.2.1/PySide/QtGui -I/opt/build/pyside-qt4.8+1.2.1/PySide/QtGui/PySide/QtGui -I/opt/build/pyside-qt4.8+1.2.1/PySide -I/opt/TWWfsw/libqt48/lib/python27/include/shiboken -I/opt/build/pyside-qt4.8+1.2.1/libpyside -I/opt/TWWfsw/python27/include/python2.7 -I/opt/build/pyside-qt4.8+1.2.1/PySide/QtCore/PySide/QtCore    -o CMakeFiles/QtGui.dir/PySide/QtGui/qkeyevent_wrapper.cpp.o -c /opt/build/pyside-qt4.8+1.2.1/PySide/QtGui/PySide/QtGui/qkeyevent_wrapper.cpp
  /opt/build/pyside-qt4.8+1.2.1/PySide/QtGui/PySide/QtGui/qkeyevent_wrapper.cpp: In function 'PyObject* Sbk_QKeyEvent_get_autor(PyObject*, void*)':
  /opt/build/pyside-qt4.8+1.2.1/PySide/QtGui/PySide/QtGui/qkeyevent_wrapper.cpp:686: error: attempt to take address of bit-field structure member 'QKeyEvent::autor'
  /opt/build/pyside-qt4.8+1.2.1/PySide/QtGui/PySide/QtGui/qkeyevent_wrapper.cpp: In function 'int Sbk_QKeyEvent_set_autor(PyObject*, PyObject*, void*)':
  /opt/build/pyside-qt4.8+1.2.1/PySide/QtGui/PySide/QtGui/qkeyevent_wrapper.cpp:706: error: attempt to take address of bit-field structure member 'QKeyEvent::autor'
  gmake[2]: *** [PySide/QtGui/CMakeFiles/QtGui.dir/PySide/QtGui/qkeyevent_wrapper.cpp.o] Error 1
  gmake[2]: Leaving directory `/opt/build/pyside-qt4.8+1.2.1'

Looking at PySide/QtGui/PySide/QtGui/qkeyevent_wrapper.cpp:
  static PyObject* Sbk_QKeyEvent_get_autor(PyObject* self, void*)
  {
      ::QKeyEvent* cppSelf = 0;
      SBK_UNUSED(cppSelf)
      if (!Shiboken::Object::isValid(self))
          return 0;
      cppSelf = ((::QKeyEvent*)Shiboken::Conversions::cppPointer(SbkPySide_QtGuiTypes[SBK_QKEYEVENT_IDX], (SbkObject*)self));
      PyObject* pyOut = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<uint>(), &cppSelf->autor);
      return pyOut;
  }

On Linux, the same function appears as:
  static PyObject* Sbk_QKeyEvent_get_autor(PyObject* self, void*)
  {
      ::QKeyEvent* cppSelf = 0;
      SBK_UNUSED(cppSelf)
      if (!Shiboken::Object::isValid(self))
          return 0;
      cppSelf = ((::QKeyEvent*)Shiboken::Conversions::cppPointer(SbkPySide_QtGuiTypes[SBK_QKEYEVENT_IDX], (SbkObject*)self));
      uint cppOut_local = cppSelf->autor;
      PyObject* pyOut = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<uint>(), &cppOut_local);
      return pyOut;
  }

I need to get shiboken to provide the same behavior on Linux as on
AIX. While debugging this, it seems that the alias for "uint" doesn't
map to "unsigned int" on AIX. In ApiExtractor/typesystem.cpp from
shiboken:
  bool TypeEntry::isCppPrimitive() const
  {
      if (!isPrimitive())
          return false;

      PrimitiveTypeEntry* aliasedType = ((PrimitiveTypeEntry*)this)->basicAliasedTypeEntry();
      QByteArray typeName = (aliasedType ? aliasedType->name() : m_name).toAscii();

On AIX, aliasedType is NULL while on Solaris, HP-UX, and Linux, it is
not. I presume this means there is on alias from "uint" to "unsigned
int". Where in the code should I be looking further?

-- 
albert chin (china at thewrittenword.com)



More information about the PySide mailing list