When compiler uses intermediate files, they can result in random file names being recorded in debug symbols.

Some affected packages: randomness_in_ocaml_custom_executables, randomness_in_ocaml_packed_libraries, randomness_in_ocaml_startup_files

Detection

Example diffoscope output exhibiting the issue for ocamlopt -pack

Solution

Compilers need to output the .file directive in assembly. Example patch for ocamlopt