diff mbox

[RFC] Update gmp/mpfr/mpc minimum versions

Message ID AM4PR07MB1571E7BDED31B7C146A0BC4CE4630@AM4PR07MB1571.eurprd07.prod.outlook.com
State New
Headers show

Commit Message

Bernd Edlinger April 26, 2016, 6:23 p.m. UTC
Hi,

as we all know, it's high time now to adjust the minimum supported
gmp/mpfr/mpc versions for gcc-7.

So this attached patch is now targeting at only supporting the currently
latest relased gmp-6.1.0, mpfr-3.1.4 and mpc-1.0.3, instead of trying
to support all previous versions, especially in-tree, but also without the
in-tree configuration the previously used versions are really creating
trouble nowadays.

To support gmp-6.1.0 in-tree we have to set AM_CFLAGS=-DNO_ASM
as already done with mpfr.  This was already discussed recently on this list.

Initially I was trying to use gmp's new --disable-assembly, but
after careful consideration, I think that we still need to set gmp's
target to none-host-vendor triplet, because only that prevents
gmp to get smart on selecting one of the different possible
target-ABIs.  This would not really work in general, because
gcc overrides the CFLAGS an thus defeats the ABI selection
again.

What do you think, is this patch generally acceptable?

Of course it would mean that everybody would have to use
the recent gmp/mpfr/mpc tar balls immediately, and someone would
have to upload them to ftp://gcc.gnu.org/pub/gcc/infrastructure/
before this patch can be applied of course (I don't know how to).


Thanks
Bernd.
2016-04-26  Bernd Edlinger  <bernd.edlinger@hotmail.de>

	* configure.ac (mpfr): Remove pre-3.1.0 compatibility.
	* configure: Regenerated.
	* Makefile.def (gmp): Explicitly disable assembler.
	(mpfr): Adjust lib_path.
	(mpc): Likewise.
	* Makefile.in: Regenerated.

gcc/
2016-04-26  Bernd Edlinger  <bernd.edlinger@hotmail.de>

	* doc/install.texi: Adjust gmp/mpfr/mpc minimum versions.

contrib/
2016-04-26  Bernd Edlinger  <bernd.edlinger@hotmail.de>

	* download_prerequisites: Adjust gmp/mpfr/mpc versions.

Comments

Jakub Jelinek April 26, 2016, 6:29 p.m. UTC | #1
On Tue, Apr 26, 2016 at 06:23:17PM +0000, Bernd Edlinger wrote:
> as we all know, it's high time now to adjust the minimum supported
> gmp/mpfr/mpc versions for gcc-7.

I'm not saying we shouldn't bump the minimum supported versions, but bumping
them immediately to the latest releases is IMHO undesirable unless the
benefits can justify it.
E.g. I don't consider gmp-6.0.0, or mpfr-3.1.2, or mpc-1.0.2 that obsolete
that I'd have to download a newer one for my daily use.

	Jakub
Marc Glisse April 26, 2016, 6:39 p.m. UTC | #2
On Tue, 26 Apr 2016, Bernd Edlinger wrote:

> as we all know, it's high time now to adjust the minimum supported
> gmp/mpfr/mpc versions for gcc-7.
>
> So this attached patch is now targeting at only supporting the currently
> latest relased gmp-6.1.0, mpfr-3.1.4 and mpc-1.0.3, instead of trying
> to support all previous versions, especially in-tree, but also without the
> in-tree configuration the previously used versions are really creating
> trouble nowadays.

For in-tree builds, requiring the latest version makes sense to me. When 
building gcc with a pre-installed gmp/mpfr/mpc (say the one provided by 
your linux distribution), that's much more painful, and the benefit is not 
as clear. What "trouble" do you have in mind?

> To support gmp-6.1.0 in-tree we have to set AM_CFLAGS=-DNO_ASM
> as already done with mpfr.  This was already discussed recently on this list.

Note that gmp-6.1.1 is supposed to be out any day now and will not require 
-DNO_ASM anymore.
Bernd Edlinger April 26, 2016, 6:42 p.m. UTC | #3
On 26.04.2016 20:29, Jakub Jelinek wrote:
> On Tue, Apr 26, 2016 at 06:23:17PM +0000, Bernd Edlinger wrote:
>> as we all know, it's high time now to adjust the minimum supported
>> gmp/mpfr/mpc versions for gcc-7.
>
> I'm not saying we shouldn't bump the minimum supported versions, but bumping
> them immediately to the latest releases is IMHO undesirable unless the
> benefits can justify it.
> E.g. I don't consider gmp-6.0.0, or mpfr-3.1.2, or mpc-1.0.2 that obsolete
> that I'd have to download a newer one for my daily use.
>
> 	Jakub
>

Yes, thanks.

That would be acceptable as well.  I think the patch will work
with these versions too.

I'd even use these versions for download_prerequisites if they
are more widespread in use today.


Bernd.
Richard Biener April 26, 2016, 7 p.m. UTC | #4
On April 26, 2016 8:39:28 PM GMT+02:00, Marc Glisse <marc.glisse@inria.fr> wrote:
>On Tue, 26 Apr 2016, Bernd Edlinger wrote:
>
>> as we all know, it's high time now to adjust the minimum supported
>> gmp/mpfr/mpc versions for gcc-7.
>>
>> So this attached patch is now targeting at only supporting the
>currently
>> latest relased gmp-6.1.0, mpfr-3.1.4 and mpc-1.0.3, instead of trying
>> to support all previous versions, especially in-tree, but also
>without the
>> in-tree configuration the previously used versions are really
>creating
>> trouble nowadays.
>
>For in-tree builds, requiring the latest version makes sense to me.
>When 
>building gcc with a pre-installed gmp/mpfr/mpc (say the one provided by
>
>your linux distribution), that's much more painful, and the benefit is
>not 
>as clear. What "trouble" do you have in mind?
>
>> To support gmp-6.1.0 in-tree we have to set AM_CFLAGS=-DNO_ASM
>> as already done with mpfr.  This was already discussed recently on
>this list.
>
>Note that gmp-6.1.1 is supposed to be out any day now and will not
>require 
>-DNO_ASM anymore.

I agree with Marc here - we should only update the version used by download prerequisites and document that this is the only supported version for in-tree builds.

Richard.
Bernd Edlinger April 26, 2016, 7:05 p.m. UTC | #5
On 26.04.2016 20:39, Marc Glisse wrote:
> On Tue, 26 Apr 2016, Bernd Edlinger wrote:
>
>> as we all know, it's high time now to adjust the minimum supported
>> gmp/mpfr/mpc versions for gcc-7.
>>
>> So this attached patch is now targeting at only supporting the currently
>> latest relased gmp-6.1.0, mpfr-3.1.4 and mpc-1.0.3, instead of trying
>> to support all previous versions, especially in-tree, but also without
>> the
>> in-tree configuration the previously used versions are really creating
>> trouble nowadays.
>
> For in-tree builds, requiring the latest version makes sense to me. When
> building gcc with a pre-installed gmp/mpfr/mpc (say the one provided by
> your linux distribution), that's much more painful, and the benefit is
> not as clear. What "trouble" do you have in mind?
>

For instance PR libstdc++/69881: gmp.h did this:

#define __need_size_t  /* tell gcc stddef.h we only want size_t */
#include <cstddef>     /* for size_t */

I've persuaded Jonathan to work around that in libstdc++.

Of course the in-tree build does work with less versions than
otherwise.

>> To support gmp-6.1.0 in-tree we have to set AM_CFLAGS=-DNO_ASM
>> as already done with mpfr.  This was already discussed recently on
>> this list.
>
> Note that gmp-6.1.1 is supposed to be out any day now and will not
> require -DNO_ASM anymore.
>

Yes, I know.  I mean, I have tested the patch already with the gmp 
snapshots, but was not aware that it will be available so soon.
However I think it would not really hurt to allow a little
more interoperability, even for in-tree builds.

It is just a matter what versions we want to test, I have not really
any idea where the limits will be, just that it can no longer be 4.3.2.


Thanks
Bernd.
Marc Glisse April 26, 2016, 7:28 p.m. UTC | #6
On Tue, 26 Apr 2016, Bernd Edlinger wrote:

> For instance PR libstdc++/69881: gmp.h did this:
>
> #define __need_size_t  /* tell gcc stddef.h we only want size_t */
> #include <cstddef>     /* for size_t */
>
> I've persuaded Jonathan to work around that in libstdc++.
>
> Of course the in-tree build does work with less versions than
> otherwise.

IIUC, the bug only shows up if you compile in C++11 or later, so basically 
g++-6 or later, and there is a workaround in libstdc++ starting from 
version 6 that means that it doesn't cause any problem. So there might be 
a problem if someone tries to build gcc using CXX='g++-5 -std=c++11' or 
CXX='clang++ -stdlib=libc++' on a glibc system (I don't think others use 
__need_size_t?), but those are rather odd cases.

>>> To support gmp-6.1.0 in-tree we have to set AM_CFLAGS=-DNO_ASM
>>> as already done with mpfr.  This was already discussed recently on
>>> this list.
>>
>> Note that gmp-6.1.1 is supposed to be out any day now and will not
>> require -DNO_ASM anymore.
>>
>
> Yes, I know.  I mean, I have tested the patch already with the gmp
> snapshots, but was not aware that it will be available so soon.
> However I think it would not really hurt to allow a little
> more interoperability, even for in-tree builds.
>
> It is just a matter what versions we want to test, I have not really
> any idea where the limits will be, just that it can no longer be 4.3.2.

Even if in-tree builds work with several versions, we may still want to 
document only one as supported.
Joseph Myers April 26, 2016, 8:14 p.m. UTC | #7
On Tue, 26 Apr 2016, Bernd Edlinger wrote:

> Hi,
> 
> as we all know, it's high time now to adjust the minimum supported
> gmp/mpfr/mpc versions for gcc-7.

I think updating the minimum versions (when using previously built 
libraries, not in-tree) is only appropriate when it allows some cleanup in 
GCC, such as removing conditionals on whether a more recently added 
function is available, adding functionality that depends on a newer 
interface, or using newer interfaces instead of older ones that are now 
deprecated.

For example, you could justify a move to requiring MPFR 3.0.0 or later 
with cleanups to use MPFR_RND* instead of the older GMP_RND*, and 
similarly mpfr_rnd_t instead of the older mp_rnd_t and likewise mpfr_exp_t 
and mpfr_prec_t in fortran/.  You could justify a move to requiring MPC 
1.0.0 (or 1.0.2) by optimizing clog10 using mpc_log10.  I don't know what 
if any newer GMP interfaces would be beneficial in GCC.  And as always in 
such cases, it's a good idea to look at e.g. how widespread the newer 
versions are in GNU/Linux distributions, which indicates how many people 
might be affected by an increase in the version requirement.
Bernd Edlinger April 27, 2016, 2 p.m. UTC | #8
On 26.04.2016 21:28, Marc Glisse wrote:
> On Tue, 26 Apr 2016, Bernd Edlinger wrote:
>
>> For instance PR libstdc++/69881: gmp.h did this:
>>
>> #define __need_size_t  /* tell gcc stddef.h we only want size_t */
>> #include <cstddef>     /* for size_t */
>>
>> I've persuaded Jonathan to work around that in libstdc++.
>>
>> Of course the in-tree build does work with less versions than
>> otherwise.
>
> IIUC, the bug only shows up if you compile in C++11 or later, so
> basically g++-6 or later, and there is a workaround in libstdc++
> starting from version 6 that means that it doesn't cause any problem. So
> there might be a problem if someone tries to build gcc using CXX='g++-5
> -std=c++11' or CXX='clang++ -stdlib=libc++' on a glibc system (I don't
> think others use __need_size_t?), but those are rather odd cases.
>

Yea, but Jonathan did not like this workaround at all, and my personal
preference would also just have been a better error message for this
clearly invalid code.


Bernd.
diff mbox

Patch

Index: Makefile.def
===================================================================
--- Makefile.def	(revision 234533)
+++ Makefile.def	(working copy)
@@ -50,6 +50,7 @@  host_modules= { module= gcc; bootstrap=true;
 host_modules= { module= gmp; lib_path=.libs; bootstrap=true;
 		// Work around in-tree gmp configure bug with missing flex.
 		extra_configure_flags='--disable-shared LEX="touch lex.yy.c"';
+		extra_make_flags='AM_CFLAGS="-DNO_ASM"';
 		no_install= true;
 		// none-*-* disables asm optimizations, bootstrap-testing
 		// the compiler more thoroughly.
@@ -57,11 +58,11 @@  host_modules= { module= gmp; lib_path=.libs; boots
 		// gmp's configure will complain if given anything
 		// different from host for target.
 	        target="none-${host_vendor}-${host_os}"; };
-host_modules= { module= mpfr; lib_path=.libs; bootstrap=true;
+host_modules= { module= mpfr; lib_path=src/.libs; bootstrap=true;
 		extra_configure_flags='--disable-shared @extra_mpfr_configure_flags@';
 		extra_make_flags='AM_CFLAGS="-DNO_ASM"';
 		no_install= true; };
-host_modules= { module= mpc; lib_path=.libs; bootstrap=true;
+host_modules= { module= mpc; lib_path=src/.libs; bootstrap=true;
 		extra_configure_flags='--disable-shared @extra_mpc_gmp_configure_flags@ @extra_mpc_mpfr_configure_flags@';
 		no_install= true; };
 host_modules= { module= isl; lib_path=.libs; bootstrap=true;
Index: Makefile.in
===================================================================
--- Makefile.in	(revision 234533)
+++ Makefile.in	(working copy)
@@ -639,12 +639,12 @@  HOST_LIB_PATH_gmp = \
 
 @if mpfr
 HOST_LIB_PATH_mpfr = \
-  $$r/$(HOST_SUBDIR)/mpfr/.libs:$$r/$(HOST_SUBDIR)/prev-mpfr/.libs:
+  $$r/$(HOST_SUBDIR)/mpfr/src/.libs:$$r/$(HOST_SUBDIR)/prev-mpfr/src/.libs:
 @endif mpfr
 
 @if mpc
 HOST_LIB_PATH_mpc = \
-  $$r/$(HOST_SUBDIR)/mpc/.libs:$$r/$(HOST_SUBDIR)/prev-mpc/.libs:
+  $$r/$(HOST_SUBDIR)/mpc/src/.libs:$$r/$(HOST_SUBDIR)/prev-mpc/src/.libs:
 @endif mpc
 
 @if isl
@@ -11299,7 +11299,7 @@  all-gmp: configure-gmp
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS)  \
 	(cd $(HOST_SUBDIR)/gmp && \
-	  $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(STAGE1_FLAGS_TO_PASS)  \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(STAGE1_FLAGS_TO_PASS) AM_CFLAGS="-DNO_ASM" \
 		$(TARGET-gmp))
 @endif gmp
 
@@ -11328,7 +11328,7 @@  all-stage1-gmp: configure-stage1-gmp
 		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
 		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
 		$(EXTRA_HOST_FLAGS)  \
-		$(STAGE1_FLAGS_TO_PASS)  \
+		$(STAGE1_FLAGS_TO_PASS) AM_CFLAGS="-DNO_ASM" \
 		TFLAGS="$(STAGE1_TFLAGS)" \
 		$(TARGET-stage1-gmp)
 
@@ -11343,7 +11343,7 @@  clean-stage1-gmp:
 	fi; \
 	cd $(HOST_SUBDIR)/gmp && \
 	$(MAKE) $(EXTRA_HOST_FLAGS)  \
-	$(STAGE1_FLAGS_TO_PASS)  clean
+	$(STAGE1_FLAGS_TO_PASS) AM_CFLAGS="-DNO_ASM" clean
 @endif gmp-bootstrap
 
 
@@ -11370,7 +11370,7 @@  all-stage2-gmp: configure-stage2-gmp
 		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
 		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
 		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
-		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  \
+		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) AM_CFLAGS="-DNO_ASM" \
 		TFLAGS="$(STAGE2_TFLAGS)" \
 		$(TARGET-stage2-gmp)
 
@@ -11384,7 +11384,7 @@  clean-stage2-gmp:
 	  $(MAKE) stage2-start; \
 	fi; \
 	cd $(HOST_SUBDIR)/gmp && \
-	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  clean
+	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) AM_CFLAGS="-DNO_ASM" clean
 @endif gmp-bootstrap
 
 
@@ -11411,7 +11411,7 @@  all-stage3-gmp: configure-stage3-gmp
 		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
 		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
 		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
-		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  \
+		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) AM_CFLAGS="-DNO_ASM" \
 		TFLAGS="$(STAGE3_TFLAGS)" \
 		$(TARGET-stage3-gmp)
 
@@ -11425,7 +11425,7 @@  clean-stage3-gmp:
 	  $(MAKE) stage3-start; \
 	fi; \
 	cd $(HOST_SUBDIR)/gmp && \
-	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  clean
+	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) AM_CFLAGS="-DNO_ASM" clean
 @endif gmp-bootstrap
 
 
@@ -11452,7 +11452,7 @@  all-stage4-gmp: configure-stage4-gmp
 		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
 		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
 		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
-		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  \
+		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) AM_CFLAGS="-DNO_ASM" \
 		TFLAGS="$(STAGE4_TFLAGS)" \
 		$(TARGET-stage4-gmp)
 
@@ -11466,7 +11466,7 @@  clean-stage4-gmp:
 	  $(MAKE) stage4-start; \
 	fi; \
 	cd $(HOST_SUBDIR)/gmp && \
-	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  clean
+	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) AM_CFLAGS="-DNO_ASM" clean
 @endif gmp-bootstrap
 
 
@@ -11493,7 +11493,7 @@  all-stageprofile-gmp: configure-stageprofile-gmp
 		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
 		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
 		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
-		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  \
+		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) AM_CFLAGS="-DNO_ASM" \
 		TFLAGS="$(STAGEprofile_TFLAGS)" \
 		$(TARGET-stageprofile-gmp)
 
@@ -11507,7 +11507,7 @@  clean-stageprofile-gmp:
 	  $(MAKE) stageprofile-start; \
 	fi; \
 	cd $(HOST_SUBDIR)/gmp && \
-	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  clean
+	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) AM_CFLAGS="-DNO_ASM" clean
 @endif gmp-bootstrap
 
 
@@ -11534,7 +11534,7 @@  all-stagefeedback-gmp: configure-stagefeedback-gmp
 		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
 		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
 		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
-		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  \
+		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) AM_CFLAGS="-DNO_ASM" \
 		TFLAGS="$(STAGEfeedback_TFLAGS)" \
 		$(TARGET-stagefeedback-gmp)
 
@@ -11548,7 +11548,7 @@  clean-stagefeedback-gmp:
 	  $(MAKE) stagefeedback-start; \
 	fi; \
 	cd $(HOST_SUBDIR)/gmp && \
-	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  clean
+	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) AM_CFLAGS="-DNO_ASM" clean
 @endif gmp-bootstrap
 
 
@@ -11566,7 +11566,7 @@  check-gmp:
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) $(EXTRA_HOST_EXPORTS) \
 	(cd $(HOST_SUBDIR)/gmp && \
-	  $(MAKE) $(FLAGS_TO_PASS)  $(EXTRA_BOOTSTRAP_FLAGS) check)
+	  $(MAKE) $(FLAGS_TO_PASS) AM_CFLAGS="-DNO_ASM" $(EXTRA_BOOTSTRAP_FLAGS) check)
 
 @endif gmp
 
@@ -11601,7 +11601,7 @@  info-gmp: \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	for flag in $(EXTRA_HOST_FLAGS) AM_CFLAGS="-DNO_ASM"; do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing info in gmp"; \
@@ -11626,7 +11626,7 @@  dvi-gmp: \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	for flag in $(EXTRA_HOST_FLAGS) AM_CFLAGS="-DNO_ASM"; do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing dvi in gmp"; \
@@ -11651,7 +11651,7 @@  pdf-gmp: \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	for flag in $(EXTRA_HOST_FLAGS) AM_CFLAGS="-DNO_ASM"; do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing pdf in gmp"; \
@@ -11676,7 +11676,7 @@  html-gmp: \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	for flag in $(EXTRA_HOST_FLAGS) AM_CFLAGS="-DNO_ASM"; do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing html in gmp"; \
@@ -11701,7 +11701,7 @@  TAGS-gmp: \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	for flag in $(EXTRA_HOST_FLAGS) AM_CFLAGS="-DNO_ASM"; do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing TAGS in gmp"; \
@@ -11727,7 +11727,7 @@  install-info-gmp: \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	for flag in $(EXTRA_HOST_FLAGS) AM_CFLAGS="-DNO_ASM"; do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing install-info in gmp"; \
@@ -11753,7 +11753,7 @@  install-pdf-gmp: \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	for flag in $(EXTRA_HOST_FLAGS) AM_CFLAGS="-DNO_ASM"; do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing install-pdf in gmp"; \
@@ -11779,7 +11779,7 @@  install-html-gmp: \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	for flag in $(EXTRA_HOST_FLAGS) AM_CFLAGS="-DNO_ASM"; do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing install-html in gmp"; \
@@ -11804,7 +11804,7 @@  installcheck-gmp: \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	for flag in $(EXTRA_HOST_FLAGS) AM_CFLAGS="-DNO_ASM"; do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing installcheck in gmp"; \
@@ -11828,7 +11828,7 @@  mostlyclean-gmp:
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	for flag in $(EXTRA_HOST_FLAGS) AM_CFLAGS="-DNO_ASM"; do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing mostlyclean in gmp"; \
@@ -11852,7 +11852,7 @@  clean-gmp:
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	for flag in $(EXTRA_HOST_FLAGS) AM_CFLAGS="-DNO_ASM"; do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing clean in gmp"; \
@@ -11876,7 +11876,7 @@  distclean-gmp:
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	for flag in $(EXTRA_HOST_FLAGS) AM_CFLAGS="-DNO_ASM"; do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing distclean in gmp"; \
@@ -11900,7 +11900,7 @@  maintainer-clean-gmp:
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS) \
-	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	for flag in $(EXTRA_HOST_FLAGS) AM_CFLAGS="-DNO_ASM"; do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
 	echo "Doing maintainer-clean in gmp"; \
Index: configure
===================================================================
--- configure	(revision 234533)
+++ configure	(working copy)
@@ -5570,16 +5570,9 @@  if test "x$with_mpfr_lib" != x; then
   gmplibs="-L$with_mpfr_lib $gmplibs"
 fi
 if test "x$with_mpfr$with_mpfr_include$with_mpfr_lib" = x && test -d ${srcdir}/mpfr; then
-  # MPFR v3.1.0 moved the sources into a src sub-directory.
-  if test -d ${srcdir}/mpfr/src; then
-    gmplibs='-L$$r/$(HOST_SUBDIR)/mpfr/src/'"$lt_cv_objdir $gmplibs"
-    gmpinc='-I$$r/$(HOST_SUBDIR)/mpfr/src -I$$s/mpfr/src '"$gmpinc"
-    extra_mpc_mpfr_configure_flags='--with-mpfr-include=$$s/mpfr/src --with-mpfr-lib=$$r/$(HOST_SUBDIR)/mpfr/src/'"$lt_cv_objdir"
-  else
-    gmplibs='-L$$r/$(HOST_SUBDIR)/mpfr/'"$lt_cv_objdir $gmplibs"
-    gmpinc='-I$$r/$(HOST_SUBDIR)/mpfr -I$$s/mpfr '"$gmpinc"
-    extra_mpc_mpfr_configure_flags='--with-mpfr-include=$$s/mpfr --with-mpfr-lib=$$r/$(HOST_SUBDIR)/mpfr/'"$lt_cv_objdir"
-  fi
+  gmplibs='-L$$r/$(HOST_SUBDIR)/mpfr/src/'"$lt_cv_objdir $gmplibs"
+  gmpinc='-I$$r/$(HOST_SUBDIR)/mpfr/src -I$$s/mpfr/src '"$gmpinc"
+  extra_mpc_mpfr_configure_flags='--with-mpfr-include=$$s/mpfr/src --with-mpfr-lib=$$r/$(HOST_SUBDIR)/mpfr/src/'"$lt_cv_objdir"
   # Do not test the mpfr version.  Assume that it is sufficient, since
   # it is in the source tree, and the library has not been built yet
   # but it would be included on the link line in the version check below
Index: configure.ac
===================================================================
--- configure.ac	(revision 234533)
+++ configure.ac	(working copy)
@@ -1550,16 +1550,9 @@  if test "x$with_mpfr_lib" != x; then
   gmplibs="-L$with_mpfr_lib $gmplibs"
 fi
 if test "x$with_mpfr$with_mpfr_include$with_mpfr_lib" = x && test -d ${srcdir}/mpfr; then
-  # MPFR v3.1.0 moved the sources into a src sub-directory.
-  if test -d ${srcdir}/mpfr/src; then
-    gmplibs='-L$$r/$(HOST_SUBDIR)/mpfr/src/'"$lt_cv_objdir $gmplibs"
-    gmpinc='-I$$r/$(HOST_SUBDIR)/mpfr/src -I$$s/mpfr/src '"$gmpinc"
-    extra_mpc_mpfr_configure_flags='--with-mpfr-include=$$s/mpfr/src --with-mpfr-lib=$$r/$(HOST_SUBDIR)/mpfr/src/'"$lt_cv_objdir"
-  else
-    gmplibs='-L$$r/$(HOST_SUBDIR)/mpfr/'"$lt_cv_objdir $gmplibs"
-    gmpinc='-I$$r/$(HOST_SUBDIR)/mpfr -I$$s/mpfr '"$gmpinc"
-    extra_mpc_mpfr_configure_flags='--with-mpfr-include=$$s/mpfr --with-mpfr-lib=$$r/$(HOST_SUBDIR)/mpfr/'"$lt_cv_objdir"
-  fi
+  gmplibs='-L$$r/$(HOST_SUBDIR)/mpfr/src/'"$lt_cv_objdir $gmplibs"
+  gmpinc='-I$$r/$(HOST_SUBDIR)/mpfr/src -I$$s/mpfr/src '"$gmpinc"
+  extra_mpc_mpfr_configure_flags='--with-mpfr-include=$$s/mpfr/src --with-mpfr-lib=$$r/$(HOST_SUBDIR)/mpfr/src/'"$lt_cv_objdir"
   # Do not test the mpfr version.  Assume that it is sufficient, since
   # it is in the source tree, and the library has not been built yet
   # but it would be included on the link line in the version check below
Index: contrib/download_prerequisites
===================================================================
--- contrib/download_prerequisites	(revision 234533)
+++ contrib/download_prerequisites	(working copy)
@@ -30,9 +30,9 @@  if [ ! -e gcc/BASE-VER ] ; then
 fi
 
 # Necessary to build GCC.
-MPFR=mpfr-2.4.2
-GMP=gmp-4.3.2
-MPC=mpc-0.8.1
+MPFR=mpfr-3.1.4
+GMP=gmp-6.1.0
+MPC=mpc-1.0.3
 
 wget ftp://gcc.gnu.org/pub/gcc/infrastructure/$MPFR.tar.bz2 || exit 1
 tar xjf $MPFR.tar.bz2 || exit 1
Index: gcc/doc/install.texi
===================================================================
--- gcc/doc/install.texi	(revision 234533)
+++ gcc/doc/install.texi	(working copy)
@@ -354,7 +354,7 @@  support libraries then using those packages may be
 install the libraries.
 
 @table @asis
-@item GNU Multiple Precision Library (GMP) version 4.3.2 (or later)
+@item GNU Multiple Precision Library (GMP) version 6.1.0 (or later)
 
 Necessary to build GCC@.  If a GMP source distribution is found in a
 subdirectory of your GCC sources named @file{gmp}, it will be built
@@ -363,7 +363,7 @@  is not in your library search path, you will have
 @option{--with-gmp} configure option.  See also @option{--with-gmp-lib}
 and @option{--with-gmp-include}.
 
-@item MPFR Library version 2.4.2 (or later)
+@item MPFR Library version 3.1.4 (or later)
 
 Necessary to build GCC@.  It can be downloaded from
 @uref{http://www.mpfr.org/}.  If an MPFR source distribution is found
@@ -373,7 +373,7 @@  but it is not in your default library search path,
 @option{--with-mpfr} configure option should be used.  See also
 @option{--with-mpfr-lib} and @option{--with-mpfr-include}.
 
-@item MPC Library version 0.8.1 (or later)
+@item MPC Library version 1.0.3 (or later)
 
 Necessary to build GCC@.  It can be downloaded from
 @uref{http://www.multiprecision.org/}.  If an MPC source distribution