[16670] in Kerberos-V5-bugs

home help back first fref pref prev next nref lref last post

[krbdev.mit.edu #8968] Building 1.18.3 on OpenBSD 6.8 amd64

daemon@ATHENA.MIT.EDU (Robert Crowston via RT)
Sat Nov 21 13:19:33 2020

From: "Robert Crowston via RT" <rt-comment@krbdev.mit.edu>
In-Reply-To: <wn5XdtHYISBqJKi9n90l0VjWDAG8aaKZ9p9EL5hGFd4gXZewm0d9rB_dwlZwk59mrGDwoGQQ85v2hQMCdXk-xCnGgJWuHPNzkVoey0pMO6g=@protonmail.com>
Message-ID: <rt-4.4.4-33850-1605982765-1559.8968-4-0@mit.edu>
To: "AdminCc of krbdev.mit.edu Ticket #8968":;
Date: Sat, 21 Nov 2020 13:19:25 -0500
MIME-Version: 1.0
Reply-To: rt-comment@krbdev.mit.edu
Content-Type: text/plain; charset="utf-8"
Errors-To: krb5-bugs-bounces@mit.edu
Content-Transfer-Encoding: 8bit


Sat Nov 21 13:19:25 2020: Request 8968 was acted upon.
 Transaction: Ticket created by crowston@protonmail.com
       Queue: krb5
     Subject: Building 1.18.3 on OpenBSD 6.8 amd64
       Owner: Nobody
  Requestors: crowston@protonmail.com
      Status: new
 Ticket <URL: https://krbdev.mit.edu/rt/Ticket/Display.html?id=8968 >


(Apologies if this is the wrong list for reporting bugs. Please redirect me to the right list if I am here in error.)

I had to make some changes to the sources to build krb5-1.18.3 on my system.

$ uname -a
OpenBSD virt-openbsd.xxx 6.8 GENERIC.MP#1 amd64

Firstly, gcc on OpenBSD is 4.2.1, now very elderly. By default, ./configure uses gcc if it finds it, but I was not able to compile using gcc. Instead, I used clang, which is the supported compiler for OpenBSD on amd64 and available as 'cc'.

./configure CC=cc CXX=c++

I suggest that ./configure be changed to use clang by default on OpenBSD.

Secondly, ld on OpenBSD amd64 is now ld.lld, the llvm linker, not ld the GNU linker.

$ ld --version
LLD 10.0.1 (compatible with GNU linkers)

For whatever reason, when invoking ld directly, it is not able to find the default libraries in /usr/lib. Instead I modified the shlib.conf script to use the clang driver to run the linker.

--- /dev/fd/11  Sat Nov 21 16:08:26 2020
+++ src/config/shlib.conf  Sat Nov 21 12:57:34 2020
@@ -340,7 +340,7 @@
        PICFLAGS=-fpic
        SHLIBVEXT='.so.$(LIBMAJOR).$(LIBMINOR)'
        SHLIBEXT=.so
-       LDCOMBINE='ld -Bshareable'
+       LDCOMBINE='$(CC) -shared -fPIC -Wl,-h,$(LIBPREFIX)$(LIBBASE)$(SHLIBVEXT)'
        SHLIB_RPATH_FLAGS='-R$(SHLIB_RDIRS)'
        SHLIB_EXPFLAGS='$(SHLIB_RPATH_FLAGS) $(SHLIB_DIRS) $(SHLIB_EXPLIBS)'
        RPATH_FLAG=-R

I suggest that patch be implemented; there is not a lot of reason to support older versions of OpenBSD.

Thirdly, util/verto expects to be able to link against libm, the math library. However, on OpenBSD, the math functions are part of the native C library and there is no libm. I was able to resolve this by removing lm from SHLIB_EXPLIBS:

--- /dev/fd/11  Sat Nov 21 16:12:43 2020
+++ src/util/verto/Makefile.in      Sat Nov 21 12:05:30 2020
@@ -19,7 +19,7 @@
        $(OUTPRE)verto-k5ev.$(OBJEXT)
 SRCS=verto.c module.c verto-k5ev.c

-SHLIB_EXPLIBS= $(LIBS) -lm    # libm needed for ceil() currently.
+SHLIB_EXPLIBS= $(LIBS)

 VERTO_HDR=$(BUILDTOP)$(S)include$(S)verto.h

Indeed I believe that OpenBSD is not the only operating system to bundle the math libraries with libc. Therefore I propose that ./configure should detect whether ceil() can be invoked without -lm and only append -lm for platforms that require it.

Fourthly, pkinit seems incompatible with libressl, OpenBSD's replacement for openssl; we are missing some symbols such as OBJ_get0_data() and X509_get_key_usage(). I found that surprising, but I have no use for pkinit so in lieu of investigating I disabled it at configure time.

./configure CC=cc CXX=c++ --disable-pkinit

Until pkinit is properly fixed I suggest --disable-pkinit become the default on OpenBSD.

With these four minor changes I was able to build and install MIT Kerberos 5 1.18.3 on my OpenBSD system. Thank you for your work on this product.

— RHC.



_______________________________________________
krb5-bugs mailing list
krb5-bugs@mit.edu
https://mailman.mit.edu/mailman/listinfo/krb5-bugs


home help back first fref pref prev next nref lref last post