Package: src:libgpg-error
Version: 1.13-0.1
Severity: wishlist
Tags: upstream
X-Debbugs-Cc: d...@debian.org
User: helm...@debian.org
Usertags: rebootstrap

Dear maintainer and Daniel (NMUer),

I noticed that NMU 1.13.0-1 introduced a regression compared to
1.12-0.2. The package no longer cross builds at all. This is due to the
introduction of lock objects (gpgrt_lock_* symbols) in the 1.13 release
and the code used to generate the corresponding type signatures.

In the 1.12 release these functions and most importantly the
gpgrt_lock_t type did not exist. gpg-error.h was generated from
gpg-error.h.in using the mkheader.awk script. Cross-building
libgpg-error worked, even though the resulting package was unusable for
other packages to build on, see #643341.

With the 1.13 release gpg-error.h is created from gpg-error.h.in using
the mkheader tool created from mkheader.c (using the correct compiler,
CC_FOR_BUILD). The mkheader tool looks for lock-obj-pub.native.h and
failing that looks in the syscfg subfolder for a platform-dependent
name. The native way to create lock-obj-pub.native.h is to execute the
gen-posix-lock-obj tool built from gen-posix-lock-obj.c. Unfortunately,
this tool uses various platform-specific aspects (e.g. sizeof) and
therefore using CC_FOR_BUILD to build gen-posix-lock-obj would be wrong.
So when cross-building there simply is no lock-obj-pub.native.h. The
syscfg folder only contains pre-built headers for android and mingw32,
so libgpg-error cannot be cross-built for any other architectures
anymore.

Fundamentally the issue lies in gen-posix-lock-obj which both must use
the host compiler in order to access attributes of the host and it must
use the build compiler in order to be able to run the binary during
build. (In other words, it requires host architecture to equal build
architecture.) In theory, one would create or use a number of autoconf
checks, that turn the host-specific attributes into macros and then use
CC_FOR_BUILD to compile gen-posix-lock-obj. It seems likely that this is
not possible for some technical reason beyond my understanding, because
otherwise upstream would have chosen the way that works for most users.

At this point I cannot tell whether libgpg-error actually must be
cross-buildable to support the cross-buildable-base release goal at
https://wiki.debian.org/ReleaseGoals/CrossBuildableBase, but it seems
likely.

It is probably infeasible to fix this bug in a Debian patch against the
package. Daniel, can you get upstream involved?

Helmut


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to