]> Cypherpunks.ru repositories - gostls13.git/commitdiff
[release-branch.go1.21 cmd/cgo/internal/test: don't pass -lm on darwin
authorCherry Mui <cherryyz@google.com>
Mon, 10 Jul 2023 23:04:57 +0000 (19:04 -0400)
committerCherry Mui <cherryyz@google.com>
Mon, 31 Jul 2023 16:12:29 +0000 (16:12 +0000)
On darwin, -lm is not necessary as the math functions are included
in libSystem. Passing -lm multiple times results in linker
warnings. Don't pass it on darwin.

For #61229.

Change-Id: I72d8dab1f0eead68cbeb176ac97b8ed1a0cfddab
Reviewed-on: https://go-review.googlesource.com/c/go/+/508697
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
(cherry picked from commit 333c80694c797b5540c959f33c710bc6eba0d141)
Reviewed-on: https://go-review.googlesource.com/c/go/+/513758

src/cmd/cgo/internal/test/issue8756.go
src/cmd/cgo/internal/test/issue8756/issue8756.go
src/cmd/cgo/internal/test/test.go

index 1ec85a8a5eebf81ec1b59f5cd9fc1578ee28eab0..817f449e96c9929d42551fee580b489bedbaed52 100644 (file)
@@ -1,7 +1,7 @@
 package cgotest
 
 /*
-#cgo LDFLAGS: -lm
+#cgo !darwin LDFLAGS: -lm
 #include <math.h>
 */
 import "C"
index 5f6b7778ff6e234f15cdaa7ae40fcbfd64d4b182..223397f0679e85a44b14818860287012a284da21 100644 (file)
@@ -1,7 +1,7 @@
 package issue8756
 
 /*
-#cgo LDFLAGS: -lm
+#cgo !darwin LDFLAGS: -lm
 #include <math.h>
 */
 import "C"
index 8e24f2e61871194d19d516168c110ba364f77c46..7da5a856b307a066862961fcf68a446a44e4bcdb 100644 (file)
@@ -23,7 +23,7 @@ package cgotest
 #include <unistd.h>
 #include <sys/stat.h>
 #include <errno.h>
-#cgo LDFLAGS: -lm
+#cgo !darwin LDFLAGS: -lm
 
 #ifndef WIN32
 #include <pthread.h>