This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[4.7, go] Backport godump.c patch


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.

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;
 }

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

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]