Date: Thu, 10 Apr 2014 09:45:53 -0600 From: Warner Losh <imp@bsdimp.com> To: =?windows-1252?Q?Dag-Erling_Sm=F8rgrav?= <des@des.no> Cc: arch@freebsd.org Subject: Re: ar and ranlib -D Message-ID: <79CBA7AC-998E-46EE-8F94-F92C7C00FF75@bsdimp.com> In-Reply-To: <86eh15usv2.fsf@nine.des.no>
index | next in thread | previous in thread | raw e-mail
My only concern is with the %POSIX section. That change isn’t needed for reproducible
builds.
Warner
On Apr 10, 2014, at 9:06 AM, Dag-Erling Smørgrav <des@des.no> wrote:
> 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
> --
> Dag-Erling Smørgrav - des@des.no
>
> 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 ?=
> _______________________________________________
> freebsd-arch@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-arch
> To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?79CBA7AC-998E-46EE-8F94-F92C7C00FF75>
