[PATCH] D57191: gn build: Build clang with -fno-strict-aliasing, make building with gcc much quieter

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 24 16:29:20 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL352141: gn build: Build clang with -fno-strict-aliasing, make building with gcc much… (authored by nico, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D57191?vs=183393&id=183438#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57191/new/

https://reviews.llvm.org/D57191

Files:
  llvm/trunk/utils/gn/build/BUILD.gn


Index: llvm/trunk/utils/gn/build/BUILD.gn
===================================================================
--- llvm/trunk/utils/gn/build/BUILD.gn
+++ llvm/trunk/utils/gn/build/BUILD.gn
@@ -93,12 +93,27 @@
         "-Wextra",
       ]
     }
-    cflags += [
-      "-Wno-unused-parameter",
-      "-Wstring-conversion",
-    ]
+    cflags += [ "-Wno-unused-parameter" ]
     if (is_clang) {
-      cflags += [ "-Wdelete-non-virtual-dtor" ]
+      cflags += [
+        "-Wdelete-non-virtual-dtor",
+        "-Wstring-conversion",
+      ]
+    } else {
+      cflags += [
+        # GCC's -Wcomment complains about // comments ending with '\' if the
+        # next line is also a // comment.
+        "-Wno-comment",
+
+        # Disable gcc's potentially uninitialized use analysis as it presents
+        # lots of false positives.
+        "-Wno-maybe-uninitialized",
+      ]
+      cflags_cc += [
+        # The LLVM libraries have no stable C++ API, so -Wnoexcept-type is not
+        # useful.
+        "-Wno-noexcept-type",
+      ]
     }
     if (is_clang && use_goma) {
       # goma converts all paths to lowercase on the server, breaking this
@@ -135,6 +150,9 @@
 }
 
 config("clang_code") {
+  if (host_os != "win") {
+    cflags = [ "-fno-strict-aliasing" ]
+  }
   include_dirs = [
     "//clang/include",
     "$root_gen_dir/clang/include",


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57191.183438.patch
Type: text/x-patch
Size: 1361 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190125/fd5e0a87/attachment.bin>


More information about the llvm-commits mailing list