Saturday 10 June 2023

Re: Symbols files for C++ libraries for Ubuntu main

Hi Sebastien!

On Fri, Jun 09, 2023 at 02:27:02PM +0200, Sebastien Bacher wrote:
> 1. We added a symbols to libcupsfilters as part of the MIR promotion
> https://git.launchpad.net/ubuntu/+source/libcupsfilters/commit/debian/libcupsfilters2.symbols?h=applied/ubuntu/devel&id=c5821fe0
>
> The build failed on armhf because dh_makeshlibs report symbols on armhf
> which do not existing on amd64
> https://launchpadlibrarian.net/647850924/buildlog_ubuntu-lunar-armhf.libcupsfilters_2.0~b2-0ubuntu4_BUILDING.txt.gz
>
> which also included those types of changes
>
> - _Znam@Base 2.0~b2-0ubuntu3
> + _Znaj@Base 2.0~b2-0ubuntu4
> +#MISSING: 2.0~b2-0ubuntu4# _Znam@Base 2.0~b2-0ubuntu3
>
> I personally don't understand why we have those symbols existing on armhf
> which don't exist on amd64. Nor why _Znam@Base is becoming _Znaj@Base nor
> how we are supposed to handle such cases

m vs. j is usually because of size_t type, which is equivalent to unsigned
long on 64-bit architectures and to unsigned int on 32-bit.

I can suggest using pkgkde-symbolshelper (adding '--with pkgkde_symbolshelper'
to dh and running 'pkgkde-symbolshelper batchpatch *.build'). That tool will
automatically detect this difference, replace the symbol with _Zna{size_t},
and that will work on all architectures. See [1] for details.

[1]: https://qt-kde-team.pages.debian.net/symbolfiles.html

Alternatively, you can put this manually in your symbols file:

(arch-bits=64)_Znam@Base 2.0~b2
(arch-bits=32)_Znaj@Base 2.0~b2

--
Dmitry Shachnev