libgo: only build syscall test with -static on GNU/Linux
For https://gcc.gnu.org/PR95061
Change-Id: If10904a30345af7b205bdd037ddc22080dff7fcb
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/234019
Reviewed-by: Cherry Zhang <cherryyz@google.com>
diff --git a/libgo/Makefile.am b/libgo/Makefile.am
index eff0e00..0bbe54c 100644
--- a/libgo/Makefile.am
+++ b/libgo/Makefile.am
@@ -967,9 +967,11 @@
# Also use -fno-inline to get better results from the memory profiler.
runtime_pprof_check_GOCFLAGS = -static-libgo -fno-inline
+if LIBGO_IS_LINUX
# Use -static for the syscall tests, because otherwise when
# running as root the re-execs ignore LD_LIBRARY_PATH.
syscall_check_GOCFLAGS = -static
+endif
extra_go_files_runtime_internal_sys = version.go
runtime/internal/sys.lo.dep: $(extra_go_files_runtime_internal_sys)
diff --git a/libgo/Makefile.in b/libgo/Makefile.in
index 8726638..982253d 100644
--- a/libgo/Makefile.in
+++ b/libgo/Makefile.in
@@ -1107,7 +1107,7 @@
# Use -static for the syscall tests, because otherwise when
# running as root the re-execs ignore LD_LIBRARY_PATH.
-syscall_check_GOCFLAGS = -static
+@LIBGO_IS_LINUX_TRUE@syscall_check_GOCFLAGS = -static
extra_go_files_runtime_internal_sys = version.go
extra_go_files_internal_cpu = cpugen.go
extra_go_files_golang_org_x_sys_cpu = gcpugen.go