From 5ba4a0e890c8106a10d32b0d34af1b214b9bdf3a Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Thu, 13 May 2021 16:03:01 -0700 Subject: [PATCH] [gn] Don't pass -fprofile-instr-generate to linker on Windows Avoids a warning from the linker. The user still has to put the resource directory on the linker search path, and I can't find a clean way to do that automatically in gn. --- llvm/utils/gn/build/BUILD.gn | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/llvm/utils/gn/build/BUILD.gn b/llvm/utils/gn/build/BUILD.gn index 39848de..757d0b6 100644 --- a/llvm/utils/gn/build/BUILD.gn +++ b/llvm/utils/gn/build/BUILD.gn @@ -233,7 +233,9 @@ config("compiler_defaults") { "-fprofile-instr-generate=" + rebase_path("$root_build_dir/profiles/%4m.profraw"), ] - ldflags += [ "-fprofile-instr-generate" ] + if (host_os != "win") { + ldflags += [ "-fprofile-instr-generate" ] + } } # Deterministic build setup, see -- 2.7.4