]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: adjust test with tricky ld flags to not run on Darwin
authorDavid Chase <drchase@google.com>
Fri, 27 Sep 2024 23:15:03 +0000 (19:15 -0400)
committerDavid Chase <drchase@google.com>
Fri, 4 Oct 2024 20:34:42 +0000 (20:34 +0000)
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>
src/cmd/go/go_test.go

index b99656d3ce9665249e768be542aa2c4eb8502553..c24ab2a794742f853eb59c33f528db57eb0c13b6 100644 (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