From rea-fbsd@codelabs.ru  Tue Sep 23 12:33:35 2008
Return-Path: <rea-fbsd@codelabs.ru>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 44E9A1065670
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 23 Sep 2008 12:33:35 +0000 (UTC)
	(envelope-from rea-fbsd@codelabs.ru)
Received: from 0.mx.codelabs.ru (0.mx.codelabs.ru [144.206.177.45])
	by mx1.freebsd.org (Postfix) with ESMTP id EFC818FC18
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 23 Sep 2008 12:33:34 +0000 (UTC)
	(envelope-from rea-fbsd@codelabs.ru)
Received: from shadow.codelabs.ru (shadow.codelabs.ru [144.206.177.8])
	by 0.mx.codelabs.ru with esmtps (TLSv1:CAMELLIA256-SHA:256)
	id 1Ki75B-000IQU-LH for FreeBSD-gnats-submit@freebsd.org; Tue, 23 Sep 2008 16:33:33 +0400
Received: by shadow.codelabs.ru (Postfix, from userid 1001)
	id 3039917092; Tue, 23 Sep 2008 16:33:32 +0400 (MSD)
Message-Id: <20080923123332.3039917092@shadow.codelabs.ru>
Date: Tue, 23 Sep 2008 16:33:32 +0400 (MSD)
From: Eygene Ryabinkin <rea-fbsd@codelabs.ru>
Reply-To: Eygene Ryabinkin <rea-fbsd@codelabs.ru>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch] add proper library dependencies to bsdlabel and fdisk
X-Send-Pr-Version: 3.113
X-GNATS-Notify: lulf@freebsd.org, pjd@freebsd.org

>Number:         127573
>Category:       bin
>Synopsis:       [patch] add proper library dependencies to bsdlabel and fdisk
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Sep 23 12:40:00 UTC 2008
>Closed-Date:    Tue Sep 23 13:15:03 UTC 2008
>Last-Modified:  Tue Sep 23 13:20:03 UTC 2008
>Originator:     Eygene Ryabinkin
>Release:        FreeBSD 8.0-CURRENT amd64
>Organization:
Code Labs
>Environment:

System: FreeBSD XXX 8.0-CURRENT FreeBSD 8.0-CURRENT #10: Tue Sep 23 13:53:00 MSD 2008 root@XXX:/usr/src/sys/amd64/compile/XXX amd64

>Description:

Just tried to update rather dated -CURRENT to today's version and found
that sbin/bsdlabel and sbin/fdisk can not be linked due to the missing
dependencies to XML and sbuf(9) functions.

Verified Makefiles -- no '-lsbuf' and '-lbdsxml' are present at the
CVSWeb interface versions of src/sbin/{bsdlabel,fdisk}/Makefile.

>How-To-Repeat:

Check out today's -CURRENT and try to do 'make buildworld'.

Look at SVN revisions 182844 (fdisk's CVS r1.86) and 183142 (bsdlabel's
CVS r1.115): they introduced the usage of new functions from libgeom,
but no additional libraries were specified for the link time.

For the record, I am using the following knobs in /etc/make.conf:
-----
NO_IPFILTER=true
NO_INET6=yes
NO_ATM=yes
NO_LPR=yes
NO_I4B=yes
NO_DYNAMICROOT=yes
-----
It should not make a big difference, but I just don's understand
why other people and/or Tinderboxes are not seeing these errors.
/usr/src/UPDATING is also very silent about these modifications,
so I assume that I had not missed anything important.

/usr/share/mk/*.mk also contain no signs of any recent extensions to the
Makefiles where libgeom is used.

>Fix:

The following patch that just adds needed libraries to the Makefile
cures the situation for me.

--- chase-new-libgeom-dependencies.patch begins here ---
Adds extra libraries to all utilities that are using new libgeom(3)
routines.

--- sbin/bsdlabel/Makefile.orig	2008-09-23 15:56:33.000000000 +0400
+++ sbin/bsdlabel/Makefile	2008-09-23 16:00:39.000000000 +0400
@@ -13,8 +13,8 @@
 MLINKS=	bsdlabel.8 disklabel.8
 .endif
 
-DPADD=	${LIBGEOM}
-LDADD=	-lgeom
+DPADD=	${LIBGEOM} ${LIBBSDXML} ${LIBSBUF}
+LDADD=	-lgeom -lbsdxml -lsbuf
 
 .include <bsd.prog.mk>
 
--- sbin/fdisk/Makefile.orig	2008-09-23 16:09:01.000000000 +0400
+++ sbin/fdisk/Makefile	2008-09-23 16:09:25.000000000 +0400
@@ -7,8 +7,8 @@
 
 .PATH:	${.CURDIR}/../../sys/geom
 
-DPADD	+=	${LIBGEOM}
-LDADD	+=	-lgeom
+DPADD	+=	${LIBGEOM} ${LIBBSDXML} ${LIBSBUF}
+LDADD	+=	-lgeom -lbsdxml -lsbuf
 
 .include <bsd.prog.mk>
 
--- chase-new-libgeom-dependencies.patch ends here ---
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: ru 
State-Changed-When: Tue Sep 23 13:13:41 UTC 2008 
State-Changed-Why:  
Patch applied, thanks. 

Tinderboxes don't see it because they have default option set 
without NO_DYNAMICROOT. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=127573 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/127573: commit references a PR
Date: Tue, 23 Sep 2008 13:13:27 +0000 (UTC)

 ru          2008-09-23 13:12:51 UTC
 
   FreeBSD src repository
 
   Modified files:
     sbin/bsdlabel        Makefile 
     sbin/fdisk           Makefile 
   Log:
   SVN rev 183296 on 2008-09-23 13:12:51Z by ru
   
   Add missing library dependencies.
   
   PR:             bin/127573
   Submitted by:   Eygene Ryabinkin
   
   Revision  Changes    Path
   1.21      +2 -2      src/sbin/bsdlabel/Makefile
   1.13      +2 -2      src/sbin/fdisk/Makefile
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
