cmd/go: go command rejects references to .tbd files #44263
Labels
FrozenDueToAge
help wanted
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I am using cgo to link to a dylib with pkg-config.
My cgo program attempts to link to it as follows:
The linker inputs
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libz.tbd
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libsqlite3.tbd
are rejected:The dylib specifies a dependency on a
.tbd
file, which is a macOS text based stub-library, and describes the interface to a dylib or framework. I can work around this by specifying the environment variableCGO_LDFLAGS_ALLOW='^.*tbd$'
.Since it is a valid input to the linker, I think the allow-list for linker flags could add
tbd
to the list of permitted direct inputs. If that sounds reasonable, I'd be more than happy to submit a PR with a test.The text was updated successfully, but these errors were encountered: