From d6549fa647d1741b1610a4a9cbea3e8d3f696fd6 Mon Sep 17 00:00:00 2001 From: Stephane Glondu Date: Sun, 16 Aug 2015 21:10:12 +0200 Subject: [PATCH] Add a .file directive to startup .s files for reproducibility (Closes: #795784) --- ...ctive-to-startup-.s-files-for-reprod.patch | 25 +++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 26 insertions(+) create mode 100644 debian/patches/0010-Add-a-.file-directive-to-startup-.s-files-for-reprod.patch diff --git a/debian/patches/0010-Add-a-.file-directive-to-startup-.s-files-for-reprod.patch b/debian/patches/0010-Add-a-.file-directive-to-startup-.s-files-for-reprod.patch new file mode 100644 index 00000000..10959497 --- /dev/null +++ b/debian/patches/0010-Add-a-.file-directive-to-startup-.s-files-for-reprod.patch @@ -0,0 +1,25 @@ +From: Stephane Glondu +Date: Sun, 16 Aug 2015 20:59:14 +0200 +Subject: Add a .file directive to startup .s files for reproducibility + +When no .file directive is given, gcc records the filename of the +startup .o file, which is random, in the final executable, making it +non-reproducible. + +Bug-Debian: https://bugs.debian.org/795784 +--- + asmcomp/asmlink.ml | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/asmcomp/asmlink.ml b/asmcomp/asmlink.ml +index cea7b56..cad7d8c 100644 +--- a/asmcomp/asmlink.ml ++++ b/asmcomp/asmlink.ml +@@ -201,6 +201,7 @@ let scan_file obj_name tolink = match read_file obj_name with + let make_startup_file ppf filename units_list = + let compile_phrase p = Asmgen.compile_phrase ppf p in + let oc = open_out filename in ++ Printf.fprintf oc "\t.file \"startup.s\"\n"; + Emitaux.output_channel := oc; + Location.input_name := "caml_startup"; (* set name of "current" input *) + Compilenv.reset "_startup"; (* set the name of the "current" compunit *) diff --git a/debian/patches/series b/debian/patches/series index 631b36fd..67aa81b0 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -7,3 +7,4 @@ 0007-Tune-resource-usage-of-some-tests.patch 0008-Native-backtraces-don-t-work-on-powerpc-and-sparc.patch 0010-Enable-ocamldoc-to-build-reproducible-manpages.patch +0010-Add-a-.file-directive-to-startup-.s-files-for-reprod.patch -- 2.30.2