From owner-freebsd-arch@FreeBSD.ORG Thu Apr 10 15:06:14 2014 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D2D0380A for ; Thu, 10 Apr 2014 15:06:14 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 97BA61D04 for ; Thu, 10 Apr 2014 15:06:14 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id A98476398 for ; Thu, 10 Apr 2014 15:06:08 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 6E437C58; Thu, 10 Apr 2014 17:06:09 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: arch@freebsd.org Subject: ar and ranlib -D Date: Thu, 10 Apr 2014 17:06:09 +0200 Message-ID: <86eh15usv2.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Apr 2014 15:06:14 -0000 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable The attached patch adds -D to ARFLAGS and introduces RANLIBFLAGS which defaults to -D. This ensures that all timestamps inside static libraries in the base system are hardcoded to 0 (aka the epoch), which is a huge step towards fully reproducible builds. Any objections? DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=ar-D.diff Index: share/mk/bsd.lib.mk =================================================================== --- share/mk/bsd.lib.mk (revision 264317) +++ share/mk/bsd.lib.mk (working copy) @@ -172,7 +172,7 @@ .else @${AR} ${ARFLAGS} ${.TARGET} `NM='${NM}' lorder ${OBJS} ${STATICOBJS} | tsort -q` ${ARADD} .endif - ${RANLIB} ${.TARGET} + ${RANLIB} ${RANLIBFLAGS} ${.TARGET} .endif .if !defined(INTERNALLIB) @@ -189,7 +189,7 @@ .else @${AR} ${ARFLAGS} ${.TARGET} `NM='${NM}' lorder ${POBJS} | tsort -q` ${ARADD} .endif - ${RANLIB} ${.TARGET} + ${RANLIB} ${RANLIBFLAGS} ${.TARGET} .endif .if defined(SHLIB_NAME) || \ @@ -246,7 +246,7 @@ @${ECHO} building special pic ${LIB} library @rm -f ${.TARGET} @${AR} ${ARFLAGS} ${.TARGET} ${SOBJS} ${ARADD} - ${RANLIB} ${.TARGET} + ${RANLIB} ${RANLIBFLAGS} ${.TARGET} .endif .if defined(WANT_LINT) && !defined(NO_LINT) && defined(LIB) && !empty(LIB) Index: share/mk/sys.mk =================================================================== --- share/mk/sys.mk (revision 264317) +++ share/mk/sys.mk (working copy) @@ -37,11 +37,12 @@ AR ?= ar .if defined(%POSIX) -ARFLAGS ?= -rv +ARFLAGS ?= -rDv .else -ARFLAGS ?= cru +ARFLAGS ?= crD .endif RANLIB ?= ranlib +RANLIBFLAGS ?= -D AS ?= as AFLAGS ?= --=-=-=--