two changes are made:
1. always enable flag_pic for fdpic. without this, various ICE and bad
codegen was observed.
2. allow sibcall for fdpic; it's valid since r12 is call-clobbered.
the behavior by bfd/ld matched the ABI document but was the opposite
of the kernel's interpretation and opposite of how ld treats the flag
on every other target using fdpic.
see this thread for details:
https://sourceware.org/ml/binutils/2015-09/msg00186.html
binutils-2.25.1/0003-shemuls.diff is needed to include the existing
fdpic support in the build when targeting sh*-linux-* rather than
tucking it away under sh*-uclinux-* only
gcc-5.2.0/0007-fdpic.diff is based on the original abandoned fdpic
patch 3/3 sent to the gcc list in 2010, updated for modern gcc and
with the uclinux dependencies removed. the original is here:
https://gcc.gnu.org/ml/gcc-patches/2010-08/msg01464.html
gcc-5.2.0/0001-musl.diff has been updated to use the right musl
dynamic linker pathname for fdpic so that musl-specific changes can be
avoided in the main fdpic patch.
at present, additional patches to musl are needed to produce working
binaries for the target.
previously the stage0 gcc was installed to the output location during
the build, then replaced later by the final gcc. this violates the
principles of make and simply wastes time. the stage0 gcc is usable
in-place without installing it, so we can simply do that instead.