Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#995049: p11-kit: FTBFS on hurd-i386

13 views
Skip to first unread message

Svante Signell

unread,
Sep 25, 2021, 6:20:03 AM9/25/21
to
Source: p11-kit
Version: 0.24.0-2
Severity: important
Tags: patch
User: debia...@lists.debian.org debia...@lists.debian.org
Usertags: hurd

Hi,

Currently p11-kit FTBFS on GNU/Hurd due to a missing implementation in
common/unix-peer.c. Fortunately the function getpeereid() is available in the
libbsd library. The same function is also available for kFreeBSD. The patch
debian_control.diff adds a build dependency of libbsd0 for kFreeBSD and Hurd.
configure.ac.diff adds the bsd library, while common_unix_peer.diff adds the
declaration of the function getpeereid(). This is added so that the header file
bsd/unistd.h is not necessarily included (which conflicts with parts of
unistd.h).

Note that with the attached patches the patch, 41_kfreebsd_LOCAL_PEERCRED.diff,
for kFreeBSD is no longer needed.

The patches have been used to successfully build p11-kit on Linux, Hurd and
kFreeBSD.

Thanks!

common_unix-peer.c.diff
configure.ac.diff
debian_control.diff

Andreas Metzler

unread,
Sep 26, 2021, 8:40:03 AM9/26/21
to
On 2021-09-25 Svante Signell <svante....@gmail.com> wrote:
> Source: p11-kit
[...]
> Hi,

> Currently p11-kit FTBFS on GNU/Hurd due to a missing implementation in
> common/unix-peer.c. Fortunately the function getpeereid() is available
> in the libbsd library. The same function is also available for
> kFreeBSD.

Hello Svante,

thanks for your work.

> The patch debian_control.diff adds a build dependency of
> libbsd0 for kFreeBSD and Hurd.

That should be libbsd-dev instead of libbsd0, shouldn't it?

> configure.ac.diff adds the bsd
> library, while common_unix_peer.diff adds the declaration of the
> function getpeereid(). This is added so that the header file
> bsd/unistd.h is not necessarily included (which conflicts with parts
> of unistd.h).

How do these conflicts manifest? - I did not get additionial
warnings/errors on hurd/kFreeBSD when including bsd/unistd.h instead of
this declaration.

> Note that with the attached patches the patch,
> 41_kfreebsd_LOCAL_PEERCRED.diff, for kFreeBSD is no longer needed.

> The patches have been used to successfully build p11-kit on Linux,
> Hurd and kFreeBSD.

Afaict it does not change buildability on kFreeBSD
though, should it?

ERROR: test-managed
===================

./build/litter/tap-driver.sh: line 145: 90190 Illegal instruction "$@"
ERROR: test-managed - missing test plan

(Tested on on lemon.debian.net)

cu Andreas

Svante Signell

unread,
Sep 27, 2021, 1:20:03 PM9/27/21
to
Hello Andreas

Just for your info. I’m AFK for another week so i cannot test anything until then. However, some comments are inlined below.

Skickat från min iPad

> 26 sep. 2021 kl. 14:35 skrev Andreas Metzler <amet...@bebt.de>:
>
>> On 2021-09-25 Svante Signell <svante....@gmail.com> wrote:
>> Source: p11-kit
> [...]
>> Hi,
>
>> Currently p11-kit FTBFS on GNU/Hurd due to a missing implementation in
>> common/unix-peer.c. Fortunately the function getpeereid() is available
>> in the libbsd library. The same function is also available for
>> kFreeBSD.
>
> Hello Svante,
>
> thanks for your work.
>
>> The patch debian_control.diff adds a build dependency of
>> libbsd0 for kFreeBSD and Hurd.
>
> That should be libbsd-dev instead of libbsd0, shouldn't it?
>
Reasonably it should be, yes.

>> configure.ac.diff adds the bsd
>> library, while common_unix_peer.diff adds the declaration of the
>> function getpeereid(). This is added so that the header file
>> bsd/unistd.h is not necessarily included (which conflicts with parts
>> of unistd.h).
>
> How do these conflicts manifest? - I did not get additionial
> warnings/errors on hurd/kFreeBSD when including bsd/unistd.h instead of
> this declaration.
>
I included bsd/unistd.h without removing the inclusion of unistd.h in unix-peer.c. That did probably cause the problem.

>> Note that with the attached patches the patch,
>> 41_kfreebsd_LOCAL_PEERCRED.diff, for kFreeBSD is no longer needed.
>
>> The patches have been used to successfully build p11-kit on Linux,
>> Hurd and kFreeBSD.
>
> Afaict it does not change buildability on kFreeBSD
> though, should it?
>
> ERROR: test-managed
> ===================
>
> ./build/litter/tap-driver.sh: line 145: 90190 Illegal instruction "$@"
> ERROR: test-managed - missing test plan
>
> (Tested on on lemon.debian.net)
>
I did not build in a chroot, i used an uptodate (sid) qemu image of k-a. Kernel 11.0.

> cu Andreas

Svante Signell

unread,
Oct 5, 2021, 3:00:03 PM10/5/21
to
On Mon, 2021-09-27 at 19:09 +0200, Svante Signell wrote:
> Hello Andreas
>
> Just for your info. I’m AFK for another week so i cannot test anything until
> then. However, some comments are inlined below.

I'm back and have now tested again on Linux, Hurd and kFreeBSD.

> > > The patch debian_control.diff adds a build dependency of
> > > libbsd0 for kFreeBSD and Hurd.
> >
> > That should be libbsd-dev instead of libbsd0, shouldn't it?
> >
> Reasonably it should be, yes.

Now depending on libbsd-dev, see debian_control.diff. See also configure.ac.diff
(same as before) and an updated common_unix-peer.c.diff.

> > > Note that with the attached patches the patch,
> > > 41_kfreebsd_LOCAL_PEERCRED.diff, for kFreeBSD is no longer needed.
> > > The patches have been used to successfully build p11-kit on Linux,
> > > Hurd and kFreeBSD.
> >
> > Afaict it does not change buildability on kFreeBSD though, should it?
> >
> > ERROR: test-managed
> > ===================
> >
> > ./build/litter/tap-driver.sh: line 145: 90190 Illegal instruction "$@"
> > ERROR: test-managed - missing test plan
> >
> > (Tested on on lemon.debian.net)
> >
> I did not build in a chroot, i used an uptodate (sid) qemu image of k-a.
> Kernel 11.0.

This failing test confused me a long time, as it did build fine on a not yet
fully updated kfreebsd-amd64 image. The problem is libffi8 and libffi-dev:
3.4.2-2 in combination with autoconf 2.71-2. Downgrading to 3.3-6 the package
builds fine.

This problem is probably the same as
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=995223 where it causes SIGILL
problems for powerpc and ppc64 in connection with autoconf 2.71-2.

Especially suspicious build log entries of libffi8 (3.4.2-2):
configure.ac:8: warning: The macro `AC_CANONICAL_SYSTEM' is obsolete.
configure.ac:41: warning: The macro `AC_PROG_LIBTOOL' is obsolete.
configure.ac:74: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:91: warning: The macro `AC_HEADER_STDC' is obsolete.
configure.ac:122: warning: The macro `AC_TRY_LINK' is obsolete.
configure.ac:310: warning: The macro `AC_HELP_STRING' is obsolete.
configure.ac:310: warning: The macro `AC_HELP_STRING' is obsolete.
configure.ac:418: warning: The macro `AC_PROG_LD' is obsolete.
configure.ac:418: warning: The macro `AC_TRY_RUN' is obsolete.

The build of 3.4.2-1 did not show the above warnings with autoconf 2.69-14.

common_unix-peer.c.diff
configure.ac.diff
debian_control.diff

Svante Signell

unread,
Oct 8, 2021, 3:10:02 PM10/8/21
to
On Fri, 2021-10-08 at 19:32 +0200, Andreas Metzler wrote:
> # The older patch version included in the upload did not build on
> hurd.
> #
> # I will re-check
>
> reopen 995049

Hello,

The problem is that p11-kit should build-depend on libbsd-dev, not
libbsd0, as in the latest update to the bug. The inclusion of
bsd/unistd.h fails!

Thanks!

Guillem Jover

unread,
Oct 9, 2021, 8:50:02 PM10/9/21
to
Hi!

On Tue, 2021-10-05 at 20:49:53 +0200, Svante Signell wrote:
> Index: p11-kit-0.24.0-2.3/common/unix-peer.c
> ===================================================================
> --- p11-kit-0.24.0-2.3.orig/common/unix-peer.c
> +++ p11-kit-0.24.0-2.3/common/unix-peer.c
> @@ -36,7 +36,6 @@
>
> #include "unix-peer.h"
>
> -#include <unistd.h>
> #include <sys/types.h>
> #include <sys/socket.h>
> #include <sys/un.h>
> @@ -47,6 +46,13 @@
> # include <ucred.h>
> #endif
>
> +#ifdef HAVE_GETPEEREID
> +/* Declare getpeereid() */
> +#include <bsd/unistd.h>
> +#else
> +#include <unistd.h>
> +#endif
> +
> /* Returns the unix domain socket peer information.
> * Returns zero on success.
> */

This should not be needed if the patch were to use the
libbsd-overlay, which should make it transparent.

> @@ -73,7 +79,8 @@ p11_get_upeer_id (int cfd, uid_t *uid, u
> *pid = cr.pid;
>
> #elif defined(HAVE_GETPEEREID)
> - /* *BSD/MacOSX */
> + /* *BSD/MacOSX/kFreeBSD/Hurd */
> +
> uid_t euid;
> gid_t egid;
>

> Index: p11-kit-0.24.0-2.3/configure.ac
> ===================================================================
> --- p11-kit-0.24.0-2.3.orig/configure.ac
> +++ p11-kit-0.24.0-2.3/configure.ac
> @@ -132,6 +132,16 @@ if test "$os_unix" = "yes"; then
> AC_CHECK_FUNCS([getpeereid])
> AC_CHECK_FUNCS([getpeerucred])
> AC_CHECK_FUNCS([issetugid])
> + case "$host_os" in
> + kfreebsd*-gnu | gnu*)
> + have_getpeereid=no
> + AC_CHECK_LIB(bsd, getpeereid, have_getpeereid=yes)
> + if test "x$have_getpeereid" = "xyes"; then
> + AC_DEFINE([HAVE_GETPEEREID], [1], [have getpeereid])
> + AC_SEARCH_LIBS([getpeereid], [bsd])
> + fi
> + ;;
> + esac

This would ideally use the PKG_CHECK_MODULES instead and set the CFLAGS
and LIBS variables appropriately before the other checks so that they
can find the functions provided by libbsd.

> AC_CACHE_CHECK([for thread-local storage class],
> [ac_cv_tls_keyword],

Thanks,
Guillem
0 new messages