[llvm] 5ba4a0e - [gn] Don't pass -fprofile-instr-generate to linker on Windows

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Thu May 13 16:04:17 PDT 2021


Author: Reid Kleckner
Date: 2021-05-13T16:04:11-07:00
New Revision: 5ba4a0e890c8106a10d32b0d34af1b214b9bdf3a

URL: https://github.com/llvm/llvm-project/commit/5ba4a0e890c8106a10d32b0d34af1b214b9bdf3a
DIFF: https://github.com/llvm/llvm-project/commit/5ba4a0e890c8106a10d32b0d34af1b214b9bdf3a.diff

LOG: [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.

Added: 
    

Modified: 
    llvm/utils/gn/build/BUILD.gn

Removed: 
    


################################################################################
diff  --git a/llvm/utils/gn/build/BUILD.gn b/llvm/utils/gn/build/BUILD.gn
index 39848deabd4be..757d0b6de4d3c 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


        


More information about the llvm-commits mailing list