diff mbox

[4.7,go] Backport godump.c patch

Message ID yddfvzxdisc.fsf@lokon.CeBiTec.Uni-Bielefeld.DE
State New
Headers show

Commit Message

Rainer Orth March 14, 2013, 4:53 p.m. UTC
Since Solaris 11.1, libgo compilation was failing with

sysinfo.go:676:267: error: use of undefined type '_ns_postinit_s'

sysinfo.go had

type _netstack struct { netstack_u struct { nu_modules [20+1]*byte; }; netstack_m_state [20+1]uint32; netstack_lock _kmutex_t; netstack_next *_netstack; netstack_stackid int32; netstack_numzones int32; netstack_refcnt int32; netstack_flags int32; netstack_postinit *_ns_postinit_s; }
const _sizeof_netstack = 200
type _netstack_t struct { netstack_u struct { nu_modules [20+1]*byte; }; netstack_m_state [20+1]uint32; netstack_lock _kmutex_t; netstack_next *_netstack; netstack_stackid int32; netstack_numzones int32; netstack_refcnt int32; netstack_flags int32; netstack_postinit *_ns_postinit_s; }

but no definition of _ns_postinit_s.  For a long time, I had a local
patch in my tree to just omit the related _netstack, _netstack_t, and
_netstack_registry types in mksysinfo.sh to avoid this.  When I tried
without this patch on mainline, I noticed that the build worked just
fine, while on the 4.7 branch it still fails.

I found that this patch

2012-12-04  Ian Lance Taylor  <iant@google.com>

	* godump.c (find_dummy_types): Output a dummy type if we couldn't
	output the real type.
fixes the problem, so I'd like to backport it.

i386-pc-solaris2.11 bootstrap still running, ok for 4.7 branch if it
passes?

One additional question: the patch updates the copyright date by adding
2012.  How do we hande this for a backport?  Keep it that way or update
for 2013 instead?

Thanks.
        Rainer

Comments

Ian Lance Taylor March 14, 2013, 6:21 p.m. UTC | #1
On Thu, Mar 14, 2013 at 9:53 AM, Rainer Orth wrote:

> I found that this patch
>
> 2012-12-04 Ian Lance Taylor
>         * godump.c (find_dummy_types): Output a dummy type if we couldn't
>          output the real type.
>
>
>
> fixes the problem, so I'd like to backport it.
>
> i386-pc-solaris2.11 bootstrap still running, ok for 4.7 branch if it
> passes?

It's fine with me though I guess it needs to be approved by a release
branch manager.

> One additional question: the patch updates the copyright date by adding
> 2012. How do we hande this for a backport? Keep it that way or update
> for 2013 instead?

Keep it as 2012 since that is when the code was written.

Ian
Rainer Orth March 15, 2013, 9:58 a.m. UTC | #2
Ian Lance Taylor <iant@google.com> writes:

> On Thu, Mar 14, 2013 at 9:53 AM, Rainer Orth wrote:
>
>> I found that this patch
>>
>> 2012-12-04 Ian Lance Taylor
>>         * godump.c (find_dummy_types): Output a dummy type if we couldn't
>>          output the real type.
>>
>>
>>
>> fixes the problem, so I'd like to backport it.
>>
>> i386-pc-solaris2.11 bootstrap still running, ok for 4.7 branch if it
>> passes?
>
> It's fine with me though I guess it needs to be approved by a release
> branch manager.

Ok, Cc'ed.  The i386-pc-solaris2.11 bootstrap now completed
successfully, and I've also bootstrapped on x86_64-unknown-linux-gnu to
make sure nothing breaks.

While the patch doesn't fix a regression, it does fix a bootstrap
failure and has been on mainline for 3 1/2 months, so seems pretty
safe.

>> One additional question: the patch updates the copyright date by adding
>> 2012. How do we hande this for a backport? Keep it that way or update
>> for 2013 instead?
>
> Keep it as 2012 since that is when the code was written.

Will do.

Thanks.
        Rainer
Rainer Orth March 20, 2013, 11:42 a.m. UTC | #3
Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:

> Ian Lance Taylor <iant@google.com> writes:
>
>> On Thu, Mar 14, 2013 at 9:53 AM, Rainer Orth wrote:
>>
>>> I found that this patch
>>>
>>> 2012-12-04 Ian Lance Taylor
>>>         * godump.c (find_dummy_types): Output a dummy type if we couldn't
>>>          output the real type.
>>>
>>> fixes the problem, so I'd like to backport it.
>>>
>>> i386-pc-solaris2.11 bootstrap still running, ok for 4.7 branch if it
>>> passes?
>>
>> It's fine with me though I guess it needs to be approved by a release
>> branch manager.
>
> Ok, Cc'ed.  The i386-pc-solaris2.11 bootstrap now completed
> successfully, and I've also bootstrapped on x86_64-unknown-linux-gnu to
> make sure nothing breaks.
>
> While the patch doesn't fix a regression, it does fix a bootstrap
> failure and has been on mainline for 3 1/2 months, so seems pretty
> safe.

It's been almost a week with no word from the RMs if this is appropriate
for the 4.7 branch.

Thanks.
	Rainer
Richard Biener March 20, 2013, 11:45 a.m. UTC | #4
On Wed, 20 Mar 2013, Rainer Orth wrote:

> Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:
> 
> > Ian Lance Taylor <iant@google.com> writes:
> >
> >> On Thu, Mar 14, 2013 at 9:53 AM, Rainer Orth wrote:
> >>
> >>> I found that this patch
> >>>
> >>> 2012-12-04 Ian Lance Taylor
> >>>         * godump.c (find_dummy_types): Output a dummy type if we couldn't
> >>>          output the real type.
> >>>
> >>> fixes the problem, so I'd like to backport it.
> >>>
> >>> i386-pc-solaris2.11 bootstrap still running, ok for 4.7 branch if it
> >>> passes?
> >>
> >> It's fine with me though I guess it needs to be approved by a release
> >> branch manager.
> >
> > Ok, Cc'ed.  The i386-pc-solaris2.11 bootstrap now completed
> > successfully, and I've also bootstrapped on x86_64-unknown-linux-gnu to
> > make sure nothing breaks.
> >
> > While the patch doesn't fix a regression, it does fix a bootstrap
> > failure and has been on mainline for 3 1/2 months, so seems pretty
> > safe.
> 
> It's been almost a week with no word from the RMs if this is appropriate
> for the 4.7 branch.

RMs don't care for GO.

Richard.

> Thanks.
> 	Rainer
> 
>
diff mbox

Patch

diff --git a/gcc/godump.c b/gcc/godump.c
--- a/gcc/godump.c
+++ b/gcc/godump.c
@@ -1,5 +1,5 @@ 
 /* Output Go language descriptions of types.
-   Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
    Written by Ian Lance Taylor <iant@google.com>.
 
 This file is part of GCC.
@@ -1164,9 +1164,11 @@  find_dummy_types (const void *ptr, void 
   struct godump_container *data = (struct godump_container *) adata;
   const char *type = (const char *) ptr;
   void **slot;
+  void **islot;
 
   slot = htab_find_slot (data->type_hash, type, NO_INSERT);
-  if (slot == NULL)
+  islot = htab_find_slot (data->invalid_hash, type, NO_INSERT);
+  if (slot == NULL || islot != NULL)
     fprintf (go_dump_file, "type _%s struct {}\n", type);
   return true;
 }