This post will be edited a few times I guess.

I try to publically sum up all stuff we need to get a RosBE with a working amd64 compiler.

GCC

First we need plugin support inside GCC. This seems to be default on *nix, but Windows has a special hackish implementation for that.

To use it we need to add –enable-plugin to the configure parameter list of both the 32 bit host and 64 bit guest cross compiler.

We need a newer GCC OR fix two lines to make plugin support build at all:

/gcc/c/Make-lang.in

— $(INSTALL_DATA) cc1$(exeext).a $(DESTDIR)/$(plugin_resourcesdir)/cc1$(exeext).a
++ $(INSTALL_DATA) cc1$(exeext).a $(DESTDIR)$(plugin_resourcesdir)/cc1$(exeext).a

/gcc/cp/Make-lang.in

— $(INSTALL_DATA) cc1plus$(exeext).a $(DESTDIR)/$(plugin_resourcesdir)/cc1plus$(exeext).a
++ $(INSTALL_DATA) cc1plus$(exeext).a $(DESTDIR)$(plugin_resourcesdir)/cc1plus$(exeext).a 

( Already fixed upstream https://gcc.gnu.org/git?p=gcc.git;a=blob;f=gcc/c/Make-lang.in;h=a1cdee87264bcccffd3806f1c82be1ece3570723;hb=HEAD#l168 )

To get GMP in a plugin supportive manner I decided to build it twice! Once GCC does that because gmp is in the source tarball and once for the hackish plugin support!

Current buildtoolchain-mingw32.sh https://pastiebin.com/60b7892f07a99
Current buildtoolchain-mingw32-amd64.sh https://pastiebin.com/60b7894e66625

Binutils

Newer one or applying that patch is mandatory: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=d039200a7ee8ac170afbdc3b987af553c07fb6a3

Ninja

Revert https://github.com/ninja-build/ninja/commit/a3a5d60622eb7330b8d82ff6620d28e3b90c6848