Details
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.