Skip Menu |
 

Date: Sat, 3 Jun 2006 17:50:22 -0400 (EDT)
From: Ezra Peisach <epeisach@MIT.EDU>
To: krb5-bugs@MIT.EDU
Subject: 1.5 alpha: cannot compile static only...

Now that libkrb5 depends on the plugin interface, one cannot configure
--disable-shared --enable-static and get it to compile - there is a link
dependency on libdl (dlopen, etc).

Why would I want this... On occasion, I have wanted to copy a staticly
linked executable to another machine - for which I then only need a
krb5.conf.

We are "winning" because when linking shared libraries - we "win" - as
the support library will drag in libdl. Probably KRB5_BASE_LIBS should
be modified to include DL_LIB.

Currently, the build tree Makefile.in only specifies DL_LIB when
KDB5_LIBS are used - so for the kdc kadmind, etc.

Also - krb5-config should be modified as well...

Ezra
From: Ken Raeburn <raeburn@MIT.EDU>
Subject: Re: [krbdev.mit.edu #3838] 1.5 alpha: cannot compile static only...
Date: Mon, 5 Jun 2006 19:37:09 -0400
To: MIT Kerberos RT <rt@krbdev.mit.edu>
RT-Send-Cc:
Yep, static builds are definitely low priority at the moment. Adding
DL_LIB is a start, but the db2 code still won't build properly; some
confusion between our configure scripts and makefiles for the
different kinds of target objects that can be built....

Ken
From: raeburn@mit.edu
Subject: CVS Commit
* config/pre.in (KRB5_BASE_LIBS): Add $(DL_LIB).
* krb5-config.in: Add DL_LIB.

Commit By: raeburn



Revision: 18149
Changed Files:
U trunk/src/config/pre.in
U trunk/src/krb5-config.in
Download (untitled) / with headers
text/plain 4.8KiB
From krb5-bugs-incoming-bounces@PCH.mit.edu Fri Aug 4 23:33:57 2006
Received: from pch.mit.edu (PCH.MIT.EDU [18.7.21.90]) by krbdev.mit.edu (8.9.3p2) with ESMTP
id XAA21661; Fri, 4 Aug 2006 23:33:57 -0400 (EDT)
Received: from pch.mit.edu (pch.mit.edu [127.0.0.1])
by pch.mit.edu (8.13.6/8.12.8) with ESMTP id k753XHU4012719
for <krb5-send-pr@krbdev.mit.edu>; Fri, 4 Aug 2006 23:33:17 -0400
Received: from fort-point-station.mit.edu (FORT-POINT-STATION.MIT.EDU
[18.7.7.76])
by pch.mit.edu (8.13.6/8.12.8) with ESMTP id k74D4orl013765
for <krb5-bugs-incoming@PCH.mit.edu>; Fri, 4 Aug 2006 09:04:50 -0400
Received: from mit.edu (W92-130-BARRACUDA-2.MIT.EDU [18.7.21.223])
by fort-point-station.mit.edu (8.13.6/8.9.2) with ESMTP id
k74D4rBl018429
for <krb5-bugs@mit.edu>; Fri, 4 Aug 2006 09:04:53 -0400 (EDT)
Received: from coppi.bath.ac.uk (coppi.bath.ac.uk [138.38.32.23])
(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
(No client certificate requested)
by mit.edu (Spam Firewall) with ESMTP id A54663AB60
for <krb5-bugs@mit.edu>; Fri, 4 Aug 2006 09:04:30 -0400 (EDT)
Received: from mary.bath.ac.uk ([138.38.32.14] ident=mmdf)
by coppi.bath.ac.uk with smtp id 1G8zLn-0007H2-FW
for krb5-bugs@mit.edu
(return-path <D.H.Davis@bath.ac.uk>); Fri, 04 Aug 2006 14:04:28 +0100
Received: from hinault.bath.ac.uk
( [oM937cuI2+aa3fSHE1XjgT+OHQbg4X3X]@hinault.bath.ac.uk [138.38.52.28]
) by bath.ac.uk id aa29533 ; 4 Aug 2006 14:04 +0100
Received: from ccsdhd by hinault.bath.ac.uk with local id 1G8zLm-0005Ns-BQ;
Fri, 04 Aug 2006 14:04:26 +0100
To: krb5-bugs@mit.edu
Subject: Problems building krb5-1.5 with static libraries on OpenBSD3.9.
From: Dennis Davis <D.H.Davis@bath.ac.uk>
X-send-pr-version: 3.99
Message-Id: <E1G8zLm-0005Ns-BQ@hinault.bath.ac.uk>
Date: Fri, 04 Aug 2006 14:04:26 +0100
X-Scanner: 67bb9ca424d3cccf619cc9d32429bbc2639dd8f8
X-Spam-Score: 0.12
X-Spam-Flag: NO
X-Scanned-By: MIMEDefang 2.42
X-Mailman-Approved-At: Fri, 04 Aug 2006 23:33:14 -0400
Cc: Dennis Davis <d.h.davis@bath.ac.uk>
X-BeenThere: krb5-bugs-incoming@mailman.mit.edu
X-Mailman-Version: 2.1.6
Precedence: list
Reply-To: Dennis Davis <D.H.Davis@bath.ac.uk>
Sender: krb5-bugs-incoming-bounces@PCH.mit.edu
Errors-To: krb5-bugs-incoming-bounces@PCH.mit.edu


Show quoted text
>Submitter-Id: net
>Originator: Dennis Davis
>Organization:
University of Bath, UK
Show quoted text
>Confidential: no
>Synopsis: Can't build krb5-1.5-signed.tar with static libraries on OpenBSD3.9
>Severity: non-critical
>Priority: low
>Category: krb5-build
>Class: sw-bug
>Release: 1.5
>Environment:
merckx.bath.ac.uk [138.38.52.201],
running OpenBSD3.9
System: OpenBSD merckx.bath.ac.uk 3.9 EXIM_SERVER#0 i386


Show quoted text
>Description:
I can configure krb5-1.5-signed.tar on OpenBSD3.9 with a command
line of the form:

LDFLAGS=-lpthread \
CC=cc CFLAGS="-O2 -fPIC" \
./configure --prefix=/kerberosV \
--enable-dns-for-realm --without-krb4 \
--with-tcl=/usr/local --enable-shared \
--disable-static --enable-thread-support

and the build works fine. I can tweak the code to cater for the
problem noted in:

http://krbdev.mit.edu/rt/Ticket/Display.html?id=3971

and it all seems to run OK.

Building with static and dynamic libraries requires:

LDFLAGS=-lpthread \
CC=cc CFLAGS="-O2 -fPIC" \
./configure --prefix=/kerberosV \
--enable-dns-for-realm --without-krb4 \
--with-tcl=/usr/local --enable-shared \
--enable-static --enable-thread-support

However the build fails with:

making all in plugins/kdb/db2/libdb2/test...
cp ./include/db.h ../../../../include/db.h
cp include/db-config.h ../../../../include/db-config.h
cp ./include/db-ndbm.h ../../../../include/db-ndbm.h
rm -f libdb.a
building static db library
set -x; objlist=`set -x && perl -p -e 'BEGIN { $SIG{__WARN__} = sub {die @_} }; $e=$ARGV; $e =~ s/OBJS\...$//; s/^/ /; s/ $//; s/ / $e/g;' hash/OBJS.ST btree/OBJS.ST db/OBJS.ST mpool/OBJS.ST recno/OBJS.ST clib/OBJS.ST` && ar cq libdb.a $objlist
+ set -x
+ perl -p -e BEGIN { $SIG{__WARN__} = sub {die @_} }; $e=$ARGV; $e =~ s/OBJS\...$//; s/^/ /; s/ $//; s/ / $e/g; hash/OBJS.ST btree/OBJS.ST db/OBJS.ST mpool/OBJS.ST recno/OBJS.ST clib/OBJS.ST
Can't open hash/OBJS.ST: No such file or directory.
+ objlist=
*** Error code 2

Stop in /tmp/krb5-1.5/src/plugins/kdb/db2/libdb2 (line 642 of Makefile).
*** Error code 1

Stop in /tmp/krb5-1.5/src/plugins/kdb/db2 (line 1053 of Makefile).
*** Error code 1

Stop in /tmp/krb5-1.5/src (line 1336 of Makefile).

and if I fix this I get a succession of similar failures.

Show quoted text
>How-To-Repeat:
Not applicable.
Show quoted text
>Fix:
Run the following simple script after configuring as above and *before*
the main build.

#!/bin/sh

for i in \
./plugins/kdb/db2/libdb2/hash \
./plugins/kdb/db2/libdb2/db \
./plugins/kdb/db2/libdb2/mpool \
./plugins/kdb/db2/libdb2/btree \
./plugins/kdb/db2/libdb2/recno \
./plugins/kdb/db2/libdb2/clib
do
(cd $i; make OBJS.ST)
done
Date: Tue, 01 Apr 2008 11:57:36 -0700
From: sam sharma <sam.sharma@gat.com>
Subject: Kerberos static library compilation
To: krb5-bugs@mit.edu
CC: "'Constantin Scheder'" <constantin.scheder@ga.com>
Download (untitled) / with headers
text/plain 1.4KiB

Hi

 

We are using MIT Kerberos to provide secure authentication and communication in our applications. I am trying to migrate from MIT krb5 1.5.x to 1.6.x version and I noticed that the static library compilation is not available in latest MIT krb5 source code configuration.

 

There must be some valid reasons to remove the static library compilation from latest MIT krb5 source code. We came across problems while using Postgres DB installed on system (which depends on older Kerberos versions) and our application (which may depend on latest Kerberos version).

 

This problem can be solved in two different ways:

 

  1. We use the same MIT Kerberos libraries in our application as used in postgres db development libraries. We have no control over the postgres database installation on target system where our application supposed to run. Also we may have to compile and manage multiple versions of our application for different MIT versions.

  2. We used static Kerberos libraries from krb5 1.5 source code in our application to separate the API call interaction between third party development libraries i.e. postgres and our application.

 

Please let us know if static libraries can be compiled in the latest krb5 1.6 source code release. Is it possible to adjust the configure scripts to introduce the static library compilation back. In anyway we can help in this effort to put back to static Kerberos library compilation.

 

SAM SHARMA

 

From: Ken Raeburn <raeburn@MIT.EDU>
Subject: Re: [krbdev.mit.edu #5935] Kerberos static library compilation
Date: Wed, 2 Apr 2008 15:13:27 -0400
To: rt@krbdev.mit.edu
RT-Send-Cc:
Download (untitled) / with headers
text/plain 2.8KiB
Show quoted text
> There must be some valid reasons to remove the static library
> compilation
> from latest MIT krb5 source code.

Yes: It was a pain to maintain the ability to compile libraries in
multiple modes, and deal with platforms like AIX where you don't
actually distinguish between them based on library suffix. Also,
we've added a plugin architecture that wants to be able to
dynamically load code that may depend on the Kerberos library or (for
internally built modules) internal libraries, and thus would need the
shared Kerberos library anyways. So now internal libraries that

These are not necessarily insurmountable problems, but most of the
approaches we've considered are either not trivial to implement or
raise issues that need some serious consideration (or both). For
example, statically linking in a bunch of "plugins" for the static
build means resolving name conflicts across all plugins we ship.
Some of the plugin interfaces currently work by providing one or more
dynamic object files in directory X that define symbol Y; that would
have to change, at least for the static mode. Removing dependencies
of dynamic plugins on the Kerberos libraries (that would no longer be
available dynamically) may be possible, by explicitly passing to the
plugin a structure holding function pointers for everything it could
possibly want, but it's ugly, and we don't have a good list of
symbols for that right now. (We have an export list used for
building shared libraries on Windows and Mac; it may or may not be
enough for plugins, but we know it's not enough to implement our own
KDC. We have another export list we use on UNIX, which is basically
everything including a bunch of private internal APIs you shouldn't
touch, and it will eventually get trimmed down; initially it was just
a placeholder so we could implement the *use* of the export list on
various UNIX platforms, and then worry about what the right export
list was later.)

You may be able to hack the configure scripts and Makefiles into
generating static libraries that can't load some plugins, and
building a KDC that won't work, etc., which may be enough for you.
We're probably not going to give you support for that kind of build
process though.

If you or someone else wants to dig into the issues around restoring
static builds -- I suspect the plugin handling is the biggest part of
it, but I'd also like to see a more general way of extending the
build process to multiple suffixes for object files, multiple
libraries, etc -- I'd be happy to try to give some feedback, but for
most of the "customer" base I think shared-only libraries work well
enough (based on feedback or at least lack of complaints, from end
users, system integrators, Kerberos Consortium members, etc), so it
hasn't been a priority for us to put effort into this currently,
relative to other projects in the works....

Ken
Date: Thu, 10 Apr 2008 13:03:31 -0700
From: sam sharma <sam.sharma@gat.com>
Subject: RE: [krbdev.mit.edu #5935] Kerberos static library compilation
To: rt-comment@krbdev.mit.edu
CC: "'Constantin Scheder'" <constantin.scheder@GA.com>
RT-Send-Cc:
Download (untitled) / with headers
text/plain 4.6KiB
Hi Ken

Thanks for prompt reply.

I think the middle approach like generating all the dynamic libraries that
are generated right now and also bundle the respective object files into a
static library may solve our problem. I am not talking about a separate
static and dynamic build as supported in krb5 1.5.x series.

I may be able to hack into the Makefile.in and configure script files,
forward the changes to you. My main concern is to incorporate the changes
into Kerberos source code repository so that we do not have to do the
changes every time the new Kerberos version is released.

Also I am using MIT Kerberos libraries on the following platforms to build
our application, and hopefully cover most of the system in use.

1. Windows x86: 32 bit mode, VC 2005 compiler
2. Linux x86/x64: 32/64 bit mode, gcc compiler (x86 and AMD 64 systems
running fedora and red hat linux)
3. Solaris x86/x64: 32/64 bit mode, gcc compiler (x86 and AMD 64 systems
running Solaris 8 and 10)
4. Solaris Sparc: 32/64 bit mode, gcc compiler (Solaris Sparc system running
Solaris 8)
5. HP-UX: 32/64 bit mode, gcc compiler (HP system running HP-UX 11, I think)
6. AIX: 32/64 bit mode, gcc compiler (IBM system running AIX 5.2)
7. SGI: 32/64 bit mode, gcc compiler (SGI system running IRIX 6.5)
8. MAC PPC: 32 bit mode, gcc compiler (APPLE system running MAC OSX 10.4)
9. MAC X86: 32/64 bit mode, gcc compiler (APPLE system running MAC OSX 10.4)

We plan to compile our application and kerberos code in 32 and 64 bit mode
for all platforms possible and we are almost there.

SAM SHARMA

Show quoted text
-----Original Message-----
From: 0000-Admin [mailto:daemon@MIT.EDU] On Behalf Of Ken Raeburn via RT
Sent: Wednesday, April 02, 2008 12:14 PM
To: sam.sharma@gat.com
Subject: Re: [krbdev.mit.edu #5935] Kerberos static library compilation

> There must be some valid reasons to remove the static library
> compilation
> from latest MIT krb5 source code.

Yes: It was a pain to maintain the ability to compile libraries in
multiple modes, and deal with platforms like AIX where you don't
actually distinguish between them based on library suffix. Also,
we've added a plugin architecture that wants to be able to
dynamically load code that may depend on the Kerberos library or (for
internally built modules) internal libraries, and thus would need the
shared Kerberos library anyways. So now internal libraries that

These are not necessarily insurmountable problems, but most of the
approaches we've considered are either not trivial to implement or
raise issues that need some serious consideration (or both). For
example, statically linking in a bunch of "plugins" for the static
build means resolving name conflicts across all plugins we ship.
Some of the plugin interfaces currently work by providing one or more
dynamic object files in directory X that define symbol Y; that would
have to change, at least for the static mode. Removing dependencies
of dynamic plugins on the Kerberos libraries (that would no longer be
available dynamically) may be possible, by explicitly passing to the
plugin a structure holding function pointers for everything it could
possibly want, but it's ugly, and we don't have a good list of
symbols for that right now. (We have an export list used for
building shared libraries on Windows and Mac; it may or may not be
enough for plugins, but we know it's not enough to implement our own
KDC. We have another export list we use on UNIX, which is basically
everything including a bunch of private internal APIs you shouldn't
touch, and it will eventually get trimmed down; initially it was just
a placeholder so we could implement the *use* of the export list on
various UNIX platforms, and then worry about what the right export
list was later.)

You may be able to hack the configure scripts and Makefiles into
generating static libraries that can't load some plugins, and
building a KDC that won't work, etc., which may be enough for you.
We're probably not going to give you support for that kind of build
process though.

If you or someone else wants to dig into the issues around restoring
static builds -- I suspect the plugin handling is the biggest part of
it, but I'd also like to see a more general way of extending the
build process to multiple suffixes for object files, multiple
libraries, etc -- I'd be happy to try to give some feedback, but for
most of the "customer" base I think shared-only libraries work well
enough (based on feedback or at least lack of complaints, from end
users, system integrators, Kerberos Consortium members, etc), so it
hasn't been a priority for us to put effort into this currently,
relative to other projects in the works....

Ken
Date: Fri, 04 Apr 2014 13:31:14 +0200
From: Heinz-Ado Arnolds <arnolds@mpa-garching.mpg.de>
To: krb5-bugs@mit.edu
Subject: Problem with static build
CC: Hans-Werner Paulsen <hans@mpa-garching.mpg.de>
Dear krb-Developers,

first of all many thanks to your great work in Kerberos!

I found two problems when compiling krb5-1.12.1 statically:
- iaesx64 and iaesx86 won't be built since the rules in
src/lib/crypto/builtin/aes/Makefile.in will not work as they are fixed
to shared builds ("iaesx64@SHOBJEXT@"). With this the default rule get's
into work which takes "as" instead of "yasm". SHOBJEXT has to be
exchanged to STOBJEXT for the static build. Then it works as expected.
- You have to link libm together with libverto, since there is a call to
ceil in libverto.

Kind regards,

Heinz

Show quoted text
________________________________________________________________________

Dipl.-Ing. Heinz-Ado Arnolds

MPI für Astrophysik
Karl-Schwarzschild-Strasse 1 Postfach 1317
D-85748 Garching D-85741 Garching
Phone: +49/89/30000-2217
FAX : +49/89/30000-2388
email: arnolds[at]MPA-Garching.MPG.DE
________________________________________________________________________
Download smime.p7s
application/pkcs7-signature 4.6KiB

Message body not shown because it is not plain text.

From: "Basch, Richard" <Richard.Basch@gs.com>
To: "'krb5-bugs@mit.edu'" <krb5-bugs@mit.edu>
Date: Sat, 10 May 2014 21:21:59 -0400
Subject: Building Kerberos 1.12.1 (gcc -m64 -static) fails
CC: "'basch@alum.mit.edu'" <basch@alum.mit.edu>
Download (untitled) / with headers
text/plain 1.5KiB

If you use CC=”gcc –m64 –static –static-libgcc” (the –static-libgcc is optional) and specify –without-system-verto during configure, the build will fail in kdc:

../lib/libverto.a(verto-k5ev.o): In function `periodic_recalc':

verto-k5ev.c:(.text+0x2f0f): undefined reference to `ceil'

 

Unfortunately, -lverto is the last entry present on the link line, and the configure steps don’t appear to readily allow you to specify extra libs to be included at the end, such as –lm.

 

Build environment: RHEL 5, though I am sure this is true on several platforms.

 

______________________________________________________________________________

Richard Basch

VP, Technology - Critical Infrastructure

30 Hudson St.  24th Floor | Jersey City, NJ 07302
Goldman, Sachs & Co

richard.basch@gs.com  | +1 (917) 343-4071

 

P Save a tree: Please don't print this mail unless necessary.

 

The Goldman Sachs Group, Inc. All rights reserved.

See http://www.gs.com/disclaimer/global_email for important risk disclosures, conflicts of interest and other terms and conditions relating to this e-mail and your reliance on information contained in it.  This message may contain confidential or privileged information.  If you are not the intended recipient, please advise us immediately and delete this message.  See http://www.gs.com/disclaimer/email for further information on confidentiality and the risks of non-secure electronic communication.  If you cannot access these links, please notify us by reply message and we will send the contents to you.

 

From: Andrea Campi <andrea.campi@gmail.com>
Date: Sat, 10 May 2014 22:13:53 -0700
Subject: Re: [krbdev.mit.edu #7909] Building Kerberos 1.12.1 (gcc -m64 -static) fails
To: rt-comment@krbdev.mit.edu, rt@krbdev.mit.edu
RT-Send-Cc:
Download (untitled) / with headers
text/plain 1.1KiB



On Sat, May 10, 2014 at 9:54 PM, Richard Basch via RT <rt-comment@krbdev.mit.edu> wrote:
Show quoted text
If you use CC="gcc -m64 -static -static-libgcc" (the -static-libgcc is optional) and specify -without-system-verto during configure, the build will fail in kdc:
../lib/libverto.a(verto-k5ev.o): In function `periodic_recalc':
verto-k5ev.c:(.text+0x2f0f): undefined reference to `ceil'

Unfortunately, -lverto is the last entry present on the link line, and the configure steps don't appear to readily allow you to specify extra libs to be included at the end, such as -lm.

That's funny, I've just noticed that today and I was about to ask the ml :o

I'm actually using --enable-static --disable-shared , and I've noticed there is logic in configure (aclocal.m4 really) to tweak a few variables if enable_static. There might be an "ok" fix there.
However in a pinch I just added -lm to VERTO_LIBS in configure/configure.in; that got me though the build at least.



BTW this is not the only problem I've seen when doing a static build:
* iaesx64.s fails to build because the only Makefile rule is to build a .so
* building with -pie causes link failures

From: Andrea Campi <andrea.campi@gmail.com>
Date: Sat, 10 May 2014 22:13:53 -0700
Subject: Re: [krbdev.mit.edu #7909] Building Kerberos 1.12.1 (gcc -m64 -static) fails
To: rt-comment@krbdev.mit.edu, rt@krbdev.mit.edu
RT-Send-Cc:
Download (untitled) / with headers
text/plain 1.1KiB



On Sat, May 10, 2014 at 9:54 PM, Richard Basch via RT <rt-comment@krbdev.mit.edu> wrote:
Show quoted text
If you use CC="gcc -m64 -static -static-libgcc" (the -static-libgcc is optional) and specify -without-system-verto during configure, the build will fail in kdc:
../lib/libverto.a(verto-k5ev.o): In function `periodic_recalc':
verto-k5ev.c:(.text+0x2f0f): undefined reference to `ceil'

Unfortunately, -lverto is the last entry present on the link line, and the configure steps don't appear to readily allow you to specify extra libs to be included at the end, such as -lm.

That's funny, I've just noticed that today and I was about to ask the ml :o

I'm actually using --enable-static --disable-shared , and I've noticed there is logic in configure (aclocal.m4 really) to tweak a few variables if enable_static. There might be an "ok" fix there.
However in a pinch I just added -lm to VERTO_LIBS in configure/configure.in; that got me though the build at least.



BTW this is not the only problem I've seen when doing a static build:
* iaesx64.s fails to build because the only Makefile rule is to build a .so
* building with -pie causes link failures