[llvm] [gn] Sync some chromium flags on windows (PR #108074)

via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 10 12:42:35 PDT 2024


https://github.com/GkvJwa created https://github.com/llvm/llvm-project/pull/108074

Mainly uses utf8 by default and add bigobj(keep the same as cmake)

>From b4520ed8ade08b8b59d193e23defae1a00ebfd45 Mon Sep 17 00:00:00 2001
From: GkvJwa <gkvjwa at gmail.com>
Date: Wed, 11 Sep 2024 03:39:13 +0800
Subject: [PATCH] [gn] Sync some chromium flags on windows

---
 llvm/utils/gn/build/BUILD.gn | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/llvm/utils/gn/build/BUILD.gn b/llvm/utils/gn/build/BUILD.gn
index 1ccaefdc21c822..b5a55478ee9ee6 100644
--- a/llvm/utils/gn/build/BUILD.gn
+++ b/llvm/utils/gn/build/BUILD.gn
@@ -144,7 +144,6 @@ config("compiler_defaults") {
     if (symbol_level != 0) {
       cflags += [
         "/Zi",
-        "/FS",
       ]
       if (symbol_level == 1 && is_clang) {
         cflags += [ "-gline-tables-only" ]
@@ -181,6 +180,12 @@ config("compiler_defaults") {
       "UNICODE",
     ]
     cflags += [ "/EHs-c-" ]
+    cflags += [
+      "/Gy",  # Enable function-level linking.
+      "/FS",  # Preserve previous PDB behavior.
+      "/bigobj",  # Some of our files are bigger than the regular limits.
+      "/utf-8",  # Assume UTF-8 by default to avoid code page dependencies.
+    ]
     cflags_cc += [ "/std:c++17" ]
 
     # cl.exe doesn't set __cplusplus correctly by default.



More information about the llvm-commits mailing list