Skip to content

Commit 38244a1

Browse files
authored
Add imacros to absolutized cgo env list (#4325)
**What type of PR is this?** > Bug fix **What does this PR do? Why is it needed?** This adds the -imacros flag to the set of cgo compiler flags that are transformed to absolute paths. Currently relative path values for -imacros will fail. **Which issues(s) does this PR fix?** No existing issue, just seems to be a missed flag. **Other notes for review** I have been able to successfully test this locally using my existing cc toolchain.
1 parent 66cd5f5 commit 38244a1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

go/tools/builders/env.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ var (
3535
// cgoEnvVars is the list of all cgo environment variable
3636
cgoEnvVars = []string{"CGO_CFLAGS", "CGO_CXXFLAGS", "CGO_CPPFLAGS", "CGO_LDFLAGS"}
3737
// cgoAbsEnvFlags are all the flags that need absolute path in cgoEnvVars
38-
cgoAbsEnvFlags = []string{"-I", "-L", "-isysroot", "-isystem", "-iquote", "-include", "-gcc-toolchain", "--sysroot", "-resource-dir", "-fsanitize-blacklist", "-fsanitize-ignorelist"}
38+
cgoAbsEnvFlags = []string{"-I", "-L", "-isysroot", "-isystem", "-iquote", "-include", "-imacros", "-gcc-toolchain", "--sysroot", "-resource-dir", "-fsanitize-blacklist", "-fsanitize-ignorelist"}
3939
// cgoAbsPlaceholder is placed in front of flag values that must be absolutized
4040
cgoAbsPlaceholder = "__GO_BAZEL_CC_PLACEHOLDER__"
4141
)

0 commit comments

Comments
 (0)