forward-ported from the now-removed 4.4.10 patch, needed to fix#8,
spurious dependency on host elf.h header. I checked x86 and mips which
seem to be the only archs with archscripts rules, and these rules have
nothing to do with building headers, so omitting them should still be
safe.
this is binutils issue 23825, but it's caused by gcc using local-exec
model rather than initial-exec model with the intent of making
binutils generate copy relocations. this is harmful, unnecessary, and
not presently supported by musl (and probably should never be). patch
taken from https://github.com/riscv/riscv-gcc/pull/118.
new patch: 0017-c++-abi-break.diff fixes a C++ ABI break regression.
0010-static-pie-support.diff was removed as it doesn't apply anymore,
and forward-porting it requires arcane knowledge of GCC details.
the patches 0018 and 0019 have been copied from GCC 7.3.0. the static
pie patch from GCC 6.4.0, renumbered 0020, depends on the reversions
they make.
the initial-exec tls model is not valid in any code that might be
dynamically loaded. it usually happens to work on glibc because glibc
reserves some static tls space for late-loaded libraries that need it,
but if it's already been exhausted that will fail. musl does not
support this hack at all, and it's not valid for gcc target libs to be
doing it anywhere, so patch it out entirely rather than just for musl.
these are not complete/correct in that they do not account for ABI
variants (softfloat and coldfire fpu) in the dynamic linker name, but
I was unable to get gcc's configure to accept --with-float=soft on
m68k to test softfloat and begin figuring out how to do the spec
logic. at some point this needs to be figured out and completed, but
at least the default ABI is available in mcm now.
GCC 6.4.0 has one big advantage over 6.3.0: it is shipped as .tar.xz,
shaving 30 MB from its download size, and also considerably speeding
up the extraction process.
All patches are copies of the GCC 6.3.0 ones, except
0004-posix_memalign.diff which was rebased to apply cleanly.
0014-ubsan-empty-string-fix.diff was removed, since it was upstreamed.
the linker was wrongly leaving dynamic relocations for GD-model TLS
defined in the main program when linking the main program as PIE. this
was only suboptimal for dynamic pie, but for static pie it resulted in
runtime failure since there is no dynamic linker to resolve the DTPMOD
reference.
this has been reported as binutils bug #22570.
this patch breaks powerpc64 builds and is not necessary to produce a
working 32-bit powerpc toolchain. it seems like it may be useful for
reducing libgcc-internal bloat, but it can be reintroduced later after
it's fixed, if desired.
upstream fix was slightly too late to make it into the release. patch
was not included in mcm for previous binutils versions because it
depends on new upstream infrastructure. now gc-sections should be safe
to use on sh.
commit 23d6f66966 introduced this
regression as a failure to backport part of the gas testsuite diff
from binutils master to 2.25.1 where the file being patched had a
trivial difference. I'm not sure how this went unnoticed at the time
it was committed.
patch set consists of:
0001 static pie support (--no-dynamic-linker)
0006 avoid erroring out the build when docs can't be built
0007 add sh symbol@PCREL support to gas
example configuration is added to config.mak.dist too.