[krbdev.mit.edu #8487] 'krb5-config --libs' does not show '-lkrb5support' [Version: krb5-1.14.3]

rl via RT rt-comment at krbdev.mit.edu
Mon Aug 29 11:13:34 EDT 2016


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



More information about the krb5-bugs mailing list