public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: "Arsen Arsenović" <arsen@aarsen.me>
To: gdb-patches@sourceware.org, binutils@sourceware.org
Cc: "Bernhard M. Wiedemann" <bwiedemann@suse.de>
Subject: [PATCH 32/45] libtool.m4: Sort output of 'find' to enable deterministic builds.
Date: Mon,  7 Aug 2023 13:07:35 +0200	[thread overview]
Message-ID: <20230807111029.2320238-33-arsen@aarsen.me> (raw)
In-Reply-To: <20230807111029.2320238-1-arsen@aarsen.me>

From: "Bernhard M. Wiedemann" <bwiedemann@suse.de>

ChangeLog:

        * libtool.m4: Sort output of 'find' to enable deterministic builds.
	* ltmain.sh: Likewise.

ld/ChangeLog:

	configure: Regenerate.
---
 ChangeLog         | 5 +++++
 gdb/configure     | 8 ++++----
 gprofng/configure | 8 ++++----
 ld/configure      | 8 ++++----
 libtool.m4        | 8 ++++----
 ltmain.sh         | 4 ++--
 6 files changed, 23 insertions(+), 18 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c817c1d702d..16679da4662 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2018-06-19  Bernhard M. Wiedemann  <bwiedemann@suse.de>
+
+        * libtool.m4: Sort output of 'find' to enable deterministic builds.
+	* ltmain.sh: Likewise.
+
 2018-10-28  Iain Buclaw  <ibuclaw@gdcproject.org>
 
 	* Makefile.def (target_modules): Add libphobos.
diff --git a/gdb/configure b/gdb/configure
index 59b08017841..db85352195e 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -12745,20 +12745,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`~
 		$RANLIB $oldlib'
 	      archive_cmds_CXX='tpldir=Template.dir~
 		rm -rf $tpldir~
 		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
 	      archive_expsym_cmds_CXX='tpldir=Template.dir~
 		rm -rf $tpldir~
 		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
 	      ;;
 	    *) # Version 6 and above use weak symbols
 	      archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
diff --git a/gprofng/configure b/gprofng/configure
index 0b03b47985f..f74d4ff971c 100755
--- a/gprofng/configure
+++ b/gprofng/configure
@@ -13521,20 +13521,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`~
 		$RANLIB $oldlib'
 	      archive_cmds_CXX='tpldir=Template.dir~
 		rm -rf $tpldir~
 		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
 	      archive_expsym_cmds_CXX='tpldir=Template.dir~
 		rm -rf $tpldir~
 		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
 	      ;;
 	    *) # Version 6 and above use weak symbols
 	      archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
diff --git a/ld/configure b/ld/configure
index bf6a91258af..e5bd89d0773 100755
--- a/ld/configure
+++ b/ld/configure
@@ -12922,20 +12922,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`~
 		$RANLIB $oldlib'
 	      archive_cmds_CXX='tpldir=Template.dir~
 		rm -rf $tpldir~
 		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
 	      archive_expsym_cmds_CXX='tpldir=Template.dir~
 		rm -rf $tpldir~
 		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
 	      ;;
 	    *) # Version 6 and above use weak symbols
 	      archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
diff --git a/libtool.m4 b/libtool.m4
index 7d0593ae340..1f726c93c8c 100644
--- a/libtool.m4
+++ b/libtool.m4
@@ -6059,20 +6059,20 @@ if test "$_lt_caught_CXX_error" != yes; then
 	      _LT_TAGVAR(prelink_cmds, $1)='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`"'
 	      _LT_TAGVAR(old_archive_cmds, $1)='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`~
 		$RANLIB $oldlib'
 	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
 		rm -rf $tpldir~
 		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
 	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
 		rm -rf $tpldir~
 		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
 	      ;;
 	    *) # Version 6 and above use weak symbols
 	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
diff --git a/ltmain.sh b/ltmain.sh
index 9503ec85d70..79f9ba89af5 100644
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -2917,7 +2917,7 @@ func_extract_archives ()
 	    darwin_file=
 	    darwin_files=
 	    for darwin_file in $darwin_filelist; do
-	      darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
+	      darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
 	      $LIPO -create -output "$darwin_file" $darwin_files
 	    done # $darwin_filelist
 	    $RM -rf unfat-$$
@@ -2932,7 +2932,7 @@ func_extract_archives ()
         func_extract_an_archive "$my_xdir" "$my_xabs"
 	;;
       esac
-      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
+      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
     done
 
     func_extract_archives_result="$my_oldobjs"
-- 
2.41.0


  parent reply	other threads:[~2023-08-07 11:19 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-07 11:07 [PATCH 00/45] Synchronize shared build infrastructure with GCC tree Arsen Arsenović
2023-08-07 11:07 ` [PATCH 01/45] *: Regenerate autoconf and aclocal files Arsen Arsenović
2023-08-09 13:43   ` Alan Modra
2023-08-10  9:13     ` Arsen Arsenović
2023-08-07 11:07 ` [PATCH 02/45] Libvtv: Add loongarch support Arsen Arsenović
2023-08-07 11:07 ` [PATCH 03/45] c++: source position of lambda captures [PR84471] Arsen Arsenović
2023-08-10 21:48   ` Jason Merrill
2023-08-07 11:07 ` [PATCH 04/45] Updated constants from <https://dwarfstd.org/Languages.php> Arsen Arsenović
2023-08-07 11:07 ` [PATCH 05/45] LoongArch: implement count_{leading,trailing}_zeros Arsen Arsenović
2023-08-07 11:07 ` [PATCH 06/45] Darwin : Update libtool and dependencies for Darwin20 [PR97865] Arsen Arsenović
2023-08-07 11:07 ` [PATCH 07/45] configure: Do not build the ununsed libffi shared library Arsen Arsenović
2023-08-09 13:44   ` Alan Modra
2023-08-10  9:21     ` Arsen Arsenović
2023-08-10 11:39       ` Alan Modra
2023-08-10 11:25     ` Arsen Arsenović
2023-08-07 11:07 ` [PATCH 08/45] configure: When host-shared, pass --with-pic to in-tree lib configs Arsen Arsenović
2023-08-07 11:07 ` [PATCH 09/45] configure: Implement --enable-host-pie Arsen Arsenović
2023-08-07 11:07 ` [PATCH 10/45] configure: Only create serdep.tmp if needed Arsen Arsenović
2023-08-07 11:07 ` [PATCH 11/45] configure, Darwin: Ensure overrides to host-pie are passed to gcc configure Arsen Arsenović
2023-08-07 11:07 ` [PATCH 12/45] Remove support for Intel MIC offloading Arsen Arsenović
2023-08-07 11:07 ` [PATCH 13/45] configure: use OBJDUMP determined by libtool [PR95648] Arsen Arsenović
2023-08-07 11:07 ` [PATCH 14/45] configure: Account CXXFLAGS in gcc-plugin.m4 Arsen Arsenović
2023-08-07 11:07 ` [PATCH 15/45] Add TFLAGS to gcc's GCC_FOR_TARGET Arsen Arsenović
2023-08-07 11:07 ` [PATCH 16/45] Merge modula-2 front end onto gcc Arsen Arsenović
2023-08-07 11:07 ` [PATCH 17/45] sync toplevel with GCC: drop 32b PA-RISC on HPUX in GCC Arsen Arsenović
2023-08-07 11:07 ` [PATCH 18/45] Fix PR bootstrap/102389: --with-build-config=bootstrap-lto is broken Arsen Arsenović
2023-08-07 11:07 ` [PATCH 19/45] gcc: Add 'mcf' thread model support from mcfgthread Arsen Arsenović
2023-08-07 11:07 ` [PATCH 20/45] Darwin, config: Revise host config fragment Arsen Arsenović
2023-08-07 11:07 ` [PATCH 21/45] configure: Allow host fragments to react to --enable-host-shared Arsen Arsenović
2023-08-07 11:07 ` [PATCH 22/45] mh-mingw: Set __USE_MINGW_ACCESS in missed C++ flags variables Arsen Arsenović
2023-08-07 11:07 ` [PATCH 23/45] mh-mingw: drop unused BOOT_CXXFLAGS variable Arsen Arsenović
2023-08-07 11:07 ` [PATCH 24/45] config-ml.in: Suppress output from multi-do recipes Arsen Arsenović
2023-08-07 11:07 ` [PATCH 25/45] Add D front-end, libphobos library, and D2 testsuite Arsen Arsenović
2023-08-07 11:07 ` [PATCH 26/45] MSP430: Add -fno-exceptions multilib Arsen Arsenović
2023-08-07 11:07 ` [PATCH 27/45] gcc: xtensa: add XCHAL_HAVE_{CLAMPS,DEPBITS,EXCLUSIVE,XEA3} to dynconfig Arsen Arsenović
2023-08-07 11:07 ` [PATCH 28/45] gcc: xtensa: add data alignment properties " Arsen Arsenović
2023-08-07 11:07 ` [PATCH 29/45] toplevel: reconcile few divergences with GCC Arsen Arsenović
2023-08-07 11:07 ` [PATCH 30/45] Generic configury support for shared libs on VxWorks Arsen Arsenović
2023-08-07 11:07 ` [PATCH 31/45] Fix hppa64-hpux11 build to remove source paths from embedded path Arsen Arsenović
2023-08-07 11:07 ` Arsen Arsenović [this message]
2023-08-07 11:07 ` [PATCH 33/45] [ARM/FDPIC v6 02/24] [ARM] FDPIC: Handle arm*-*-uclinuxfdpiceabi in configure scripts Arsen Arsenović
2023-08-07 11:07 ` [PATCH 34/45] Do not use HAVE_DOS_BASED_FILE_SYSTEM for Cygwin Arsen Arsenović
2023-08-07 11:07 ` [PATCH 35/45] Makefile.def: drop remnants of unused libelf Arsen Arsenović
2023-08-07 11:07 ` [PATCH 36/45] d: Import dmd b8384668f, druntime e6caaab9, phobos 5ab9ad256 (v2.098.0-beta.1) Arsen Arsenović
2023-08-07 11:07 ` [PATCH 37/45] Collect both user and kernel events for autofdo tests and autoprofiledbootstrap Arsen Arsenović
2023-08-07 11:07 ` [PATCH 38/45] Fix collection and processing of autoprofile data for target libs Arsen Arsenović
2023-08-07 11:07 ` [PATCH 39/45] Fix autoprofiledbootstrap build Arsen Arsenović
2023-08-07 11:07 ` [PATCH 40/45] Disable warnings as errors for STAGEautofeedback Arsen Arsenović
2023-08-07 11:07 ` [PATCH 41/45] Revert "Fix PR 67102: Add libstdc++ dependancy to libffi" [PR67102] Arsen Arsenović
2023-08-07 11:07 ` [PATCH 42/45] PR bootstrap/106472: Add libgo depends on libbacktrace to Makefile.def Arsen Arsenović
2023-08-07 11:07 ` [PATCH 43/45] gccrs: Add gcc-check-target check-rust Arsen Arsenović
2023-08-07 11:07 ` [PATCH 44/45] Use substituted GDCFLAGS Arsen Arsenović
2023-08-07 11:07 ` [PATCH 45/45] toplevel: Substitute GDCFLAGS instead of using CFLAGS Arsen Arsenović
2023-08-12  1:18 ` [PATCH 00/45] Synchronize shared build infrastructure with GCC tree Alan Modra
2023-08-12  9:55   ` Arsen Arsenović

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230807111029.2320238-33-arsen@aarsen.me \
    --to=arsen@aarsen.me \
    --cc=binutils@sourceware.org \
    --cc=bwiedemann@suse.de \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).