--- gmp-6.1.2/configure.ac	2016-12-16 10:45:27.000000000 -0500
+++ gmp-6.1.2-LDFLAGS/configure.ac	2019-03-25 18:33:48.877277818 -0400
@@ -2124,7 +2124,7 @@ for abi in $abilist; do
           instrument) cflags="$cflags -finstrument-functions" ;;
         esac
 
-        GMP_PROG_CC_WORKS($cc $cflags $cppflags,,continue)
+        GMP_PROG_CC_WORKS($cc $cflags $cppflags $LDFLAGS,,continue)
 
         # If we're supposed to be using a "long long" for a limb, check that
         # it works.
@@ -2267,12 +2267,12 @@ if test $found_compiler = yes; then
             #
             if test "$abi" = 32; then
               GMP_GCC_PENTIUM4_SSE2($cc $cflags $cppflags,, continue)
-              GMP_OS_X86_XMM($cc $cflags $cppflags,, continue)
+              GMP_OS_X86_XMM($cc $cflags $cppflags $LDFLAGS,, continue)
             fi
             ;;
           -no-cpp-precomp)
             # special check, avoiding a warning
-            GMP_GCC_NO_CPP_PRECOMP($ccbase,$cc,$cflags,
+            GMP_GCC_NO_CPP_PRECOMP($ccbase,$cc,$cflags $LDFLAGS,
                                    [cflags="$cflags $flag"
                                    break],
                                    [continue])
@@ -2292,7 +2292,7 @@ if test $found_compiler = yes; then
             ;;
         esac
 
-        GMP_PROG_CC_WORKS($cc $cflags $cppflags $flag,
+        GMP_PROG_CC_WORKS($cc $cflags $cppflags $flag $LDFLAGS,
           [cflags="$cflags $flag"
           break])
       done
@@ -2435,7 +2435,7 @@ if test $enable_cxx != no; then
   #
   for cxxflags_choice in $cxxflags_list; do
     eval CXXFLAGS=\"\$cxxflags_$cxxflags_choice\"
-    GMP_PROG_CXX_WORKS($CXX $CPPFLAGS $CXXFLAGS,
+    GMP_PROG_CXX_WORKS($CXX $CPPFLAGS $CXXFLAGS $LDFLAGS,
       [want_cxx=yes
       break])
   done
