From: Joel Rosdahl Date: Sat, 9 Nov 2024 20:53:07 +0000 (+0100) Subject: fix: Add support for Clang -frandomize-layout-seed-file option X-Git-Tag: v4.11~44 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=18aeedc6b24aa7be7c5bd701e372ab2727d8aa7e;p=thirdparty%2Fccache.git fix: Add support for Clang -frandomize-layout-seed-file option Fixes #1528. --- diff --git a/src/ccache/ccache.cpp b/src/ccache/ccache.cpp index b23e731a..efc833ed 100644 --- a/src/ccache/ccache.cpp +++ b/src/ccache/ccache.cpp @@ -1823,6 +1823,18 @@ hash_argument(const Context& ctx, return {}; } + static const std::string_view frandomize_layout_seed_file = + "-frandomize-layout-seed-file="; + if (util::starts_with(args[i], frandomize_layout_seed_file)) { + hash.hash_delimiter(frandomize_layout_seed_file); + auto file = args[i].substr(frandomize_layout_seed_file.length()); + if (!hash_binary_file(ctx, hash, file)) { + LOG("Failed to hash {}", file); + return tl::unexpected(Statistic::bad_input_file); + } + return {}; + } + // When using the preprocessor, some arguments don't contribute to the hash. // The theory is that these arguments will change the output of -E if they are // going to have any effect at all. For precompiled headers this might not be