1
0
mirror of https://github.com/golang/go synced 2024-11-25 09:17:57 -07:00

cmd/go: adjust test with tricky ld flags to not run on Darwin

normally this would not run on darwin anyway, but if there
happens to be a "pkg-config" binary, then it will.  Darwin's
clang/linker does not have this flag.

Change-Id: I61929cf193c95b420441187beb8b237fa1037807
Reviewed-on: https://go-review.googlesource.com/c/go/+/616376
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Sam Thanawalla <samthanawalla@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
This commit is contained in:
David Chase 2024-09-27 19:15:03 -04:00
parent d39bfafee7
commit 2f507985dc

View File

@ -1505,13 +1505,16 @@ func main() {
tg.setenv("PKG_CONFIG_PATH", tg.path("."))
tg.run("run", tg.path("foo.go"))
// test for ldflags
tg.tempFile("bar.pc", `
if runtime.GOOS != "darwin" { // darwin doesn't like these ldflags
// test for ldflags
tg.tempFile("bar.pc", `
Name: bar
Description: The bar library
Version: 1.0.0
Libs: -Wl,-rpath=/path\ with\ spaces/bin
`)
}
tg.tempFile("bar.go", `package main
/*
#cgo pkg-config: bar