From: Stephane Glondu Date: Sun, 16 Aug 2015 20:59:14 +0200 Subject: Add a .file directive to generated .s files When no .file directive is given, the toolchain records the filename of the .o file, which is sometimes random, making generated objects non-deterministic. We use Location.input_name for adding .file directives to assembly files. Note: when the file is preprocessed, this reference holds the name of the temporary file. Hence, files compiled with -pp are still not deterministic. Bug-Debian: https://bugs.debian.org/795784 Bug-Debian: https://bugs.debian.org/796336 --- asmcomp/amd64/emit.mlp | 1 + asmcomp/arm/emit.mlp | 1 + asmcomp/arm64/emit.mlp | 1 + asmcomp/i386/emit.mlp | 1 + asmcomp/power/emit.mlp | 1 + asmcomp/sparc/emit.mlp | 1 + 6 files changed, 6 insertions(+) diff --git a/asmcomp/amd64/emit.mlp b/asmcomp/amd64/emit.mlp index d56d0f5..4d7aa30 100644 --- a/asmcomp/amd64/emit.mlp +++ b/asmcomp/amd64/emit.mlp @@ -794,6 +794,7 @@ let data l = let begin_assembly() = reset_debug_info(); (* PR#5603 *) float_constants := []; + ` .file \"{emit_string (String.escaped !Location.input_name)}\"\n`; if !Clflags.dlcode then begin (* from amd64.S; could emit these constants on demand *) if macosx then diff --git a/asmcomp/arm/emit.mlp b/asmcomp/arm/emit.mlp index 4948fb2..6f30fba 100644 --- a/asmcomp/arm/emit.mlp +++ b/asmcomp/arm/emit.mlp @@ -892,6 +892,7 @@ let data l = let begin_assembly() = reset_debug_info(); + ` .file \"{emit_string (String.escaped !Location.input_name)}\"\n`; ` .syntax unified\n`; begin match !arch with | ARMv4 -> ` .arch armv4t\n` diff --git a/asmcomp/arm64/emit.mlp b/asmcomp/arm64/emit.mlp index 750c2b2..5afbb8a 100644 --- a/asmcomp/arm64/emit.mlp +++ b/asmcomp/arm64/emit.mlp @@ -942,6 +942,7 @@ let data l = let begin_assembly() = reset_debug_info(); + ` .file \"{emit_string (String.escaped !Location.input_name)}\"\n`; let lbl_begin = Compilenv.make_symbol (Some "data_begin") in ` .data\n`; ` .globl {emit_symbol lbl_begin}\n`; diff --git a/asmcomp/i386/emit.mlp b/asmcomp/i386/emit.mlp index 98df5f9..531150f 100644 --- a/asmcomp/i386/emit.mlp +++ b/asmcomp/i386/emit.mlp @@ -986,6 +986,7 @@ let data l = let begin_assembly() = reset_debug_info(); (* PR#5603 *) float_constants := []; + ` .file \"{emit_string (String.escaped !Location.input_name)}\"\n`; let lbl_begin = Compilenv.make_symbol (Some "data_begin") in ` .data\n`; ` .globl {emit_symbol lbl_begin}\n`; diff --git a/asmcomp/power/emit.mlp b/asmcomp/power/emit.mlp index 4344085..343132b 100644 --- a/asmcomp/power/emit.mlp +++ b/asmcomp/power/emit.mlp @@ -887,6 +887,7 @@ let data l = let begin_assembly() = defined_functions := StringSet.empty; external_functions := StringSet.empty; + ` .file \"{emit_string (String.escaped !Location.input_name)}\"\n`; (* Emit the beginning of the segments *) let lbl_begin = Compilenv.make_symbol (Some "data_begin") in emit_string data_space; diff --git a/asmcomp/sparc/emit.mlp b/asmcomp/sparc/emit.mlp index 877a3d5..7b041e9 100644 --- a/asmcomp/sparc/emit.mlp +++ b/asmcomp/sparc/emit.mlp @@ -727,6 +727,7 @@ let data l = (* Beginning / end of an assembly file *) let begin_assembly() = + ` .file \"{emit_string (String.escaped !Location.input_name)}\"\n`; let lbl_begin = Compilenv.make_symbol (Some "data_begin") in ` .data\n`; ` .global {emit_symbol lbl_begin}\n`; id=749b9582061f7d929be83a194040b63b41afec81'>swh: Adjust 'origin' test....This is a followup to 3d2f29382de2d0ee852745cc002dfe2b5d22e1c2. * tests/swh.scm (%origin): Remove "id". ("lookup-origin"): Remove use of 'origin-id'. Ludovic Courtès 2019-09-02swh: Add hooks for rate limiting handling....* guix/swh.scm (%allow-request?, %save-rate-limit-reset-time) (%general-rate-limit-reset-time): New variables. (request-rate-limit-reached?, update-rate-limit-reset-time!): New procedures. (call): Call '%allow-request?'. Change 'swh-error' protocol to pass METHOD in addition to URL. * tests/swh.scm ("rate limit reached") ("%allow-request? and request-rate-limit-reached?"): New tests. Ludovic Courtès 2019-09-02tests: 'with-http-server' accepts multiple responses....* guix/tests/http.scm (call-with-http-server): Replace 'code' and 'data' parameters with 'responses+data'. Compute RESPONSES as a function of that. Remove #:headers parameter. [http-write]: Quit only when RESPONSES is empty. [server-body]: Get the response and data from RESPONSES, and set it to point to the rest. (with-http-server): Adjust accordingly. * tests/derivations.scm ("'download' built-in builder") ("'download' built-in builder, invalid hash") ("'download' built-in builder, not found") ("'download' built-in builder, check mode"): Adjust to new 'with-http-server' interface. * tests/lint.scm ("home-page: 200") ("home-page: 200 but short length") ("home-page: 404", "home-page: 301, invalid"): ("home-page: 301 -> 200", "home-page: 301 -> 404") ("source: 200", "source: 200 but short length") ("source: 404", "source: 404 and 200") ("source: 301 -> 200", "source: 301 -> 404"): ("github-url", github-url): Likewise. * tests/swh.scm (with-json-result) ("lookup-origin, not found"): Likewise. Ludovic Courtès 2019-07-22swh: Add basic tests....* guix/swh.scm (%swh-base-url): Turn into a parameter and export it. * tests/swh.scm: New file. * Makefile.am (SCM_TESTS): Add it. Ludovic Courtès