From owner-freebsd-questions@FreeBSD.ORG Thu Nov 25 12:29:55 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 43CB416A4CE for ; Thu, 25 Nov 2004 12:29:55 +0000 (GMT) Received: from av6-1-sn2.hy.skanova.net (av6-1-sn2.hy.skanova.net [81.228.8.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id E3A2043D46 for ; Thu, 25 Nov 2004 12:29:51 +0000 (GMT) (envelope-from ertr1013@student.uu.se) Received: by av6-1-sn2.hy.skanova.net (Postfix, from userid 502) id B3D6337E58; Thu, 25 Nov 2004 13:29:50 +0100 (CET) Received: from smtp2-1-sn2.hy.skanova.net (smtp2-1-sn2.hy.skanova.net [81.228.8.177]) by av6-1-sn2.hy.skanova.net (Postfix) with ESMTP id 9E91B37E44 for ; Thu, 25 Nov 2004 13:29:50 +0100 (CET) Received: from falcon.midgard.homeip.net (h201n1fls24o1048.bredband.comhem.se [212.181.162.201]) by smtp2-1-sn2.hy.skanova.net (Postfix) with SMTP id 7AFB637E45 for ; Thu, 25 Nov 2004 13:29:50 +0100 (CET) Received: (qmail 47651 invoked by uid 1001); 25 Nov 2004 12:29:46 -0000 Date: Thu, 25 Nov 2004 13:29:46 +0100 From: Erik Trulsson To: Erik Norgaard Message-ID: <20041125122946.GA47638@falcon.midgard.homeip.net> Mail-Followup-To: Erik Norgaard , "freebsd-questions@freebsd.org" References: <41A5CDE0.8090308@locolomo.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41A5CDE0.8090308@locolomo.org> User-Agent: Mutt/1.5.6i cc: "freebsd-questions@freebsd.org" Subject: Re: Building base system with CFLAGS=-static X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Nov 2004 12:29:55 -0000 On Thu, Nov 25, 2004 at 01:19:44PM +0100, Erik Norgaard wrote: > Hi, > > I am trying to build the base system statically linked to create an > installation root file system. > > I have tried "make CFLAGS=-static buildworld", which fails. Building > each program separately, in most cases it works with "make > CFLAGS=-static" but some like systinstall, sh, csh and init fails. > > What is the suggested method to create a static built base system? > Alternatively, how do I trace which libraries are used/needed? make NOSHARED=yes buildworld should work fine for building a statically linked system. (If you are using 4-stable you will probably have to apply the following patch to make the world build correctly using NOSHARED=yes, at least if you use NOPAM=yes. No idea how it works if you compile with PAM support which is the default.) Index: usr.bin/fetch/Makefile =================================================================== RCS file: /ncvs/src/usr.bin/fetch/Makefile,v retrieving revision 1.3.6.4 diff -u -r1.3.6.4 Makefile --- usr.bin/fetch/Makefile 9 Jan 2003 11:54:58 -0000 1.3.6.4 +++ usr.bin/fetch/Makefile 20 Nov 2003 16:59:18 -0000 @@ -6,8 +6,8 @@ DPADD= ${LIBFETCH} LDADD= -lfetch .if !defined(NOCRYPT) && !defined(NOSECURE) && !defined(NO_OPENSSL) -DPADD+= ${LIBCRYPTO} ${LIBSSL} -LDADD+= -lcrypto -lssl +DPADD+= ${LIBSSL} ${LIBCRYPTO} +LDADD+= -lssl -lcrypto .endif .include Index: usr.sbin/rpc.statd/file.c =================================================================== RCS file: /ncvs/src/usr.sbin/rpc.statd/file.c,v retrieving revision 1.3 diff -u -r1.3 file.c --- usr.sbin/rpc.statd/file.c 13 Oct 1997 11:13:18 -0000 1.3 +++ usr.sbin/rpc.statd/file.c 20 Nov 2003 18:53:24 -0000 @@ -207,28 +207,6 @@ } } -/* xdr_stat_chge ----------------------------------------------------------- */ -/* - Purpose: XDR-encode structure of type stat_chge - Returns: TRUE if successful - Notes: This function is missing from librpcsvc, because the - sm_inter.x distributed by Sun omits the SM_NOTIFY - procedure used between co-operating statd's -*/ - -bool_t xdr_stat_chge(XDR *xdrs, stat_chge *objp) -{ - if (!xdr_string(xdrs, &objp->mon_name, SM_MAXSTRLEN)) - { - return (FALSE); - } - if (!xdr_int(xdrs, &objp->state)) - { - return (FALSE); - } - return (TRUE); -} - /* notify_one_host --------------------------------------------------------- */ /* -- Erik Trulsson ertr1013@student.uu.se