diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2018-02-22 18:49:33 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2018-02-22 18:49:33 +0000 |
commit | 35e7db41cab1a2b134b8ccd4407675ab20fde578 (patch) | |
tree | 2e24faa38dbcfb3507c240567341a0aa308a6864 | |
parent | 5d0d5d6876afa8bc773e7503ec714ac1c08ae239 (diff) | |
download | gcc-35e7db41cab1a2b134b8ccd4407675ab20fde578.zip gcc-35e7db41cab1a2b134b8ccd4407675ab20fde578.tar.gz gcc-35e7db41cab1a2b134b8ccd4407675ab20fde578.tar.bz2 |
libgo: add -L option for libatomic when using -pthread
Fixes https://gcc.gnu.org/PR84484
Reviewed-on: https://go-review.googlesource.com/95436
From-SVN: r257911
-rw-r--r-- | gcc/go/gofrontend/MERGE | 2 | ||||
-rwxr-xr-x | libgo/configure | 5 | ||||
-rw-r--r-- | libgo/configure.ac | 5 |
3 files changed, 7 insertions, 5 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index c52bf4e..f5d71f5 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -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. diff --git a/libgo/configure b/libgo/configure index aba4dc3..dcfc524 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 1264a1d..1f49aee 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) |