From krb5-bugs-incoming-bounces@PCH.mit.edu Mon Feb 22 11:14:24 2010 Return-Path: Received: from pch.mit.edu (PCH.MIT.EDU [18.7.21.90]) by krbdev.mit.edu (Postfix) with ESMTP id 4EAAE3F0EA; Mon, 22 Feb 2010 11:14:24 -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 o1MGEOgn013520; Mon, 22 Feb 2010 11:14:24 -0500 Received: from mailhub-dmz-4.mit.edu (MAILHUB-DMZ-4.MIT.EDU [18.7.62.38]) by pch.mit.edu (8.13.6/8.12.8) with ESMTP id o1KNQY71028257 for ; Sat, 20 Feb 2010 18:26:35 -0500 Received: from dmz-mailsec-scanner-2.mit.edu (DMZ-MAILSEC-SCANNER-2.MIT.EDU [18.9.25.13]) by mailhub-dmz-4.mit.edu (8.13.8/8.9.2) with ESMTP id o1KNQYDk015738 for ; Sat, 20 Feb 2010 18:26:34 -0500 X-AuditID: 1209190d-b7cf8ae00000096b-56-4b806faa7fe1 Received: from vhost2.lga6.us.voxel.net (vhost2.lga6.us.voxel.net [72.251.193.170]) by dmz-mailsec-scanner-2.mit.edu (Symantec Brightmail Gateway) with SMTP id 54.CE.02411.AAF608B4; Sat, 20 Feb 2010 18:26:34 -0500 (EST) Received: (qmail 29230 invoked by uid 108); 20 Feb 2010 18:26:34 -0500 Received: from unknown (HELO imp.local) (mike@flyn.org@72.146.12.149) by vhost2.lga6.us.voxel.net with AES256-SHA encrypted SMTP; 20 Feb 2010 18:26:34 -0500 Received: by imp.local (Postfix, from userid 1101) id AE3F63B; Sat, 20 Feb 2010 17:58:57 -0500 (EST) To: krb5-bugs@mit.edu Subject: From: mike@flyn.org X-send-pr-version: 3.99 Message-Id: <20100220225857.AE3F63B@imp.local> Date: Sat, 20 Feb 2010 17:58:57 -0500 (EST) X-Brightmail-Tracker: AAAAAxLvamcS8ELgEvBWdw== X-Mailman-Approved-At: Mon, 22 Feb 2010 11:14:22 -0500 X-BeenThere: krb5-bugs-incoming@mailman.mit.edu X-Mailman-Version: 2.1.6 Precedence: list Reply-To: mike@flyn.org Sender: krb5-bugs-incoming-bounces@PCH.mit.edu Errors-To: krb5-bugs-incoming-bounces@PCH.mit.edu >Submitter-Id: net >Originator: W. Michael Petullo >Organization: The Oakbud Company >Confidential: no >Synopsis: Problem with krb5 libcom_err vs. system libcom_err >Severity: serious >Priority: low >Category: krb5-build >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...