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
package cgotest
/*
-#cgo LDFLAGS: -lm
+#cgo !darwin LDFLAGS: -lm
#include <math.h>
*/
import "C"
package issue8756
/*
-#cgo LDFLAGS: -lm
+#cgo !darwin LDFLAGS: -lm
#include <math.h>
*/
import "C"
#include <unistd.h>
#include <sys/stat.h>
#include <errno.h>
-#cgo LDFLAGS: -lm
+#cgo !darwin LDFLAGS: -lm
#ifndef WIN32
#include <pthread.h>