[krbdev.mit.edu #6643] Problem with krb5 libcom_err vs. system libcom_err

The RT System itself via RT rt-comment at krbdev.mit.edu
Mon Jan 18 16:11:49 EST 2010


>From krb5-bugs-incoming-bounces at PCH.mit.edu  Mon Jan 18 16:11:47 2010
Return-Path: <krb5-bugs-incoming-bounces at PCH.mit.edu>
Received: from pch.mit.edu (PCH.MIT.EDU [18.7.21.90])
	by krbdev.mit.edu (Postfix) with ESMTP id CE5AA3DEC0;
	Mon, 18 Jan 2010 16:11:47 -0500 (EST)
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 o0ILBljv005988;
	Mon, 18 Jan 2010 16:11:47 -0500
Received: from pacific-carrier-annex.mit.edu (PACIFIC-CARRIER-ANNEX.MIT.EDU
	[18.7.21.83])
	by pch.mit.edu (8.13.6/8.12.8) with ESMTP id o0HFWd1c031251
	for <krb5-bugs-incoming at PCH.mit.edu>; Sun, 17 Jan 2010 10:32:39 -0500
Received: from dmz-mailsec-scanner-3.mit.edu (DMZ-MAILSEC-SCANNER-3.MIT.EDU
	[18.9.25.14])
	by pacific-carrier-annex.mit.edu (8.13.6/8.9.2) with ESMTP id
	o0HFX3j9004400
	for <krb5-bugs at mit.edu>; Sun, 17 Jan 2010 10:33:16 -0500 (EST)
X-AuditID: 1209190e-b7b45ae000000c32-34-4b532d96b9e6
Received: from zero.voxel.net (zero.voxel.net [69.9.191.6])
	by dmz-mailsec-scanner-3.mit.edu (Symantec Brightmail Gateway) with
	SMTP id 4C.57.03122.69D235B4; Sun, 17 Jan 2010 10:32:38 -0500 (EST)
Received: from mail.voxel.net (localhost [127.0.0.1])
	by zero.voxel.net (Postfix) with ESMTP id 3A6DAE0C221
	for <krb5-bugs at mit.edu>; Sun, 17 Jan 2010 10:32:38 -0500 (EST)
Received: from 65.4.27.184 (SquirrelMail authenticated user mike at flyn.org)
	by mail.voxel.net with HTTP; Sun, 17 Jan 2010 10:32:38 -0500 (EST)
Message-ID: <322e409f937397efa02d9dd181f7a1dc.squirrel at mail.voxel.net>
Date: Sun, 17 Jan 2010 10:32:38 -0500 (EST)
Subject: Problem with krb5 libcom_err vs. system libcom_err
From: "W. Michael Petullo" <mike at flyn.org>
To: krb5-bugs at mit.edu
User-Agent: SquirrelMail/1.4.15
MIME-Version: 1.0
Content-Type: text/plain;charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Priority: 3 (Normal)
Importance: Normal
X-Brightmail-Tracker: AAAAARJ2QKE=
X-Mailman-Approved-At: Mon, 18 Jan 2010 16:11:46 -0500
X-BeenThere: krb5-bugs-incoming at mailman.mit.edu
X-Mailman-Version: 2.1.6
Precedence: list
Sender: krb5-bugs-incoming-bounces at PCH.mit.edu
Errors-To: krb5-bugs-incoming-bounces at PCH.mit.edu

>Confidential:  no
>Synopsis:      Problem with krb5 libcom_err vs. system libcom_err
>Severity:      serious
>Priority:      low
>Category:      krb5-libs
>Class:         sw-bug
>Release:       1.7
>Environment:
System: OpenWRT Linux-based cross-compile environment
Architecture: MIPS32

>Description:
I am building krb5 within OpenWRT, a Linux/GCC-based cross-compile
environment that targets embedded systems. I have found a problem in
krb5's build system with regard to libcom_err. In my build environment,
there exists both libcom_err.so.3 (in the krb5 tree) and libcom_err.so.2
(installed in the build system library directory). I want to use krb5's
libcom_err.so.3. In fact, libcom_err.so.2 is merely a side affect of
building another package and is not ever installed on the target device.

The makefile for krb5kdc is fine. It contains the following rule:

CC_LINK=$(CC) $(PROG_LIBPATH) $(PROG_RPATH_FLAGS) $(CFLAGS) $(LDFLAGS)

This means that the linker finds libcom_err.so.3 first (-L../lib before
-L/BUILD/SYSTEM/LIBS)

However, the makefiles for the libraries (for example, libkadm5clnt.so)
are broken:

MAKE_SHLIB_COMMAND=$(CC) -shared -fPIC
-Wl,-h,$(LIBPREFIX)$(LIBBASE)$(SHLIBSEXT),--no-undefined $(LDFLAGS) -o $@
$$objlist $(SHLIB_EXPFLAGS) -Wl,--version-script binutils.versions &&
$(PERL) -w $(SRCTOP)/util/export-check.pl $(SHLIB_EXPORT_FILE) $@

Here, $(LDFLAGS) is before $(SHLIB_EXPFLAGS). The result is the
-L/BUILD/SYSTEM/LIBS is before -L../../../lib and the libraries link
against libcom_err.so.2.

>How-To-Repeat:
Set LDCONFIG to point to a directory with libcom_err and build krb5.

>Fix:
diff -u --recursive krb5-1.7-vanilla/src/config/shlib.conf
krb5-1.7/src/config/shlib.conf
--- krb5-1.7-vanilla/src/config/shlib.conf      2008-12-08
17:33:07.000000000 -0500
+++ krb5-1.7/src/config/shlib.conf      2010-01-15 22:04:16.345151448 -0500
@@ -409,9 +409,9 @@
        SHLIBEXT=.so
        # Linux ld doesn't default to stuffing the SONAME field...
        # Use objdump -x to examine the fields of the library
-       LDCOMBINE='$(CC) -shared -fPIC
-Wl,-h,$(LIBPREFIX)$(LIBBASE)$(SHLIBSEXT),--no-undefined $(LDFLAGS)'
+       LDCOMBINE='$(CC) -shared -fPIC
-Wl,-h,$(LIBPREFIX)$(LIBBASE)$(SHLIBSEXT),--no-undefined'
        #
-       LDCOMBINE_TAIL='-Wl,--version-script binutils.versions && $(PERL)
-w $(SRCTOP)/util/export-check.pl $(SHLIB_EXPORT_FILE) $@'
+       LDCOMBINE_TAIL='-Wl,--version-script binutils.versions $(LDFLAGS)
&& $(PERL) -w $(SRCTOP)/util/export-check.pl $(SHLIB_EXPORT_FILE) $@'
        SHLIB_EXPORT_FILE_DEP=binutils.versions
        # For cases where we do have dependencies on other libraries
        # built in this tree...






More information about the krb5-bugs mailing list