diff --git a/build/build-clang/Remove-FlushViewOfFile-when-unmaping-gcda-files-clang-15.patch b/build/build-clang/Remove-FlushViewOfFile-when-unmaping-gcda-files-clang-15.patch new file mode 100644 index 000000000000..4b0edbe4714f --- /dev/null +++ b/build/build-clang/Remove-FlushViewOfFile-when-unmaping-gcda-files-clang-15.patch @@ -0,0 +1,30 @@ +From 78a6bcfed4b73f13b9973afd69b76067dd4a5dde Mon Sep 17 00:00:00 2001 +From: Calixte Denizet +Date: Mon, 4 Oct 2021 11:07:56 +0200 +Subject: [PATCH] Remove FlushViewOfFile when unmaping gcda files - it can + causes bad performances with slow disks; - MS docs say that it's mainly + useful in case of hard failures (OS crash, electrical failure, ...): so it's + useless to call this function when ccov builds run on CI. + +--- + compiler-rt/lib/profile/GCDAProfiling.c | 5 ----- + 1 file changed, 5 deletions(-) + +diff --git a/compiler-rt/lib/profile/GCDAProfiling.c b/compiler-rt/lib/profile/GCDAProfiling.c +index 4293e8f7b5bf..83650d33c95d 100644 +--- a/compiler-rt/lib/profile/GCDAProfiling.c ++++ b/compiler-rt/lib/profile/GCDAProfiling.c +@@ -286,11 +286,6 @@ static int map_file() { + + static void unmap_file(void) { + #if defined(_WIN32) +- if (!FlushViewOfFile(write_buffer, file_size)) { +- fprintf(stderr, "profiling: %s: cannot flush mapped view: %lu\n", filename, +- GetLastError()); +- } +- + if (!UnmapViewOfFile(write_buffer)) { + fprintf(stderr, "profiling: %s: cannot unmap mapped view: %lu\n", filename, + GetLastError()); +-- +2.33.0 diff --git a/build/build-clang/clang-trunk.json b/build/build-clang/clang-trunk.json index b05667dfff7b..b435d2244a68 100644 --- a/build/build-clang/clang-trunk.json +++ b/build/build-clang/clang-trunk.json @@ -6,7 +6,7 @@ "unpoison-thread-stacks_clang_10.patch", "downgrade-mangling-error_clang_12.patch", "bug47258-extract-symbols-mbcs.patch", - "Remove-FlushViewOfFile-when-unmaping-gcda-files.patch", + "build/build-clang/Remove-FlushViewOfFile-when-unmaping-gcda-files-clang-15.patch", "fuzzing_ccov_build_clang_12.patch" ] }