Skip Menu |
 

Subject: 'krb5-config --libs' does not show '-lkrb5support' [Version: krb5-1.14.3]
To: krb5-bugs@mit.edu
From: rl <rainer.laatsch@t-online.de>
Date: Mon, 29 Aug 2016 13:46:31 +0200
Download (untitled) / with headers
text/plain 2.7KiB

The missing -lkrb5support shows up in trying to compile openssh-7.3p1
which uses 'krb5-config --libs' in their configure script to get at the
krb5 libraries. So it does not compile.

A possible patch might be:

---snip----------------------------------------
*** krb5-1.14.3/src/build-tools/krb5-config Sun Aug 28 15:38:52 2016
--- /opt/krb5/bin/krb5-config Mon Aug 29 12:08:30 2016
***************
*** 255,264 ****
fi

# If we ever support a flag to generate output suitable for static
! # linking, we would output "-lkrb5support $GEN_LIB $LIBS $DL_LIB"
# here.

! echo $lib_flags
fi

exit 0
--- 255,264 ----
fi

# If we ever support a flag to generate output suitable for static
! # linking, we would output "$lib_flags -lkrb5support $GEN_LIB
$LIBS $DL_LIB"
# here.

! echo "$lib_flags -lkrb5support"
fi

exit 0
---snip----------------------------------------


On my host:
# uname -a
Linux CentOS-67-64-minimal 2.6.32-642.3.1.el6.x86_64 #1 SMP Tue Jul 12
18:30:56 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
# uname -m
x86_64

# cat /etc/system-release /etc/redhat-release /etc/centos-release
CentOS release 6.8 (Final)
CentOS release 6.8 (Final)
CentOS release 6.8 (Final)

The krb5-1.14.3 was configured with this script:
---snip----------------------------------------
#!/bin/ksh

if uname -m | grep _64 ; then # 64 bit machine
export USE_64=1 # ?
LDFLAGS="-L/lib64 -m64"
CFLAGS="-L/lib64 -m64"
fi

LDFLAGS="$LDFLAGS -lm" # -lm for VERTO_LIBS
CFLAGS=" $CFLAGS -lm"
LDFLAGS="$LDFLAGS -fPIC" # -fPIC for openssh linking
CFLAGS=" $CFLAGS -fPIC"
export LDFLAGS CFLAGS

./configure --prefix=/opt/krb5 --disable-shared --enable-static
--disable-rpath
---snip----------------------------------------

Note the static flag. At the end of krb5-config, there is a comment
about static and krb5support.

The ssh version is openssh-7.3p1 .
Around line 32864 in openssh-7.3p1/configure the krb5-config is used:
K5LIBS="`$KRB5CONF --libs`"

There, the krb5support is missing.

After applying the patch above, krb5-config --libs shows:
# krb5-config --libs
-L/opt/krb5/lib -L/lib64 -m64 -lm -fPIC -lkrb5 -lk5crypto -lcom_err
-lkrb5support

, which is good.

The openssh-7.3p1 was configured with this script:

---snip----------------------------------------
:

export USE_64=1 # ?
export LDFLAGS=" -m64 -L/lib64"
export CFLAGS=" -m64 -L/lib64"

CFGOPTS="--prefix=/opt/openssh --libexecdir=/opt/openssh/sbin
--with-default-path=/opt/openssh/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/afsws/bin
--with-mantype=man --sysconfdir=/etc/ssh --with-pid-dir=/var/run
--without-rpath --with-md5-passwords"
CFGOPTS="$CFGOPTS --with-kerberos5=/opt/krb5"

./configure $CFGOPTS
---snip----------------------------------------




Best regards
Rainer
The --enable-static --disable-shared configure flags for krb5 aren't
supported, and should probably be removed. They was added so that we could
use gcov to measure the code coverage of our test suite, but gcov now
supports shared libraries.

We definitely don't want to output -lkrb5support for everyone in krb5-
config; that would unnecessarily include libkrb5support in the direct
library dependencies of programs built against krb5.
Subject: Re: [krbdev.mit.edu #8487] 'krb5-config --libs' does not show '-lkrb5support' [Version: krb5-1.14.3]
To: rt-comment@krbdev.mit.edu
From: rl <rainer.laatsch@t-online.de>
Date: Mon, 29 Aug 2016 17:36:15 +0200
RT-Send-Cc:


On 08/29/16 17:21, Greg Hudson via RT wrote:
Show quoted text
> The --enable-static --disable-shared configure flags for krb5 aren't
> supported, and should probably be removed. They was added so that we could
> use gcov to measure the code coverage of our test suite, but gcov now
> supports shared libraries.
>
> We definitely don't want to output -lkrb5support for everyone in krb5-
> config; that would unnecessarily include libkrb5support in the direct
> library dependencies of programs built against krb5.
>

I understand the arguments. The openssh compilation can easily be fixed
(manually adding -lkrb5support).
Please close this RT ticket.

Thank you very much for your quick answer,
Rainer