aboutsummaryrefslogtreecommitdiff
path: root/libgo
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2018-02-22 18:49:33 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2018-02-22 18:49:33 +0000
commitac58a228df4ae9b2d7752e89f6323600e1ecac53 (patch)
tree2e24faa38dbcfb3507c240567341a0aa308a6864 /libgo
parentbcb285a0b5a8765d45cf828a175a5d053e2a1e2a (diff)
libgo: add -L option for libatomic when using -pthread
Fixes https://gcc.gnu.org/PR84484 Reviewed-on: https://go-review.googlesource.com/95436 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257911 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo')
-rwxr-xr-xlibgo/configure5
-rw-r--r--libgo/configure.ac5
2 files changed, 6 insertions, 4 deletions
diff --git a/libgo/configure b/libgo/configure
index aba4dc396fc..dcfc524bccb 100755
--- a/libgo/configure
+++ b/libgo/configure
@@ -14209,7 +14209,7 @@ if test "${libgo_cv_lib_pthread+set}" = set; then :
$as_echo_n "(cached) " >&6
else
CFLAGS_hold=$CFLAGS
-CFLAGS="$CFLAGS -pthread"
+CFLAGS="$CFLAGS -pthread -L../libatomic/.libs"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int i;
@@ -14226,7 +14226,8 @@ fi
$as_echo "$libgo_cv_lib_pthread" >&6; }
PTHREAD_CFLAGS=
if test "$libgo_cv_lib_pthread" = yes; then
- PTHREAD_CFLAGS=-pthread
+ # RISC-V apparently adds -latomic when using -pthread.
+ PTHREAD_CFLAGS="-pthread -L../libatomic/.libs"
fi
diff --git a/libgo/configure.ac b/libgo/configure.ac
index 1264a1d2524..1f49aee9e17 100644
--- a/libgo/configure.ac
+++ b/libgo/configure.ac
@@ -493,14 +493,15 @@ dnl Test whether the compiler supports the -pthread option.
AC_CACHE_CHECK([whether -pthread is supported],
[libgo_cv_lib_pthread],
[CFLAGS_hold=$CFLAGS
-CFLAGS="$CFLAGS -pthread"
+CFLAGS="$CFLAGS -pthread -L../libatomic/.libs"
AC_COMPILE_IFELSE([[int i;]],
[libgo_cv_lib_pthread=yes],
[libgo_cv_lib_pthread=no])
CFLAGS=$CFLAGS_hold])
PTHREAD_CFLAGS=
if test "$libgo_cv_lib_pthread" = yes; then
- PTHREAD_CFLAGS=-pthread
+ # RISC-V apparently adds -latomic when using -pthread.
+ PTHREAD_CFLAGS="-pthread -L../libatomic/.libs"
fi
AC_SUBST(PTHREAD_CFLAGS)