This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gold patch committed: -mcmodel=medium test requires gcc 4.1


gold has a test case for -mcmodel=medium for x86_64.  Full support for
-mcmodel=medium was only added in gcc 4.1.  The test will fail if run
with gcc 4.0.3 or earlier.  I committed this patch to check for a
supported version of gcc before trying to run the test.

Ian


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.


Index: configure.ac
===================================================================
RCS file: /cvs/src/src/gold/configure.ac,v
retrieving revision 1.51
diff -p -u -r1.51 configure.ac
--- configure.ac	17 Dec 2009 16:02:03 -0000	1.51
+++ configure.ac	29 Dec 2009 22:48:22 -0000
@@ -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],

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]