[krbdev.mit.edu #8996] compiling krb5 static library

"Xiaoyi Wu via RT" <[email protected]>
Newsgroups gmane.comp.encryption.kerberos.bugs
Message-ID <[email protected]>
Tue Mar 30 02:05:25 2021: Request 8996 was acted upon.
 Transaction: Ticket created by [email protected]
       Queue: krb5
     Subject: compiling krb5 static library
       Owner: Nobody
  Requestors: [email protected]
      Status: new
 Ticket <URL: https://krbdev.mit.edu/rt/Ticket/Display.html?id=8996 >


Hi,
I downloaded krb5-1.19.1.tar.gz, and was trying to compile the static library from it.  In the src sub-directory, I issued these two commands:
$ configure --enable-static --disable-shared$ make
The second command failed with these output:
...making all in kadmin/dbutil...make[2]: Entering directory '/home/wxy/lima/build/krb5-1.19.1/src/kadmin/dbutil'gcc -L../../lib -Wl,--enable-new-dtags -Wl,-rpath -Wl,/usr/local/lib -g -O2   -o kdb5_util kdb5_util.o kdb5_create.o kadm5_create.o kdb5_destroy.o kdb5_stash.o import_err.o strtok.o dump.o ovload.o kdb5_mkey.o tabdump.o tdumputil.o ../cli/getdate.o -lkadm5srv_mit  -lkdb5 -lkrb5_db2 -lkadm5srv_mit -lgssrpc -lgssapi_krb5 -lgssrpc -lgssapi_krb5 -ldl -pthread  -lkrb5 -lk5crypto -lcom_err -lkrb5support  -lresolv  -ldl/usr/bin/ld: ../../lib/libkadm5srv_mit.a(server_kdb.o):/home/wxy/lima/build/krb5-1.19.1/src/lib/kadm5/srv/server_kdb.c:18: multiple definition of `master_keyblock'; kdb5_util.o:/home/wxy/lima/build/krb5-1.19.1/src/kadmin/dbutil/kdb5_util.c:109: first defined herecollect2: error: ld returned 1 exit statusmake[2]: *** [Makefile:664: kdb5_util] Error 1make[2]: Leaving directory '/home/wxy/lima/build/krb5-1.19.1/src/kadmin/dbutil'make[1]: *** [Makefile:8!
 66: all-r
 ecurse] Error 1make[1]: Leaving directory '/home/wxy/lima/build/krb5-1.19.1/src/kadmin'make: *** [Makefile:1554: all-recurse] Error 1
However, there is a work around.  If I configure and compile the default dynamic library first, then re-configure and compile the static library, it will be successful.  The following command sequence will work fine:
$ configure$ make$ configure --enable-static --disable-shared$ make
The environment is Fedora 33:
$ uname -aLinux dark1 5.11.10-200.fc33.x86_64 #1 SMP Thu Mar 25 16:51:31 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
$ gcc -vUsing built-in specs.COLLECT_GCC=gccCOLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/10/lto-wrapperOFFLOAD_TARGET_NAMES=nvptx-noneOFFLOAD_TARGET_DEFAULT=1Target: x86_64-redhat-linuxConfigured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,objc,obj-c++,ada,go,d,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linuxThread model: posixSupported LTO compression algorithms: zlib zstdgcc version 10.2.1!
  20201125
  (Red Hat 10.2.1-9) (GCC) 

Hope someone will fix the issue for future releases.
Xiaoyi Wu

_______________________________________________
krb5-bugs mailing list
[email protected]
https://mailman.mit.edu/mailman/listinfo/krb5-bugs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.