I now get this during bootstrap on Solaris x86 using the native linker (/usr/ccs/bin/ld): ld: fatal: unwind table: file /u01/var/tmp/gcc_trunk_svn/gcc_20070817/./gcc/amd64/crtend.o: section .eh_frame: bad cie version 0: offset 0x0 collect2: ld returned 1 exit status gmake[5]: *** [libgcc_s.so] Error 1 gmake[5]: Leaving directory `/u01/var/tmp/gcc_trunk_svn/gcc_20070817/i386-pc-solaris2.11/amd64/libgcc' Let me know if you need more information. It seems to occur when linking the 64bit libgcc. Brett Albertson
Confirmed on i386-pc-solaris2.10. This is a mainline regression. A reghunt revealed that this patch 2007-08-06 H.J. Lu <hongjiu.lu@intel.com> Daniel Jacobowitz <dan@codesourcery.com> PR target/31868 * config.gcc (x86_64-*-freebsd*): Add i386/t-crtstuff to tmake_file. (x86_64-*-netbsd*): Likewise. (x86_64-*-linux*): Likewise. (x86_64-*-kfreebsd*-gnu): Likewise. (x86_64-*-knetbsd*-gnu): Likewise. (i[34567]86-*-solaris2.1[0-9]*): Likewise. is the culprit: running elfdump on the amd64 crtend.o before and after the patch, I find (before): Unwind Section: .eh_frame CIE: [0x00000000] length: 0x00 cieid: 0 version: 0 augstring: `' codealign: 0x0 dataalign: 0 retaddr: 0 vs. (after): Unwind Section: .eh_frame FDE: [0x00000000] length: 0x00 cieptr: 0x18 initloc: 0x00000000 addrrange: 0x0000 Auxiliary vals: CIE: [0x00000004] length: 0x18 cieid: 0 version: 1 augstring: `zR' codealign: 0x1 dataalign: -8 retaddr: 16 So the linker seems to be right to complain about this. Rainer
As indicated in http://gcc.gnu.org/ml/gcc-patches/2007-08/msg00512.html there is at least one person has bootstrapped gcc successfully on i386-pc-solaris2.10.
(In reply to comment #2) Something changed and it is now working for me, but this did exist on mainline for at least some period of time. Rainer, are you still seeing this behavior? Brett
Subject: Re: [4.3 regression] on bootstrap getting section .eh_frame: bad cie version 0: offset 0x0 brett dot albertson at stratech dot com writes: > Something changed and it is now working for me, but this did exist on mainline > for at least some period of time. Rainer, are you still seeing this behavior? I haven't tried a newer tree (> 20070903) yet. A difference might be that Art uses GNU ld (he doesn't state so, though) while Brett and I use Sun ld. Rainer
It could be caused by bugs in assembler/linker on Solaris.
Subject: Re: [4.3 regression] on bootstrap getting section .eh_frame: bad cie version 0: offset 0x0 hjl at lucon dot org writes: > It could be caused by bugs in assembler/linker on Solaris. The assembler in question is gas 2.15, and the linker check seems to be completely deliberate. The error is issued by libld, whose source can be browsed at opensolaris.org: http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/sgs/libld/common/unwind.amd.c around line 396. The old crtend.o had CIE version 1 as expected, the new one has version 0. Rainer
Binutils 2.15 is very old. Can you try binutils 2.18?
Created attachment 14188 [details] crtend.s without -fno-asynchronous-unwind-tables
Created attachment 14189 [details] crtend.s with -fno-asynchronous-unwind-tables
Subject: Re: [4.3 regression] on bootstrap getting section .eh_frame: bad cie version 0: offset 0x0 hjl at lucon dot org writes: > Binutils 2.15 is very old. Can you try binutils 2.18? It doesn't make a difference: although the object files are not completely identical, the problematic .eh_frame section stays the same. I've uploaded the output with -save-temps before and after adding -fno-asynchronous-unwind-tables. The after version contains the empty .eh_frame section with cie version 0 which causes ld to complain. Rainer
.eh_frame section in the new crtend.S only has 4 byte: [ 7] .eh_frame X86_64_UNWIND 0000000000000000 000000b8 0000000000000004 0000000000000000 A 0 0 4 which is the zero terminator: bash-3.2$ readelf -wf crtend.o The section .eh_frame contains: 00000000 ZERO terminator bash-3.2$ Sun linker doesn't properly handle ZERO terminator in .eh_frame. It looks like a Sun linker bug to me. BTW, did your elfdump report vs. (after): Unwind Section: .eh_frame FDE: [0x00000000] length: 0x00 cieptr: 0x18 initloc: 0x00000000 addrrange: 0x0000 Auxiliary vals: CIE: [0x00000004] length: 0x18 cieid: 0 version: 1 augstring: `zR' codealign: 0x1 dataalign: -8 retaddr: 16 It doesn't look like .eh_frame in the new crtend.o at all. That may be a bug in your elfdump.
Bug hit trying to compile GCC 4.3.0 using SUN ld. If I use the gnu ld (2.18), compiler builds fine, but then I have problems with tools like gdb and such, specially with shared libraries. So, no luck. Post a link to this bug to OpenSolaris linking mailing list.
Update milestone after 4.3.0 release.
Bug also hit when installing 4.2.4.
i386-pc-solaris2.10 has the same problem.
4.3.1 is being released, adjusting target milestone.
This bug is fixed in opensolaris: http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6685125 Fixed in revision 6388: http://cvs.opensolaris.org/source/search?q=&defs=&refs=&path=&hist=6388&project=%2Fonnv We have filed case #65952072 with Sun to get this backported to Solaris 10.
*** Bug 36496 has been marked as a duplicate of this bug. ***
ping... gcc 4.2.3 works well, gcc 4.2.4/4.3.0/4.3.1 works failed. i386-pc-solaris2.10 gas 2.18 + sun ld
4.3.2 is released, changing milestones to 4.3.3.
Subject: Re: [4.3/4.4 regression] on bootstrap getting section .eh_frame: bad cie version 0: offset 0x0 FTR: I've long been using this patch as a workaround until the neccessary Sun ld patch is available: Index: gcc/config.gcc =================================================================== --- gcc/config.gcc (revision 140759) +++ gcc/config.gcc (working copy) @@ -1205,7 +1205,10 @@ i[34567]86-*-solaris2*) *-*-solaris2.1[0-9]*) tm_file="${tm_file} i386/x86-64.h i386/sol2-10.h" tm_defines="${tm_defines} TARGET_BI_ARCH=1" - tmake_file="$tmake_file i386/t-crtstuff i386/t-sol2-10" + tmake_file="$tmake_file i386/t-sol2-10" + if test x$gnu_ld = xyes; then + tmake_file="$tmake_file i386/t-crtstuff" + fi need_64bit_hwint=yes case X"${with_cpu}" in Xgeneric|Xcore2|Xnocona|Xx86-64|Xamdfam10|Xbarcelona|Xk8|Xopteron|Xathlon64|Xathlon-fx)
> FTR: I've long been using this patch as a workaround until the neccessary > Sun ld patch is available: Ah, this is helpful, thanks.
to Rainer Orth. when apply your patch on gcc 4.3.2 release, cause PR37777.
works ok on gcc 4.3.2 --- config.gcc.4.3.2.old Thu Oct 9 18:51:26 2008 +++ config.gcc.4.3.2.new Thu Oct 9 18:51:26 2008 @@ -1289,7 +1289,7 @@ *-*-solaris2.1[0-9]*) tm_file="${tm_file} i386/x86-64.h i386/sol2-10.h" tm_defines="${tm_defines} TARGET_BI_ARCH=1" - tmake_file="$tmake_file i386/t-crtstuff i386/t-sol2-10" + tmake_file="$tmake_file i386/t-sol2-10" need_64bit_hwint=yes # FIXME: -m64 for i[34567]86-*-* should be allowed just # like -m32 for x86_64-*-*.
> to Rainer Orth. > when apply your patch on gcc 4.3.2 release, cause PR37777. Are you really sure? Please retry and close the PR otherwise.
> We have filed case #65952072 with Sun to get this backported to Solaris 10. Do you have any news about this?
works well on gcc 4.3.2 + patch. I don't build libgcc_s.so. gas 2.18 + gmp 4.2.4 + mpfr 2.3.2. Configured with: ../src/configure --prefix=/opt/gcc-4.3.2 --with-gmp=/opt/gcc-4.3.2 --with-mpfr=/opt/gcc-4.3.2 --with-as=/usr/local/bin/as --with-gnu-as --with-ld=/usr/ccs/bin/ld --without-gnu-ld --enable-languages=c,c++ --disable-shared --disable-nls --with-cpu=generic --build=i386-pc-solaris2.10 --- config.gcc.4.3.2.old Thu Oct 9 18:51:26 2008 +++ config.gcc.4.3.2.new Thu Oct 9 18:51:26 2008 @@ -1289,7 +1289,7 @@ *-*-solaris2.1[0-9]*) tm_file="${tm_file} i386/x86-64.h i386/sol2-10.h" tm_defines="${tm_defines} TARGET_BI_ARCH=1" - tmake_file="$tmake_file i386/t-crtstuff i386/t-sol2-10" + tmake_file="$tmake_file i386/t-sol2-10" need_64bit_hwint=yes # FIXME: -m64 for i[34567]86-*-* should be allowed just # like -m32 for x86_64-*-*.
> works well on gcc 4.3.2 + patch. Thanks but this patch is not suitable for the branch, only Rainer's is. And you didn't say whether you can reproduce PR 37777 so I'm closing it.
Subject: Re: [4.3/4.4 regression] on bootstrap getting section .eh_frame: bad cie version 0: offset 0x0 I've just formally submitted my patch http://gcc.gnu.org/ml/gcc-patches/2008-10/msg00441.html with some suggestions how a complete fix would look like if necessary. Rainer
Subject: Bug 33100 Author: ro Date: Thu Nov 6 15:41:52 2008 New Revision: 141647 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=141647 Log: PR bootstrap/33100 * config.gcc (i[34567]86-*-solaris2*): Include i386/t-crtstuff only with GNU ld. Modified: branches/gcc-4_2-branch/gcc/ChangeLog branches/gcc-4_2-branch/gcc/config.gcc
Subject: Re: [4.3/4.4 regression] on bootstrap getting section .eh_frame: bad cie version 0: offset 0x0 Fixed for 4.2.5.
Subject: Bug 33100 Author: ro Date: Thu Nov 20 17:09:53 2008 New Revision: 142049 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=142049 Log: gcc: PR bootstrap/33100 * config.gcc (i[34567]86-*-solaris2*): Don't include i386/t-crtstuff here. Move extra_parts, i386/t-sol2 in tmake_file to libgcc/config.host. * config/i386/t-sol2: Move to libgcc/config/i386. libgcc: PR bootstrap/33100 * configure.ac (i?86-*-solaris2.1[0-9]*): Only include i386/t-crtstuff if linker supports ZERO terminator unwind entries. * configure: Regenerate. * config.host (i[34567]86-*-solaris2*): Move i386/t-sol2 in tmake_file here from gcc/config.gcc. Move extra_parts here from gcc/config.gcc. * config/i386/t-sol2: Move here from gcc/config/i386. Use gcc_srcdir instead of srcdir. Added: branches/gcc-4_3-branch/libgcc/config/i386/t-sol2 - copied, changed from r142012, branches/gcc-4_3-branch/gcc/config/i386/t-sol2 Removed: branches/gcc-4_3-branch/gcc/config/i386/t-sol2 Modified: branches/gcc-4_3-branch/gcc/ChangeLog branches/gcc-4_3-branch/gcc/config.gcc branches/gcc-4_3-branch/libgcc/ChangeLog branches/gcc-4_3-branch/libgcc/config.host branches/gcc-4_3-branch/libgcc/configure branches/gcc-4_3-branch/libgcc/configure.ac
Subject: Bug 33100 Author: ro Date: Thu Nov 20 17:13:01 2008 New Revision: 142050 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=142050 Log: gcc: PR bootstrap/33100 * config.gcc (i[34567]86-*-solaris2*): Don't include i386/t-crtstuff here. Move extra_parts, i386/t-sol2 in tmake_file to libgcc/config.host. * config/i386/t-sol2: Move to libgcc/config/i386. libgcc: PR bootstrap/33100 * configure.ac (i?86-*-solaris2.1[0-9]*): Only include i386/t-crtstuff if linker supports ZERO terminator unwind entries. * configure: Regenerate. * config.host (i[34567]86-*-solaris2*): Move i386/t-sol2 in tmake_file here from gcc/config.gcc. Move extra_parts here from gcc/config.gcc. * config/i386/t-sol2: Move here from gcc/config/i386. Use gcc_srcdir instead of srcdir. Added: trunk/libgcc/config/i386/t-sol2 - copied, changed from r142008, trunk/gcc/config/i386/t-sol2 Removed: trunk/gcc/config/i386/t-sol2 Modified: trunk/gcc/ChangeLog trunk/gcc/config.gcc trunk/libgcc/ChangeLog trunk/libgcc/config.host trunk/libgcc/configure trunk/libgcc/configure.ac
Subject: Re: [4.3/4.4 regression] on bootstrap getting section .eh_frame: bad cie version 0: offset 0x0 Fixed for 4.3.3, 4.4.0: http://gcc.gnu.org/ml/gcc-patches/2008-11/msg00990.html
Fixed for all active release branches.
(In reply to comment #26) > > We have filed case #65952072 with Sun to get this backported to Solaris 10. > > Do you have any news about this? Sun just released patch 139574-03 for SPARC and 139575-03 for x86. We've built gcc-4.2.4 with the x86 patch and it resolved the issue for us.
*** Bug 36356 has been marked as a duplicate of this bug. ***
*** Bug 36330 has been marked as a duplicate of this bug. ***