Patchwork gcc is broken on i386 FreeBSD due to binutil upgrade

login
register
mail settings
Submitter Steve Kargl
Date Feb. 21, 2011, 6:56 a.m.
Message ID <20110221065649.GA58175@troutmask.apl.washington.edu>
Download mbox | patch
Permalink /patch/83779/
State New
Headers show

Comments

Steve Kargl - Feb. 21, 2011, 6:56 a.m.
FreeBSD updated its ancient version of in-system binutils
to 2.17.  In doing so, an assert is firing in ld.  The 
problem was addressed in the in FreeBSD's ancient gcc with 
this commit

--------------------------------------------------------------
laptop:root[211] svn log -r 209294 | more
------------------------------------------------------------------------
r209294 | kib | 2010-06-18 04:09:51 -0700 (Fri, 18 Jun 2010) | 16 lines

Often reported issue with newer ld is:
error in /usr/lib/crtendS.o(.eh_frame); no .eh_frame_hdr table will be created.

The issue is that crtend is compiled with unwind table, and also it
places the special CIE into the .eh_frame indicating the end of section,
that is located before generated unwind table. New ld has assertion that
verifies that closing CIE is indeed the last CIE, causing the crypting
message to be issued, and refusing to generate dwarf unwind.

Add -fno-asynchronous-unwind-tables to disable unwind table generation
for crtbegin/crtend. While there, disable omitting the frame pointer [1].


This patch fixes the issue for GCC trunk on i686-*-freebsd.


2011-02-20  Steven G. Kargl  <kargl@gcc.gnu.org>

	* gcc/config.gcc:  Include i386/t-crtstuff in the building of crtend.o
Richard Guenther - Feb. 21, 2011, 10:09 a.m.
On Mon, Feb 21, 2011 at 7:56 AM, Steve Kargl
<sgk@troutmask.apl.washington.edu> wrote:
> FreeBSD updated its ancient version of in-system binutils
> to 2.17.

Wheeee!  Updating from ancient to old!

;)

Richard.

>  In doing so, an assert is firing in ld.  The
> problem was addressed in the in FreeBSD's ancient gcc with
> this commit
>
> --------------------------------------------------------------
> laptop:root[211] svn log -r 209294 | more
> ------------------------------------------------------------------------
> r209294 | kib | 2010-06-18 04:09:51 -0700 (Fri, 18 Jun 2010) | 16 lines
>
> Often reported issue with newer ld is:
> error in /usr/lib/crtendS.o(.eh_frame); no .eh_frame_hdr table will be created.
>
> The issue is that crtend is compiled with unwind table, and also it
> places the special CIE into the .eh_frame indicating the end of section,
> that is located before generated unwind table. New ld has assertion that
> verifies that closing CIE is indeed the last CIE, causing the crypting
> message to be issued, and refusing to generate dwarf unwind.
>
> Add -fno-asynchronous-unwind-tables to disable unwind table generation
> for crtbegin/crtend. While there, disable omitting the frame pointer [1].
>
>
> This patch fixes the issue for GCC trunk on i686-*-freebsd.
>
>
> 2011-02-20  Steven G. Kargl  <kargl@gcc.gnu.org>
>
>        * gcc/config.gcc:  Include i386/t-crtstuff in the building of crtend.o
>
> --
> Steve
>
Steve Kargl - Feb. 21, 2011, 4:04 p.m.
On Mon, Feb 21, 2011 at 11:09:13AM +0100, Richard Guenther wrote:
> On Mon, Feb 21, 2011 at 7:56 AM, Steve Kargl
> <sgk@troutmask.apl.washington.edu> wrote:
> > FreeBSD updated its ancient version of in-system binutils
> > to 2.17.
> 
> Wheeee!  Updating from ancient to old!
> 
> ;)
> 

Don't want to start a license debate, but it is
ancient GPL2 to newest GPL2 code. ;-)
Gerald Pfeifer - April 2, 2011, 11:41 p.m.
On Mon, 21 Feb 2011, Richard Guenther wrote:
>> 2011-02-20  Steven G. Kargl  <kargl@gcc.gnu.org>
>>
>>        * gcc/config.gcc:  Include i386/t-crtstuff in the building of crtend.o
> Wheeee!  Updating from ancient to old!

Yes, GPLv3 and the way FreeBSD is handling it are unfortunate.

In any case, lang/gcc45 and other FreeBSD ports I maintain use binutils 
2.21, but for the sake of the system compiler or some building GCC from 
scratch, can one of you guys approve Steven's patch for HEAD, 4.6 and
4.5?

Gerald
Loren J. Rittle - April 4, 2011, 3:01 p.m.
I really thought I already approved this patch when Steve pinged me
(off-list) in Feb.  Approved. -Loren

On Sat, Apr 2, 2011 at 6:41 PM, Gerald Pfeifer <gerald@pfeifer.com> wrote:
> On Mon, 21 Feb 2011, Richard Guenther wrote:
>>> 2011-02-20  Steven G. Kargl  <kargl@gcc.gnu.org>
>>>
>>>        * gcc/config.gcc:  Include i386/t-crtstuff in the building of crtend.o
>> Wheeee!  Updating from ancient to old!
>
> Yes, GPLv3 and the way FreeBSD is handling it are unfortunate.
>
> In any case, lang/gcc45 and other FreeBSD ports I maintain use binutils
> 2.21, but for the sake of the system compiler or some building GCC from
> scratch, can one of you guys approve Steven's patch for HEAD, 4.6 and
> 4.5?
>
> Gerald

Patch

Index: gcc/config.gcc
===================================================================
--- gcc/config.gcc	(revision 170344)
+++ gcc/config.gcc	(working copy)
@@ -1210,6 +1210,7 @@  x86_64-*-elf*)
 	;;
 i[34567]86-*-freebsd*)
 	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/freebsd.h"
+	tmake_file="${tmake_file} i386/t-crtstuff"
 	;;
 x86_64-*-freebsd*)
 	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/x86-64.h i386/freebsd.h i386/freebsd64.h"