Date: Sun, 10 Oct 2010 09:11:58 +1100 (EST) From: Bruce Evans <brde@optusnet.com.au> To: Erik Cederstrand <erik@cederstrand.dk> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Tim Kientzle <kientzle@FreeBSD.org>, Ben Kaduk <minimarmot@gmail.com>, src-committers@FreeBSD.org Subject: Re: svn commit: r213643 - head/usr.bin/ar Message-ID: <20101010083725.S3587@besplex.bde.org> In-Reply-To: <8C667EA1-3012-4499-BCCE-58263165663B@cederstrand.dk> References: <201010090531.o995V8n3026865@svn.freebsd.org> <AANLkTim8kj2X7fJMyRHTsXWFs8tvE07439w3Rzan7W1e@mail.gmail.com> <8C667EA1-3012-4499-BCCE-58263165663B@cederstrand.dk>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <kientzle@freebsd.org> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20101010083725.S3587>