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
> The build failed on armhf because dh_makeshlibs report symbols on armhf
> which do not existing on amd64
> 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.


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