From patchwork Mon Jun 6 04:16:34 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: AIX net/if_arp.h include fix for struct fc_softc Date: Sun, 05 Jun 2011 18:16:34 -0000 From: Peter O'Gorman X-Patchwork-Id: 98799 Message-Id: <20110606041634.GA6074@tw2.lan> To: gcc-patches@gcc.gnu.org Cc: dje.gcc@gmail.com, bkorb@gnu.org Hi, We ran across an issue with qt-4.7 built with gcc-4.4 on AIX 5.2, 5.3, 6.1, and 7.1 where some static constructors were not being called. It turned out to be a header file issue, see, for example, https://www.ibm.com/developerworks/forums/thread.jspa?threadID=211873&tstart=-2 Using fixincludes to fix the header allows us to build a working qt. The erroneous struct declaration is: struct fc_softc { struct arpcom fc_ac; /* FCS common part */ struct ndd *nddp; /* returned from NS */ int(*efcnet_arp_fct) (struct ndd *, struct mbuf *); /* efcnet_arp function address */ } *fc_softc ; when fixed it becomes: typedef struct _fc_softc { struct arpcom fc_ac; /* FCS common part */ struct ndd *nddp; /* returned from NS */ int(*efcnet_arp_fct) (struct ndd *, struct mbuf *); /* efcnet_arp function address */ } *fc_softc ; David, do you have any idea if this is what it's supposed to be? Ok for trunk? Peter Index: inclhack.def =================================================================== --- inclhack.def (revision 174678) +++ inclhack.def (working copy) @@ -369,6 +369,19 @@ test_text = "#define _Complex_I __I\n"; }; +/* + * net/if_arp.h defines a variable fc_softc instead of adding a + * typedef for the struct on AIX 5.2, 5.3, 6.1 and 7.1 + */ +fix = { + hackname = aix_net_if_arp; + mach = "*-*-aix*"; + files = "net/if_arp.h"; + select = "^struct fc_softc \\{"; + c_fix = format; + c_fix_arg = "typedef struct _fc_softc {"; + test_text = "struct fc_softc {"; +}; /* * pthread.h on AIX 4.3.3 tries to define a macro without whitspace