Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-740

Compiling with -Wl,--no-dynamic-linker makes shiboken segfault

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 5.9
    • Fix Version/s: 5.11.1
    • Component/s: Shiboken
    • Labels:
    • Environment:
      Debian Unstable with gcc 7.3, Qt 5.10.1.
    • Platform/s:
      Linux/Wayland
    • Commits:
      0479cbd6abc8fffb9ba8b5f94de067e1670ffffa (pyside-setup, 5.11, 13.7.2018)

      Description

      I'm trying to build a Debian package of pyside2. By default, in Debian packages we build with debug symbols enabled and there's a tool that strips the debug symbols into separate files shipped in automatically generated debug packages. However that tool is failing:

      dh_strip -O--buildsystem=pybuild
      install -d debian/.debhelper/python-pyside2/dbgsym-root/usr/lib/debug/.build-id/d2
      objcopy --only-keep-debug --compress-debug-sections debian/python-pyside2/usr/lib/python2.7/dist-packages/PySide2/libshiboken2-python2.7.x86_64-linux-gnu.so.5.9 debian/.debhelper/python-pyside2/dbgsym-root/usr/lib/debug/.build-id/d2/db69f5cbee54145bb83929d081a9f9ae87e71c.debug
      objcopy: debian/.debhelper/python-pyside2/dbgsym-root/usr/lib/debug/.build-id/d2/db69f5cbee54145bb83929d081a9f9ae87e71c.debug: not enough room for program headers, try linking with -N
      objcopy:debian/.debhelper/python-pyside2/dbgsym-root/usr/lib/debug/.build-id/d2/db69f5cbee54145bb83929d081a9f9ae87e71c.debug[.note.gnu.build-id]: bad value
      

      I google a bit this error ("not enough room for program headers") and the advice is always to build the software with

      -Wl,--no-dynamic-linker

      Unfortunately, when I do that shiboken seems to no longer work as I get a segfault:

      [ 94%] Built target shiboken2
      /usr/bin/make -f shibokenmodule/CMakeFiles/shibokenmodule.dir/build.make shibokenmodule/CMakeFiles/shibokenmodule.dir/depend
      make[3]: Entering directory '/<<PKGBUILDDIR>>/pyside2d_build/py2.7-qt5.10.1-64bit-debug/shiboken2'
      [ 96%] Running generator for 'shiboken2'...
      cd "/<<PKGBUILDDIR>>/sources/shiboken2/shibokenmodule" && "/<<PKGBUILDDIR>>/pyside2d_build/py2.7-qt5.10.1-64bit-debug/shiboken2/generator/shiboken2" --project-file=/<<PKGBUILDDIR>>/pyside2d_build/py2.7-qt5.10.1-64bit-debug/shiboken2/shibokenmodule/shibokenmodule.txt
      Segmentation fault
      make[3]: *** [shibokenmodule/CMakeFiles/shibokenmodule.dir/build.make:65: shibokenmodule/shiboken2/shiboken2_module_wrapper.cpp] Error 139
      make[3]: Leaving directory '/<<PKGBUILDDIR>>/pyside2d_build/py2.7-qt5.10.1-64bit-debug/shiboken2'
      make[2]: *** [CMakeFiles/Makefile2:357: shibokenmodule/CMakeFiles/shibokenmodule.dir/all] Error 2
      make[2]: Leaving directory '/<<PKGBUILDDIR>>/pyside2d_build/py2.7-qt5.10.1-64bit-debug/shiboken2'
      make[1]: *** [Makefile:133: all] Error 2
      make[1]: Leaving directory '/<<PKGBUILDDIR>>/pyside2d_build/py2.7-qt5.10.1-64bit-debug/shiboken2'
      error: Error compiling shiboken2
      

      I tried to get a backtrace as the program is compiled with debugging symbols but I did not get anything useful, it seems to segfault somewhere in the initialization even before anything from the main function gets executed.

       

        Attachments

        1. update-patchelf.patch
          129 kB
          Raphaël Hertzog
        For Gerrit Dashboard: PYSIDE-740
        # Subject Branch Project Status CR V

          Activity

            People

            • Assignee:
              kleint Friedemann Kleint
              Reporter:
              rhertzog Raphaël Hertzog
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There is 1 open Gerrit change