libtool-sort.patch 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. From 494c17dc2bf45b8155fb9a14178ab48f01bc12a8 Mon Sep 17 00:00:00 2001
  2. From: law <law@138bc75d-0d04-0410-961f-82ee72b054a4>
  3. Date: Thu, 5 Jul 2018 19:13:45 +0000
  4. Subject: [PATCH 1/1] * libtool.m4: Sort output of 'find' to enable
  5. deterministic builds. * ltmain.sh: Likewise.
  6. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@262451 138bc75d-0d04-0410-961f-82ee72b054a4
  7. ---
  8. ChangeLog | 5 +++++
  9. libtool.m4 | 8 ++++----
  10. ltmain.sh | 4 ++--
  11. 3 files changed, 11 insertions(+), 6 deletions(-)
  12. diff --git a/libtool.m4 b/libtool.m4
  13. index 24d13f3..940faaa 100644
  14. --- a/libtool.m4
  15. +++ b/libtool.m4
  16. @@ -6005,20 +6005,20 @@ if test "$_lt_caught_CXX_error" != yes; then
  17. _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
  18. rm -rf $tpldir~
  19. $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
  20. - compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
  21. + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
  22. _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
  23. rm -rf $tpldir~
  24. $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
  25. - $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
  26. + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
  27. $RANLIB $oldlib'
  28. _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
  29. rm -rf $tpldir~
  30. $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
  31. - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
  32. + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
  33. _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
  34. rm -rf $tpldir~
  35. $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
  36. - $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'
  37. + $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'
  38. ;;
  39. *) # Version 6 and above use weak symbols
  40. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
  41. diff --git a/ltmain.sh b/ltmain.sh
  42. index 9503ec8..79f9ba8 100644
  43. --- a/ltmain.sh
  44. +++ b/ltmain.sh
  45. @@ -2917,7 +2917,7 @@ func_extract_archives ()
  46. darwin_file=
  47. darwin_files=
  48. for darwin_file in $darwin_filelist; do
  49. - darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
  50. + darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
  51. $LIPO -create -output "$darwin_file" $darwin_files
  52. done # $darwin_filelist
  53. $RM -rf unfat-$$
  54. @@ -2932,7 +2932,7 @@ func_extract_archives ()
  55. func_extract_an_archive "$my_xdir" "$my_xabs"
  56. ;;
  57. esac
  58. - my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
  59. + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
  60. done
  61. func_extract_archives_result="$my_oldobjs"
  62. --
  63. 2.9.3