]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libgo: add -L option for libatomic when using -pthread
authorIan Lance Taylor <ian@gcc.gnu.org>
Thu, 22 Feb 2018 18:49:33 +0000 (18:49 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Thu, 22 Feb 2018 18:49:33 +0000 (18:49 +0000)
    Fixes https://gcc.gnu.org/PR84484

    Reviewed-on: https://go-review.googlesource.com/95436

From-SVN: r257911

gcc/go/gofrontend/MERGE
libgo/configure
libgo/configure.ac

index c52bf4e0dc0c7f97622df15e5015a084c5217cb2..f5d71f57d3339d004a4aea8bd0590779a391d6af 100644 (file)
@@ -1,4 +1,4 @@
-c6e0970f75508e209a10a7db5164d6ea3f9b28bf
+b4d61f028dd1623142df4130b6c660bb77474b7b
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
index aba4dc396fc0b720cc714003fbe241542d1d4ccd..dcfc524bccbe49928dd9afd77dc68468f326c717 100755 (executable)
@@ -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
 
 
index 1264a1d252401c42aaa7a2c7f4f29670cff1b714..1f49aee9e17c48d14bef03ae9274841ccc4cac88 100644 (file)
@@ -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)