-
Notifications
You must be signed in to change notification settings - Fork 70
Description
since 7620293 , when we started building stage3 gcc with C++ support, so we can build gcc630 during stage1, instead of building gcc474 first as an intermediate step.
the issue is caused by either the specific binutils version (2.27) used by these 2 distros, or by defaulting to PIE. the effect is that the libstdc++.a created during gcc3 build is broken.
so compiling any C++ code with the stage0 compiler fails.
gcc630 will fail during the build with the message
configure: error: cannot compute sizeof (long long)
config.log reveals more details:
configure:6084: g++ -o conftest -g0 -static conftest.cpp >&5
/bin/ld: eh_personality.o: access beyond end of merged section (1928)
bin/ld: /opt/gcc3/bin/../lib/gcc/x86_64-unknown-linux-gnu/3.4.6/../../../libstdc++.a(eh_personality.o)(.debug_info+0x6b4): reloc against `.debug_str': error 2
/bin/ld: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status
build log of gcc3 is available here: http://true.stallman.faith/PJKYHn.txt
possible solutions:
we could trie to add -Wl,-no-pie to LDFLAGS or LDFLAGS_FOR_TARGET
https://github.com/ldc-developers/ldc/issues/1618
Ubuntu 16.10 linker failures due to PIE by default (relocation R_X86_64_32S … can not be used) · Issue #1618 · ldc-developers/ldc · GitHub
<quote>Btw, I can confirm that when compiling with -relocation-model=pic all issues are gone.</quote>
it might also work by just add -fPIC to CFLAGS_FOR_TARGET
as a temporary workaround until it is fixed, it should be sufficient to just build gcc474 when stage1 fails, and then continue building stage1. gcc474 will then be used to compile gcc630, which should work.