Summary: | ld/mips: can no longer build libstdc++ (gcc 4.8/4.9) | ||
---|---|---|---|
Product: | binutils | Reporter: | Manuel Lauss <manuel.lauss> |
Component: | ld | Assignee: | Matthew Fortune <matthew.fortune> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | aaro.koskinen, matthew.fortune |
Priority: | P2 | ||
Version: | 2.25 | ||
Target Milestone: | --- | ||
Host: | Target: | mipsel-softfloat-linux-gnu | |
Build: | Last reconfirmed: |
Description
Manuel Lauss
2014-08-01 11:36:26 UTC
started with commit 351cdf24d223290b15fa991e5052ec9e9bd1e284 ( [MIPS] Implement O32 FPXX, FP64 and FP64A ABI extensions) Reverting this one lets me cross-build gcc again AND also build a mips32 kernel! native builds are also affected: for example gcc-4.9.1 built natively fails with libtool: link: mipsel-softfloat-linux-gnu-gcc -shared .libs/lto-plugin.o -Wl,--as-needed -static-libgcc -Wl,-O1 ../libiberty/pic/libiberty.a -Wl,-soname -Wl,liblto_plugin.so.0 -o .libs/liblto_plugin.so.0.0.0 /usr/lib/gcc/mipsel-softfloat-linux-gnu/4.9.1/../../../../mipsel-softfloat-linux-gnu/bin/ld: error: .libs/lto-plugin.o: relocation 4 against `a local symbol' can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/mipsel-softfloat-linux-gnu/4.9.1/../../../../mipsel-softfloat-linux-gnu/bin/ld: error: .libs/lto-plugin.o: relocation 5 against `a local symbol' can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/mipsel-softfloat-linux-gnu/4.9.1/../../../../mipsel-softfloat-linux-gnu/bin/ld: error: .libs/lto-plugin.o: relocation 5 against `a local symbol' can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/mipsel-softfloat-linux-gnu/4.9.1/../../../../mipsel-softfloat-linux-gnu/bin/ld: error: .libs/lto-plugin.o: relocation 4 against `a local symbol' can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/mipsel-softfloat-linux-gnu/4.9.1/../../../../mipsel-softfloat-linux-gnu/bin/ld: error: .libs/lto-plugin.o: relocation 5 against `stderr' can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/mipsel-softfloat-linux-gnu/4.9.1/../../../../mipsel-softfloat-linux-gnu/bin/ld: error: non-dynamic relocations refer to dynamic symbol stderr and so on. Again, reverting the above mentioned commit fixes everything. I get similar errors with release 2.25 binutils. Trying to cross-build MIPS GCC configured with --with-float=soft fails miserably. With hard float there is no issues (or binutils 2.24 with soft float). Apparently 2.25 binutils require some additional flags which GCC 4.9 fails to pass? Is there any simple workaround for this? (In reply to Aaro Koskinen from comment #3) > I get similar errors with release 2.25 binutils. Trying to cross-build MIPS > GCC configured with --with-float=soft fails miserably. With hard float there > is no issues (or binutils 2.24 with soft float). Apparently 2.25 binutils > require some additional flags which GCC 4.9 fails to pass? > > Is there any simple workaround for this? This is a compiler driver issue. The LD failures relating to relocations are somewhat strange but I believe they are not the important part here. The ABI problems from the assembler warnings are the root cause. I've put together a backport of minimal GCC driver changes for the GCC 4.9 branch and that is pretty much the only way to resolve this. The new floating-point ABI checks in the assembler unfortunately couldn't be seamless for everything and soft-float is the case that takes most of the pain. With the GCC patch in place I managed to build a GCC 4.9 (branch) + binutils 2.25 (branch) soft-float toolchain. I'll post the patch to GCC at some point tomorrow and try to remember and update this ticket with a link. The patch should apply cleanly to any GCC 4.9 release so will have to be ported by a distribution maintainer if anyone wants any of the already released GCC 4.9.x compilers alongside binutils 2.25 onwards. I will look at a similar patch for GCC 4.8 if there is sufficient call for that alongside binutils 2.25. Sorry for not getting to the GCC 4.9 patch sooner, I knew about it and never quite got to doing it. (In reply to Matthew Fortune from comment #4) > With the GCC patch in place I managed to build a GCC 4.9 (branch) + binutils > 2.25 (branch) soft-float toolchain. I'll post the patch to GCC at some point > tomorrow and try to remember and update this ticket with a link. The patch > should apply cleanly to any GCC 4.9 release so will have to be ported by a > distribution maintainer if anyone wants any of the already released GCC > 4.9.x compilers alongside binutils 2.25 onwards. I don't see any patch related to this in GCC 4.9 branch... > I will look at a similar patch for GCC 4.8 if there is sufficient call for > that alongside binutils 2.25. Also this would be nice... I'm marking this a s "fixed" since gcc-4.9 and gcc-5 branch and their libstdc++ build just fine and have been for over 8 months now. |