libgssapi.a and libgssapi_krb5.a cannot both be used

Ruslan Ermilov ru at FreeBSD.org
Fri Feb 26 12:21:58 UTC 2010


Doug,

The libgssapi.a and libgssapi_krb5.a libraries both define the
same symbols that makes static linkage using them impossible in
some cases, e.g. when trying to link sshd(8) statically.  Details
are below.

On Fri, Feb 26, 2010 at 12:12:54PM +0000, Ruslan Ermilov wrote:
> Author: ru
> Date: Fri Feb 26 12:12:54 2010
> New Revision: 204355
> URL: http://svn.freebsd.org/changeset/base/204355
> 
> Log:
>   (Almost) fixed static linkage.  The remaining problem is with
>   libgssapi.a and libgssapi_krb5.a libraries that define the
>   same symbols.

After this fix, the static build still fails like this:

%%%
Script started on Fri Feb 26 15:15:30 2010
# pwd
/usr/src/secure/usr.sbin/sshd
# make -DNO_SHARED
cc -O2 -pipe  -I/usr/src/secure/usr.sbin/sshd/../../../crypto/openssh -include ssh_namespace.h -DUSE_BSM_AUDIT -DHAVE_GETAUDIT_ADDR -DGSSAPI -DHAVE_GSSAPI_GSSAPI_H=1 -DHAVE_GSSAPI_GSSAPI_KRB5_H=1 -DKRB5 -DHEIMDAL -DNO_IDEA -std=gnu99 -fstack-protector -Wno-pointer-sign  -static -o sshd sshd.o auth-rhosts.o auth-passwd.o auth-rsa.o auth-rh-rsa.o sshpty.o sshlogin.o servconf.o serverloop.o auth.o auth1.o auth2.o auth-options.o session.o auth-chall.o auth2-chall.o groupaccess.o auth-skey.o auth-bsdauth.o auth2-hostbased.o auth2-kbdint.o auth2-none.o auth2-passwd.o auth2-pubkey.o auth2-jpake.o monitor_mm.o monitor.o monitor_wrap.o kexdhs.o kexgexs.o auth-krb5.o auth2-gss.o gss-serv.o gss-serv-krb5.o loginrec.o auth-pam.o auth-shadow.o auth-sia.o md5crypt.o audit.o audit-bsm.o platform.o sftp-server.o sftp-common.o roaming_common.o gss-genr.o -lssh -lutil -lz -lwrap -lpam -lkrb5 -lhx509 -lasn1 -lcrypto -lcrypt -lroken -lcom_err -lradius -ltacplus -lcrypt  -lutil -lopie -lmd -lssh -lcrypto -lcrypt -lypclnt -lbsm -lgssapi_krb5 -lgssapi -lkrb5 -lasn1 -lcrypto -lcrypt
/usr/lib/libgssapi.a(gss_names.o)(.data+0x0): multiple definition of `GSS_C_NT_USER_NAME'
/usr/lib/libgssapi_krb5.a(external.o)(.data+0x0): first defined here
/usr/lib/libgssapi.a(gss_names.o)(.data+0x4): multiple definition of `GSS_C_NT_MACHINE_UID_NAME'
/usr/lib/libgssapi_krb5.a(external.o)(.data+0x4): first defined here
/usr/lib/libgssapi.a(gss_names.o)(.data+0x8): multiple definition of `GSS_C_NT_STRING_UID_NAME'
/usr/lib/libgssapi_krb5.a(external.o)(.data+0x8): first defined here
/usr/lib/libgssapi.a(gss_names.o)(.data+0xc): multiple definition of `GSS_C_NT_HOSTBASED_SERVICE_X'
/usr/lib/libgssapi_krb5.a(external.o)(.data+0xc): first defined here
/usr/lib/libgssapi.a(gss_names.o)(.data+0x10): multiple definition of `GSS_C_NT_HOSTBASED_SERVICE'
/usr/lib/libgssapi_krb5.a(external.o)(.data+0x10): first defined here
/usr/lib/libgssapi.a(gss_names.o)(.data+0x14): multiple definition of `GSS_C_NT_ANONYMOUS'
/usr/lib/libgssapi_krb5.a(external.o)(.data+0x14): first defined here
/usr/lib/libgssapi.a(gss_names.o)(.data+0x18): multiple definition of `GSS_C_NT_EXPORT_NAME'
/usr/lib/libgssapi_krb5.a(external.o)(.data+0x18): first defined here
/usr/lib/libgssapi.a(gss_names.o)(.data+0x1c): multiple definition of `GSS_KRB5_NT_PRINCIPAL_NAME'
/usr/lib/libgssapi_krb5.a(external.o)(.data+0x1c): first defined here
/usr/lib/libgssapi.a(gss_names.o)(.data+0x20): multiple definition of `GSS_KRB5_NT_USER_NAME'
/usr/lib/libgssapi_krb5.a(external.o)(.data+0x20): first defined here
/usr/lib/libgssapi.a(gss_names.o)(.data+0x24): multiple definition of `GSS_KRB5_NT_MACHINE_UID_NAME'
/usr/lib/libgssapi_krb5.a(external.o)(.data+0x24): first defined here
/usr/lib/libgssapi.a(gss_names.o)(.data+0x28): multiple definition of `GSS_KRB5_NT_STRING_UID_NAME'
/usr/lib/libgssapi_krb5.a(external.o)(.data+0x28): first defined here
*** Error code 1

Stop in /usr/src/secure/usr.sbin/sshd.
# 
%%%

Can you please fix this problem within libgss* libraries?


Thanks,
-- 
Ruslan Ermilov
ru at FreeBSD.org
FreeBSD committer


More information about the svn-src-all mailing list