Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Oct 2010 10:19:36 +0200
From:      Erik Cederstrand <erik@cederstrand.dk>
To:        Bruce Evans <brde@optusnet.com.au>
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:  <2A26ECE8-7713-49C4-8706-5AA5B232BE29@cederstrand.dk>
In-Reply-To: <20101010083725.S3587@besplex.bde.org>
References:  <201010090531.o995V8n3026865@svn.freebsd.org> <AANLkTim8kj2X7fJMyRHTsXWFs8tvE07439w3Rzan7W1e@mail.gmail.com> <8C667EA1-3012-4499-BCCE-58263165663B@cederstrand.dk> <20101010083725.S3587@besplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--Apple-Mail-2031--846068754
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii


Den 10/10/2010 kl. 00.11 skrev Bruce Evans:

> On Sat, 9 Oct 2010, Erik Cederstrand wrote:
>>>=20
>>> Thanks!  Has anyone looked at the feasibility of setting AR?=3Dar -D =
in
>>> sys.mk?  I will probably try this when I get my scratch box up =
again.
>=20
> I hope not.  The default behaviour should not be changed by default.

The reason I came up with this patch was that I wanted to do binary =
diffs on FreeBSD distributions to, among other reasons, record witch =
files are actually affected between commits. Except for a few edge-cases =
like recording a build timestamp, it seems wrong in my view for FreeBSD =
to not produce deterministic distributions on identical source code.

>> 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:
>>=20
>> contrib/cvs/lib/Makefile.in:67:ARFLAGS=3Dcru
>> contrib/cvs/diff/Makefile.in:45:ARFLAGS=3Dcru
>> contrib/ntp/libntp/Makefile.in:55:ARFLAGS=3Dcru
>> contrib/ntp/libparse/Makefile.in:55:ARFLAGS=3Dcru
>> contrib/ntp/arlib/Makefile.in:54:ARFLAGS=3Dcru
>> contrib/ntp/ntpd/Makefile.in:61:ARFLAGS=3Dcru
>> contrib/tcp_wrappers/Makefile:95:ARFLAGS=3Drv
>> contrib/tcp_wrappers/Makefile:101:ARFLAGS=3Drv
>> [...]
>> contrib/tcp_wrappers/Makefile:404:ARFLAGS=3Drv
>> contrib/bind9/configure.in:73:ARFLAGS=3Dcruv
>> contrib/gcclibs/libcpp/Makefile.in:30:ARFLAGS=3Dcru
>> contrib/gcclibs/libdecnumber/Makefile.in:30:ARFLAGS=3Dcru
>> contrib/dtc/Makefile:49:ARFLAGS=3Drc
>> crypto/heimdal/appl/ftp/common/Makefile.in:93:ARFLAGS=3Dcru
>> crypto/heimdal/appl/telnet/libtelnet/Makefile.in:93:ARFLAGS=3Dcru
>> crypto/heimdal/lib/45/Makefile.in:101:ARFLAGS=3Dcru
>> crypto/openssl/Makefile.org:66:ARFLAGS=3D
>> crypto/openssl/Makefile:68:ARFLAGS=3D
>=20
> Something like this seems to be needed, since the default flags in =
sys.mk
> of:
>=20
>> share/mk/sys.mk:36:ARFLAGS?=3D-rv
>> share/mk/sys.mk:38:ARFLAGS?=3Drl
>> usr.bin/make/PSD.doc/tutorial.ms:2968:ARFLAGS?=3Dcrl
>=20
> 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'.
>=20
> 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.:
>=20
> %%%
> ARFLAGS:=3D	${ARFLAGS:S/l//}	# remove nonsense flag 'l'
> ARFLAGS:=3D	${ARFLAGS:S/D//}	# remove unwanted flag 'v'
> foo:
> 	echo ${ARFLAGS}
> %%%
>=20
> But it is easier to blow away the garbage using ARFLAGS=3Dcru.  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.
>=20
> 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.


I'm a real beginner here. As I read the manuals (GNU ar and BSD ar), the =
only flags that really control archive contents on archive creation is =
'q' and 'r'. The 'l' is ignored, 'c' and 'v' control verbosity, and 'u' =
and 's' are for performance purposes that are largely irrelevant today =
(extracting every single *.a file and recreating it wit ar -rD takes =
less than 10 secs on my slow machine). Is there any negative impact at =
runtime from having all archives created with either -rD or -qD =
(ignoring verbosity at build time for now)?

Thanks,
Erik=

--Apple-Mail-2031--846068754--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2A26ECE8-7713-49C4-8706-5AA5B232BE29>