cmd/go: add -I= to cgo CFLAGS safelist #34449
Labels
FrozenDueToAge
help wanted
NeedsFix
The path to resolution is known, but the work has not been done.
release-blocker
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What did you do?
I want to add
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/libxml2
as an include path, but I want my go script to be able to handle different Xcode installation paths and SDKs.In gcc, this is done by specifying an include path that is relative to the sdkroot. This can be done with
-I=
. See https://gcc.gnu.org/onlinedocs/gcc/Directory-Options.html:I found that in go 1.9.2, I was able to put this include path in cgo lines as follows:
However, I upgraded to go 1.13 and this no longer works.
What did you expect to see?
A working build
What did you see instead?
An error: "invalid flag in #cgo CFLAGS: -I =/usr/include/libxml2 (see https://golang.org/s/invalidflag)"
The text was updated successfully, but these errors were encountered: