* configure.ac: Set the MCMODEL_MEDIUM conditional to false if
authorIan Lance Taylor <ian@airs.com>
Tue, 29 Dec 2009 22:49:13 +0000 (22:49 +0000)
committerIan Lance Taylor <ian@airs.com>
Tue, 29 Dec 2009 22:49:13 +0000 (22:49 +0000)
using a version of gcc before 4.1.
* configure: Rebuild.

gold/ChangeLog
gold/configure
gold/configure.ac

index 345ec626695af437b4c48606bb503738ea63646d..4e396485dcbe69cc8d09d1ea4cddd4d58ff2f91e 100644 (file)
@@ -1,3 +1,9 @@
+2009-12-29  Ian Lance Taylor  <iant@google.com>
+
+       * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
+       using a version of gcc before 4.1.
+       * configure: Rebuild.
+
 2009-12-28  Chris Demetriou  <cgd@google.com>
 
        * attributes.cc (Output_attributes_section_data::do_write): Use
index 1bb2d3dee21d59d67047ec20ed4dbd6e786b540f..4817e444dc545e8604ac187d97494a32e2a3025e 100755 (executable)
@@ -6045,7 +6045,32 @@ else
 fi
 
 
- if test "$target_cpu" = "x86_64"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc >= 4.1" >&5
+$as_echo_n "checking for gcc >= 4.1... " >&6; }
+if test "${gold_cv_prog_gcc41+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#if !defined __GNUC__
+error
+#elif __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 1)
+error
+#endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gold_cv_prog_gcc41=yes
+else
+  gold_cv_prog_gcc41=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gold_cv_prog_gcc41" >&5
+$as_echo "$gold_cv_prog_gcc41" >&6; }
+
+ if test "$target_cpu" = "x86_64" -a "$gold_cv_prog_gcc41" = "yes"; then
   MCMODEL_MEDIUM_TRUE=
   MCMODEL_MEDIUM_FALSE='#'
 else
index f279b450a20d58e17533fa1e1dd1161c88057a16..7102670dedf130d70190604ed0e053d7cacdedcd 100644 (file)
@@ -227,8 +227,20 @@ AM_CONDITIONAL(FN_PTRS_IN_SO_WITHOUT_PIC, [
     *) true;;
   esac])
 
+dnl Test for gcc 4.1 or later.  Full support for -mcmodel=medium is
+dnl only available in gcc 4.1.
+AC_CACHE_CHECK([for gcc >= 4.1], [gold_cv_prog_gcc41],
+[AC_COMPILE_IFELSE([
+#if !defined __GNUC__
+error
+#elif __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 1)
+error
+#endif
+], [gold_cv_prog_gcc41=yes], [gold_cv_prog_gcc41=no])])
+
 dnl Whether we can test -mcmodel=medium.
-AM_CONDITIONAL(MCMODEL_MEDIUM, [test "$target_cpu" = "x86_64"])
+AM_CONDITIONAL(MCMODEL_MEDIUM,
+[test "$target_cpu" = "x86_64" -a "$gold_cv_prog_gcc41" = "yes"])
 
 dnl Test for __thread support.
 AC_CACHE_CHECK([for thread support], [gold_cv_c_thread],
This page took 0.035893 seconds and 4 git commands to generate.