#1015598 python-gssapi: ftbfs with LTO (link time optimization) enabled

#1015598#5
Date:
2022-07-19 16:58:38 UTC
From:
To:
This package currently fails to build (at least on the amd64
architecture) with link time optimizations enabled.  For a background
for LTO please see

https://wiki.debian.org/ToolChain/LTO

The goal is to enable this optimization by default in an upcoming
Debian release in dpkg-buildflags for 64bit architectures.  The goal
is to get this package to build with link time optimizations, or to
explicitly disable link time optimizations for this package build.

To reproduce the build failure, enable the lto optimization in
testing/unstable by adding "optimize=+lto" to DEB_BUILD_MAINT_OPTIONS
in the debian/rules file, or if this macro is unset, just set it:

export DEB_BUILD_MAINT_OPTIONS = optimize=+lto

Please try to fix the build with lto enabled, fixing the packaging or
forwarding the issue upstream. If the issue cannot be fixed,
explicitly disallow building the package with lto by adding to your
rules file:

export DEB_BUILD_MAINT_OPTIONS = optimize=-lto

or adding that string to your existing setting of DEB_BUILD_MAINT_OPTIONS.

The full build log can be found at:
http://qa-logs.debian.net/2022/06/09/dpkglto/python-gssapi_1.6.12-2_unstable_dpkglto.log
The last lines of the build log are at the end of this report.

[...]
[28/28] Cythonizing gssapi/raw/types.pyx
running build_py
creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9_gssapi/build/gssapi
copying gssapi/__init__.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9_gssapi/build/gssapi
copying gssapi/_win_config.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9_gssapi/build/gssapi
copying gssapi/exceptions.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9_gssapi/build/gssapi
copying gssapi/sec_contexts.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9_gssapi/build/gssapi
copying gssapi/mechs.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9_gssapi/build/gssapi
copying gssapi/creds.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9_gssapi/build/gssapi
copying gssapi/names.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9_gssapi/build/gssapi
copying gssapi/_utils.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9_gssapi/build/gssapi
creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9_gssapi/build/gssapi/raw
copying gssapi/raw/__init__.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9_gssapi/build/gssapi/raw
copying gssapi/raw/named_tuples.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9_gssapi/build/gssapi/raw
creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9_gssapi/build/gssapi/raw/_enum_extensions
copying gssapi/raw/_enum_extensions/__init__.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9_gssapi/build/gssapi/raw/_enum_extensions
creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9_gssapi/build/gssapi/tests
copying gssapi/tests/__init__.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9_gssapi/build/gssapi/tests
copying gssapi/tests/test_high_level.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9_gssapi/build/gssapi/tests
copying gssapi/tests/test_raw.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9_gssapi/build/gssapi/tests
running build_ext
building 'gssapi.raw.misc' extension
creating build
creating build/temp.linux-x86_64-3.9
creating build/temp.linux-x86_64-3.9/gssapi
creating build/temp.linux-x86_64-3.9/gssapi/raw
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Igssapi/raw -I./gssapi/raw -I/usr/include/python3.9 -c gssapi/raw/misc.c -o build/temp.linux-x86_64-3.9/gssapi/raw/misc.o -isystem /usr/include/mit-krb5 -DHAS_GSSAPI_EXT_H
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -g -fwrapv -O2 -flto=auto -ffat-lto-objects -specs=/usr/share/dpkg/no-pie-link.specs -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.9/gssapi/raw/misc.o -L/usr/lib/x86_64-linux-gnu/mit-krb5 -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -o /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9_gssapi/build/gssapi/raw/misc.cpython-39-x86_64-linux-gnu.so -Wl,-z,relro
/usr/bin/ld: /tmp/ccAZzhuV.ltrans0.ltrans.o: relocation R_X86_64_32S against undefined symbol `PyFunction_Type' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: failed to set dynamic section sizes: bad value
collect2: error: ld returned 1 exit status
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
E: pybuild pybuild:369: build: plugin distutils failed with: exit code=1: /usr/bin/python3.9 setup.py build
I: pybuild base:239: /usr/bin/python3 setup.py build
Building from Cython files...
running build
running build_py
creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.10_gssapi/build/gssapi
copying gssapi/__init__.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.10_gssapi/build/gssapi
copying gssapi/_win_config.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.10_gssapi/build/gssapi
copying gssapi/exceptions.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.10_gssapi/build/gssapi
copying gssapi/sec_contexts.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.10_gssapi/build/gssapi
copying gssapi/mechs.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.10_gssapi/build/gssapi
copying gssapi/creds.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.10_gssapi/build/gssapi
copying gssapi/names.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.10_gssapi/build/gssapi
copying gssapi/_utils.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.10_gssapi/build/gssapi
creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.10_gssapi/build/gssapi/raw
copying gssapi/raw/__init__.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.10_gssapi/build/gssapi/raw
copying gssapi/raw/named_tuples.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.10_gssapi/build/gssapi/raw
creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.10_gssapi/build/gssapi/raw/_enum_extensions
copying gssapi/raw/_enum_extensions/__init__.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.10_gssapi/build/gssapi/raw/_enum_extensions
creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.10_gssapi/build/gssapi/tests
copying gssapi/tests/__init__.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.10_gssapi/build/gssapi/tests
copying gssapi/tests/test_high_level.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.10_gssapi/build/gssapi/tests
copying gssapi/tests/test_raw.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.10_gssapi/build/gssapi/tests
running build_ext
building 'gssapi.raw.misc' extension
creating build/temp.linux-x86_64-3.10
creating build/temp.linux-x86_64-3.10/gssapi
creating build/temp.linux-x86_64-3.10/gssapi/raw
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Igssapi/raw -I./gssapi/raw -I/usr/include/python3.10 -c gssapi/raw/misc.c -o build/temp.linux-x86_64-3.10/gssapi/raw/misc.o -isystem /usr/include/mit-krb5 -DHAS_GSSAPI_EXT_H
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -g -fwrapv -O2 -flto=auto -ffat-lto-objects -specs=/usr/share/dpkg/no-pie-link.specs -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.10/gssapi/raw/misc.o -L/usr/lib/x86_64-linux-gnu/mit-krb5 -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -o /<<PKGBUILDDIR>>/.pybuild/cpython3_3.10_gssapi/build/gssapi/raw/misc.cpython-310-x86_64-linux-gnu.so -Wl,-z,relro
/usr/bin/ld: /tmp/ccqk8kuY.ltrans0.ltrans.o: relocation R_X86_64_32S against undefined symbol `PyFunction_Type' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: failed to set dynamic section sizes: bad value
collect2: error: ld returned 1 exit status
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
E: pybuild pybuild:369: build: plugin distutils failed with: exit code=1: /usr/bin/python3 setup.py build
dh_auto_build: error: pybuild --build -i python{version} -p "3.9 3.10" returned exit code 13
make: *** [debian/rules:14: binary] Error 25
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2