[FFmpeg-devel] [PATCH] configure: use ar and ranlib in deterministic mode

Clément Bœsch u at pkh.me
Tue Jan 27 08:05:32 CET 2015


On Tue, Jan 27, 2015 at 12:31:18AM +0100, Andreas Cadhalpun wrote:
> Hi,
> 
> On 26.01.2015 23:11, Michael Niedermayer wrote:
> >On Mon, Jan 26, 2015 at 07:08:42PM -0300, James Almer wrote:
> >>On 26/01/15 7:04 PM, Michael Niedermayer wrote:
> >>>reverted, breaks on BSDs
> >>>
> >>>ar: illegal option -- D
> [...]
> >>Maybe a configure check for "ranlib -D" could be added.
> >
> >yes
> 
> Attached patch checks if the help output contains the options.
> That should be sufficient.
> 
> Best regards,
> Andreas

> From ae77abb9d4be562bd7d129d2b769f65ca30ebdc3 Mon Sep 17 00:00:00 2001
> From: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
> Date: Mon, 26 Jan 2015 23:50:29 +0100
> Subject: [PATCH] configure: use ar and ranlib in deterministic mode if
>  available
> 
> this makes the static libraries binary reproducible
> 
> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
> ---
>  configure | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/configure b/configure
> index 9fcdaee..c684d23 100755
> --- a/configure
> +++ b/configure
> @@ -2702,7 +2702,11 @@ ln_s="ln -s -f"
>  nm_default="nm -g"
>  objformat="elf"
>  pkg_config_default=pkg-config
> -ranlib_default="ranlib"
> +if ranlib 2>&1 | grep -q "\-D "; then
> +    ranlib_default="ranlib -D"
> +else
> +    ranlib_default="ranlib"
> +fi
>  strip_default="strip"
>  yasmexe_default="yasm"
>  windres_default="windres"
> @@ -3600,6 +3604,9 @@ elif $ar 2>&1 | grep -q 'Texas Instruments'; then
>  elif $ar 2>&1 | grep -q 'Usage: ar.*-X.*any'; then
>      arflags='-Xany -r -c'
>      ar_o='$@'
> +elif $ar 2>&1 | grep -q "\[D\] "; then
> +    arflags="rcD"
> +    ar_o='$@'
>  else
>      arflags="rc"
>      ar_o='$@'

Why not have a build option to make these reproducible build on demand?

There is no drawback to having this by default?

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150127/768e2360/attachment.asc>


More information about the ffmpeg-devel mailing list