Skip to content

Commit 94f3762

Browse files
dpifkeianlancetaylor
authored andcommitted
cmd/go: add -include to cgo whitelist
Fixes #39988. Change-Id: Ia6f5b73e6508f27e3badbcbd29dbeadffd55a932 Reviewed-on: https://go-review.googlesource.com/c/go/+/240739 Trust: Tobias Klauser <[email protected]> Run-TryBot: Tobias Klauser <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent 49b017f commit 94f3762

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/cmd/go/internal/work/security.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ var validCompilerFlagsWithNextArg = []string{
132132
"-U",
133133
"-I",
134134
"-framework",
135+
"-include",
135136
"-isysroot",
136137
"-isystem",
137138
"--sysroot",

src/cmd/go/internal/work/security_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ var goodCompilerFlags = [][]string{
6262
{"-I", "=/usr/include/libxml2"},
6363
{"-I", "dir"},
6464
{"-I", "$SYSROOT/dir"},
65+
{"-isystem", "/usr/include/mozjs-68"},
66+
{"-include", "/usr/include/mozjs-68/RequiredDefines.h"},
6567
{"-framework", "Chocolate"},
6668
{"-x", "c"},
6769
{"-v"},
@@ -91,6 +93,7 @@ var badCompilerFlags = [][]string{
9193
{"-I", "@foo"},
9294
{"-I", "-foo"},
9395
{"-I", "=@obj"},
96+
{"-include", "@foo"},
9497
{"-framework", "-Caffeine"},
9598
{"-framework", "@Home"},
9699
{"-x", "--c"},

0 commit comments

Comments
 (0)