File gcc8-reproducible-builds.patch of Package gcc8
Backport ltmain.sh change, disable value-profiling, avoid leaking
current data on generated file for Ada.
Index: Makefile.in
===================================================================
--- Makefile.in	(revision 268977)
+++ Makefile.in	(working copy)
@@ -529,7 +529,7 @@ STAGE1_CONFIGURE_FLAGS = --disable-inter
 	  --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" \
 	  --disable-build-format-warnings
 
-STAGEprofile_CFLAGS = $(STAGE2_CFLAGS) -fprofile-generate
+STAGEprofile_CFLAGS = $(STAGE2_CFLAGS) -fprofile-generate -fno-profile-values
 STAGEprofile_TFLAGS = $(STAGE2_TFLAGS)
 
 STAGEtrain_CFLAGS = $(STAGE3_CFLAGS)
Index: Makefile.tpl
===================================================================
--- Makefile.tpl	(revision 268977)
+++ Makefile.tpl	(working copy)
@@ -452,7 +452,7 @@ STAGE1_CONFIGURE_FLAGS = --disable-inter
 	  --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" \
 	  --disable-build-format-warnings
 
-STAGEprofile_CFLAGS = $(STAGE2_CFLAGS) -fprofile-generate
+STAGEprofile_CFLAGS = $(STAGE2_CFLAGS) -fprofile-generate -fno-profile-values
 STAGEprofile_TFLAGS = $(STAGE2_TFLAGS)
 
 STAGEtrain_CFLAGS = $(STAGE3_CFLAGS)
Index: gcc/ada/gcc-interface/Makefile.in
===================================================================
--- gcc/ada/gcc-interface/Makefile.in	(revision 268977)
+++ gcc/ada/gcc-interface/Makefile.in	(working copy)
@@ -2407,6 +2407,7 @@ $(RTSDIR)/s-oscons.ads: ../stamp-gnatlib
 	    $(OSCONS_CPP) ; \
 	    $(OSCONS_EXTRACT) ; \
 	    ../bldtools/oscons/xoscons s-oscons)
+	touch -r $(fsrcpfx)ada/gsocket.h $@
 
 gnatlib: ../stamp-gnatlib1-$(RTSDIR) ../stamp-gnatlib2-$(RTSDIR) $(RTSDIR)/s-oscons.ads
 	test -f $(RTSDIR)/s-oscons.ads || exit 1
Index: ltmain.sh
===================================================================
--- ltmain.sh	(revision 268977)
+++ ltmain.sh	(working copy)
@@ -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 | LC_ALL=C sort | $NL2SP`
     done
 
     func_extract_archives_result="$my_oldobjs"