Index: llvm-3.1-3.1~+rc3/autoconf/configure.ac
===================================================================
--- llvm-3.1-3.1~+rc3.orig/autoconf/configure.ac	2012-05-20 16:17:42.350257487 +0200
+++ llvm-3.1-3.1~+rc3/autoconf/configure.ac	2012-05-20 16:17:44.650257458 +0200
@@ -231,6 +231,11 @@
     llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
     llvm_cv_os_type="GNU"
     llvm_cv_platform_type="Unix" ;;
+  *-*-gnu*)
+    llvm_cv_link_all_option="-Wl,--whole-archive"
+    llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
+    llvm_cv_os_type="GNU"
+    llvm_cv_platform_type="Unix" ;;
   *-*-solaris*)
     llvm_cv_link_all_option="-Wl,-z,allextract"
     llvm_cv_no_link_all_option="-Wl,-z,defaultextract"
Index: llvm-3.1-3.1~+rc3/configure
===================================================================
--- llvm-3.1-3.1~+rc3.orig/configure	2012-05-20 16:17:42.350257487 +0200
+++ llvm-3.1-3.1~+rc3/configure	2012-05-20 16:17:44.654257458 +0200
@@ -3742,6 +3742,11 @@
     llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
     llvm_cv_os_type="GNU"
     llvm_cv_platform_type="Unix" ;;
+  *-*-gnu*)
+    llvm_cv_link_all_option="-Wl,--whole-archive"
+    llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
+    llvm_cv_os_type="GNU"
+    llvm_cv_platform_type="Unix" ;;
   *-*-solaris*)
     llvm_cv_link_all_option="-Wl,-z,allextract"
     llvm_cv_no_link_all_option="-Wl,-z,defaultextract"
