diff --git a/libgcc/configure.ac b/libgcc/configure.ac
--- a/libgcc/configure.ac
+++ b/libgcc/configure.ac
@@ -432,13 +432,14 @@
 # check if we have VSX (ISA 2.06) support to build the software libraries, and
 # whether the assembler can handle xsaddqp for hardware support.  Also check if
 # a new glibc is being used so that __builtin_cpu_supports can be used.
-powerpc*-*-linux*)
+powerpc*-*-linux* | powerpc*-*-freebsd*)
   saved_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS -mabi=altivec -mvsx -mfloat128"
   AC_CACHE_CHECK([for PowerPC ISA 2.06 to build __float128 libraries],
 		 [libgcc_cv_powerpc_float128],
 		 [AC_COMPILE_IFELSE(
-    [AC_LANG_SOURCE([vector double dadd (vector double a, vector double b) { return a + b; }])],
+    [AC_LANG_SOURCE([vector double dadd (vector double a, vector double b) { return a + b; }
+__ibm128 conftest_ibm128;])],
     [libgcc_cv_powerpc_float128=yes],
     [libgcc_cv_powerpc_float128=no])])
 
