diff --git a/src/cmd/go/internal/work/security.go b/src/cmd/go/internal/work/security.go index d02630155b..0ce1664c16 100644 --- a/src/cmd/go/internal/work/security.go +++ b/src/cmd/go/internal/work/security.go @@ -52,7 +52,7 @@ var validCompilerFlags = []*lazyregexp.Regexp{ re(`-W([^@,]+)`), // -Wall but not -Wa,-foo. re(`-Wa,-mbig-obj`), re(`-Wp,-D([A-Za-z_].*)`), - re(`-Wp, -U([A-Za-z_]*)`), + re(`-Wp,-U([A-Za-z_]*)`), re(`-ansi`), re(`-f(no-)?asynchronous-unwind-tables`), re(`-f(no-)?blocks`), diff --git a/src/cmd/go/internal/work/security_test.go b/src/cmd/go/internal/work/security_test.go index 3a02db1d04..6b85c40b13 100644 --- a/src/cmd/go/internal/work/security_test.go +++ b/src/cmd/go/internal/work/security_test.go @@ -22,6 +22,8 @@ var goodCompilerFlags = [][]string{ {"-Osmall"}, {"-W"}, {"-Wall"}, + {"-Wp,-Dfoo=bar"}, + {"-Wp,-Ufoo"}, {"-fobjc-arc"}, {"-fno-objc-arc"}, {"-fomit-frame-pointer"},