[PATCH] D11288: [llgo] cmd/gllgo: handle/ignore more flags

Andrew Wilkins axwalk at gmail.com
Thu Jul 16 21:58:34 PDT 2015


axw created this revision.
axw added a reviewer: pcc.
axw added a subscriber: llvm-commits.
Herald added a subscriber: axw.

This diff is to support Debian packaging,
which sets various hardening-rleated flags
in CFLAGS. They don't make sense for Go,
so we just ignore them.

http://reviews.llvm.org/D11288

Files:
  cmd/gllgo/gllgo.go

Index: cmd/gllgo/gllgo.go
===================================================================
--- cmd/gllgo/gllgo.go
+++ cmd/gllgo/gllgo.go
@@ -324,6 +324,16 @@
 		case strings.HasPrefix(args[0], "-fgo-relative-import-path="):
 			// TODO(pcc): Handle this.
 
+		case strings.HasPrefix(args[0], "-fstack-protector"):
+			// Not generally useful for Go, since the language provides
+			// memory-safe guarantees. Ignore.
+
+		case strings.HasPrefix(args[0], "-Wformat"):
+			// Purview of "go vet". Ignore.
+
+		case strings.HasPrefix(args[0], "-Werror="):
+			// Go doesn't do warnings. Ignore.
+
 		case args[0] == "-fload-plugin":
 			if len(args) == 1 {
 				return opts, errors.New("missing argument after '-fload-plugin'")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11288.29976.patch
Type: text/x-patch
Size: 728 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150717/c7c1c11e/attachment.bin>


More information about the llvm-commits mailing list