GNU bug report logs - #48721
[PATCH] gnu: gcc-8: Make static libs reproducible

Previous Next

Package: guix-patches;

Reported by: Carl Dong <contact <at> carldong.me>

Date: Fri, 28 May 2021 20:25:01 UTC

Severity: normal

Tags: patch

Fixed in version 83d9e2ee56cb0ca2a644074ad232503e25ac7116

Done: Carl Dong <contact <at> carldong.me>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ludovic Courtès <ludo <at> gnu.org>
To: Carl Dong <contact <at> carldong.me>
Cc: Chris Marusich <cmmarusich <at> gmail.com>, 48721 <at> debbugs.gnu.org
Subject: [bug#48721] [PATCH] gnu: gcc-8: Make static libs reproducible
Date: Sat, 29 May 2021 19:09:06 +0200
Hi Carl,

Carl Dong <contact <at> carldong.me> skribis:

> This fixes the nonreproducibility in gcc documented here:
> https://reproducible-builds.org/docs/archives/#gnu-libtool
>
> * gnu/packages/patches/gcc-8-sort-libtool-find-output.patch: New patch.
> * gnu/packages/gcc.scm (gcc-8)[source]: Apply it.

Well done.  Did you observe it in practice?  (On ‘core-updates’ maybe?)

I wonder if this explains the issues that Chris Marusich and Léo
stumbled upon while working on the POWER9 port.

I’m surprised that this is still an issue since this was fixed in
Libtool proper long ago, probably before GCC 8 was released.

>  gnu/packages/gcc.scm                          |   3 +-
>  .../gcc-8-sort-libtool-find-output.patch      | 392 ++++++++++++++++++

> diff --git a/gnu/packages/patches/gcc-8-sort-libtool-find-output.patch b/gnu/packages/patches/gcc-8-sort-libtool-find-output.patch
> new file mode 100644
> index 0000000000..1dfe3ba132
> --- /dev/null
> +++ b/gnu/packages/patches/gcc-8-sort-libtool-find-output.patch

Please add a line or two explaining what it does, or ‘guix lint’ will be
unhappy.  :-)

> @@ -0,0 +1,392 @@
> +diff --git a/gcc/configure b/gcc/configure
> +index 97ba7d7d69c..e37a96f0c0c 100755
> +--- a/gcc/configure
> ++++ b/gcc/configure
> +@@ -19720,20 +19720,20 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
> + 	      prelink_cmds_CXX='tpldir=Template.dir~
> + 		rm -rf $tpldir~
> + 		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
> +-		compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
> ++		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
> + 	      old_archive_cmds_CXX='tpldir=Template.dir~
> + 		rm -rf $tpldir~
> + 		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
> +-		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
> ++		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~

The patch is big, but it looks like using ‘substitute*’ wouldn’t be an
easy task, so maybe it’s better this way.  WDYT?

Thanks!

Ludo’.




This bug report was last modified 3 years and 342 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.