2. patch everything

Everything doesn't need patching, but when you're playing with musl, you'll
quickly realise how heavily softwares rely on the GNU libc.

GregorR did all the dirty job here, and provide
patches for use
with cross-compilers to work with musl. Check what's in, and grab those you
might need.

The 1.1.0 version of pcc require some patching too, in order to work flawlessly
with an alternative libc. It seems to be fixed in 1.2.0 (DEVEL version), if
you're interrested. They fix the configure script to accept musl based
targets, and fix the default library pass of the compiler.

3,4,5,6. build everything

For this part, just check the appropriate sections in the original script. You
might want to enable shared libraries, or avoid compiling everything statically,
so tweak it however you want.

For PCC, the PCCINCDIR and PCCLIBDIR are important, as they will tell the
compiler where are the PCC libraries. The --with-incdir and --with-libdir
parameters are used to tell the compiler where to search for default libraries,
so make sure you set them properly.

Enjoy!

You compiler should be ready to go! You can test it by running the following
snippet:

For the sake of the experience, I also built a gcc cross-compiler using the same
method, and tested both compilers on the libressl
code base. The packages are simply tar.bz2 archives of libressl installed on a
chroot (so there are only the libressl files):