You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add hash of source files in debug info
LLVM supports placing the hash of source files inside the debug info.
This information can be used by a debugger to verify that the source code matches
the executable.
This change adds support for both hash algorithms supported by LLVM, MD5 and SHA1, controlled by a target option.
* DWARF only supports MD5
* LLVM IR supports MD5 and SHA1 (and SHA256 in LLVM 11).
* CodeView (.PDB) supports MD5, SHA1, and SHA256.
Fixesrust-lang#68980.
Tracking issue: rust-lang#70401
rustc dev guide PR with further details: rust-lang/rustc-dev-guide#623
The tracking issue for this feature is: [#70401](https://github.com/rust-lang/rust/issues/70401).
4
+
5
+
------------------------
6
+
7
+
The `-Z src-hash-algorithm` compiler flag controls which algorithm is used when hashing each source file. The hash is stored in the debug info and can be used by a debugger to verify the source code matches the executable.
8
+
9
+
Supported hash algorithms are: `md5`, and `sha1`. Note that not all hash algorithms are supported by all debug info formats.
10
+
11
+
By default, the compiler chooses the hash algorithm based on the target specification.
0 commit comments