aboutsummaryrefslogtreecommitdiff
path: root/libgo/configure.ac
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2020-05-15 10:50:57 -0700
committerIan Lance Taylor <iant@golang.org>2020-05-15 15:33:20 -0700
commite478cacb62f116d2c8efdabc4b51e6d2d7041aae (patch)
tree842f0f76d7668a745c1842e07f39b3cd56356a37 /libgo/configure.ac
parent29f0e90d9904d8e0965443d4da4c95ddde5edb1e (diff)
downloadgcc-e478cacb62f116d2c8efdabc4b51e6d2d7041aae.zip
gcc-e478cacb62f116d2c8efdabc4b51e6d2d7041aae.tar.gz
gcc-e478cacb62f116d2c8efdabc4b51e6d2d7041aae.tar.bz2
libgo: only build syscall test with -static if it works
Test whether -static works, and use it if possible. This time for sure. For PR go/95061 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/234024
Diffstat (limited to 'libgo/configure.ac')
-rw-r--r--libgo/configure.ac11
1 files changed, 11 insertions, 0 deletions
diff --git a/libgo/configure.ac b/libgo/configure.ac
index f800d44..235d867 100644
--- a/libgo/configure.ac
+++ b/libgo/configure.ac
@@ -881,6 +881,17 @@ if test "x$libgo_cv_as_x86_aes" = xyes; then
[Define if your assembler supports AES instructions.])
fi
+dnl Test whether the linker supports the -static option.
+AC_CACHE_CHECK([whether -static is supported],
+[libgo_cv_ld_static],
+[LDFLAGS_hold=$LDFLAGS
+LDFLAGS="$LDFLAGS -static"
+AC_LINK_IFELSE([AC_LANG_PROGRAM(,)],
+[libgo_cv_ld_static=yes],
+[libgo_cv_ld_static=no])
+LDFLAGS=$LDFLAGS_hold])
+AM_CONDITIONAL(HAVE_STATIC_LINK, test "$libgo_cv_ld_static" = yes)
+
AC_CACHE_SAVE
if test ${multilib} = yes; then