ABI checks fail when python3 built with link time optimizations

Andrew Bartlett abartlet at samba.org
Thu May 10 17:38:49 UTC 2018

On Thu, 2018-05-10 at 18:54 +0200, Samuel Cabrero via samba-technical
> Hi,
> 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?

Yes.  We may or make not like LTO, but we shouldn't get such stuff
magically from python.  Please filter aggressively, we really just want
libraries to link to, not compiler features.


Andrew Bartlett

Andrew Bartlett                       http://samba.org/~abartlet/
Authentication Developer, Samba Team  http://samba.org
Samba Developer, Catalyst IT          http://catalyst.net.nz/services/samba

More information about the samba-technical mailing list