From owner-svn-src-all@FreeBSD.ORG Sat Oct 9 22:12:06 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09AB5106564A; Sat, 9 Oct 2010 22:12:06 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by mx1.freebsd.org (Postfix) with ESMTP id 93CF38FC16; Sat, 9 Oct 2010 22:12:05 +0000 (UTC) Received: from c122-106-146-165.carlnfd1.nsw.optusnet.com.au (c122-106-146-165.carlnfd1.nsw.optusnet.com.au [122.106.146.165]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o99MBwi0009798 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 10 Oct 2010 09:11:59 +1100 Date: Sun, 10 Oct 2010 09:11:58 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Erik Cederstrand In-Reply-To: <8C667EA1-3012-4499-BCCE-58263165663B@cederstrand.dk> Message-ID: <20101010083725.S3587@besplex.bde.org> References: <201010090531.o995V8n3026865@svn.freebsd.org> <8C667EA1-3012-4499-BCCE-58263165663B@cederstrand.dk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Tim Kientzle , Ben Kaduk , src-committers@FreeBSD.org Subject: Re: svn commit: r213643 - head/usr.bin/ar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2010 22:12:06 -0000 On Sat, 9 Oct 2010, Erik Cederstrand wrote: > Den 09/10/2010 kl. 07.43 skrev Ben Kaduk: > >> On Sat, Oct 9, 2010 at 1:31 AM, Tim Kientzle wrote: >>> Log: >>> Add -D (deterministic) option to ar. >>> When set, it forces all timestamps and owners to zero and >>> modes to 0644. Useful for producing libraries that are >>> bitwise identical across multiple build runs. >> >> Thanks! Has anyone looked at the feasibility of setting AR?=ar -D in >> sys.mk? I will probably try this when I get my scratch box up again. I hope not. The default behaviour should not be changed by default. > I'm looking into this now, as I needed the patch to do binary diffs on builds. One problem is that ARFLAGS is overridden a lot of places in contrib/ code: > > contrib/cvs/lib/Makefile.in:67:ARFLAGS=cru > contrib/cvs/diff/Makefile.in:45:ARFLAGS=cru > contrib/ntp/libntp/Makefile.in:55:ARFLAGS=cru > contrib/ntp/libparse/Makefile.in:55:ARFLAGS=cru > contrib/ntp/arlib/Makefile.in:54:ARFLAGS=cru > contrib/ntp/ntpd/Makefile.in:61:ARFLAGS=cru > contrib/tcp_wrappers/Makefile:95:ARFLAGS=rv > contrib/tcp_wrappers/Makefile:101:ARFLAGS=rv > [...] > contrib/tcp_wrappers/Makefile:404:ARFLAGS=rv > contrib/bind9/configure.in:73:ARFLAGS=cruv > contrib/gcclibs/libcpp/Makefile.in:30:ARFLAGS=cru > contrib/gcclibs/libdecnumber/Makefile.in:30:ARFLAGS=cru > contrib/dtc/Makefile:49:ARFLAGS=rc > crypto/heimdal/appl/ftp/common/Makefile.in:93:ARFLAGS=cru > crypto/heimdal/appl/telnet/libtelnet/Makefile.in:93:ARFLAGS=cru > crypto/heimdal/lib/45/Makefile.in:101:ARFLAGS=cru > crypto/openssl/Makefile.org:66:ARFLAGS= > crypto/openssl/Makefile:68:ARFLAGS= Something like this seems to be needed, since the default flags in sys.mk of: > share/mk/sys.mk:36:ARFLAGS?=-rv > share/mk/sys.mk:38:ARFLAGS?=rl > usr.bin/make/PSD.doc/tutorial.ms:2968:ARFLAGS?=crl are almost as bad as -D there. -rv is for the %POSIX case. The -v in it makes it wrong for most uses, especially when make output is supposed to be quieted by -s. At least it uses the newfangled option syntax (starting with a '-'). rl is for the usual case. The `l' flag is bogus since it was documented as accepted but not used. Now it seems to be undocumented, but still accepted but not used. The `r' flag is normally wanted, but most places also want 'c' and possibly 'u'. Having anything in the default ARFLAGS is bad since (except in the %POSIX case) its contents is undocumented so it is hard to tell what precautions should be taken to avoid bad things in it. There seems to be no way to cancel bad things in it by adding to it, so makefiles wanting to use the default would have to use something like substitutions in it. E.g.: %%% ARFLAGS:= ${ARFLAGS:S/l//} # remove nonsense flag 'l' ARFLAGS:= ${ARFLAGS:S/D//} # remove unwanted flag 'v' foo: echo ${ARFLAGS} %%% But it is easier to blow away the garbage using ARFLAGS=cru. There were few or no flags like -D that could reasonably set outside of sys.mk, according to user or system preferences, so that no Makefile should touch them. Perhaps -v is another one -- setting this wouldn't change the created archives, but might be useful for debugging. The primary user of ${AR} for FreeBSD builds, namely bsd.lib.mk, doesn't even use ${ARFLAGS}, so it is missing from the above list. It uses the literal `cq' whenever it uses the non-literal ${AR}. Perhaps ar is often spelled `ar' too. Bruce