ABI checks fail when python3 built with link time optimizations

Samuel Cabrero scabrero at suse.de
Thu May 10 16:54:46 UTC 2018


I found that configuring with:

./configure.developer --picky-developer --extra-python=/usr/bin/python3

on openSUSE tumbleweed ABI checks of python3 modules fail because gdb
can't find debug info:

libpyldb-util.cpython-36m-x86-64-linux-gnu.so: symbol pyldb_Dn_FromDn
has changed - please update major version
	old_signature: PyObject *(struct ldb_dn *)
	new_signature: <text variable, no debug info>

Tracing it down I found that python3 is built --with-lto, and the
returned LDFLAGS are:

>>> from distutils.sysconfig import get_config_var
>>> print((get_config_var("LDFLAGS")))
-flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none

These flags end in the python_LDFLAGS variable and are used to build
the python modules together with '-g' when building with debug or in
developer mode. According to GCC documentation this is currently
experimental and can produce unexpected results, like no debug
information in this case.

Should we strip out '-flto' from the LDFLAGS returned by python when
building with debug or in developer mode?


More information about the samba-technical mailing list