Message ID | 20120924214034.4F23B55CAA@rong2.dls.corp.google.com |
---|---|
State | New |
Headers | show |
ok. David On Mon, Sep 24, 2012 at 2:40 PM, Rong Xu <xur@google.com> wrote: > Hi, > > This patch is for google branches only. > It fixes the unsatified symbol in lipo-use build. > Tested with SPEC and google internal benchmarks. > > Thanks, > > -Rong > > > 2012-09-24 Rong Xu <xur@google.com> > > * gcc/l-ipo.c (cgraph_is_aux_decl_external): output comdat > virtual functions when they are auxiliary modules; otherwise we may > get undefined symbol in linking. > Google ref b/7078882. > > > Index: gcc/l-ipo.c > =================================================================== > --- gcc/l-ipo.c (revision 191679) > +++ gcc/l-ipo.c (working copy) > @@ -1111,16 +1111,16 @@ > if (node->is_versioned_clone) > return false; > > - /* virtual functions won't be deleted in the primary module. */ > - if (DECL_VIRTUAL_P (decl)) > - return true; > - > /* Comdat or weak functions in aux modules are not external -- > there is no guarantee that the definitition will be emitted > in the primary compilation of this auxiliary module. */ > if (DECL_COMDAT (decl) || DECL_WEAK (decl)) > return false; > > + /* virtual functions won't be deleted in the primary module. */ > + if (DECL_VIRTUAL_P (decl)) > + return true; > + > if (!TREE_PUBLIC (decl)) > return false; > > > -- > This patch is available for review at http://codereview.appspot.com/6562044
Index: gcc/l-ipo.c =================================================================== --- gcc/l-ipo.c (revision 191679) +++ gcc/l-ipo.c (working copy) @@ -1111,16 +1111,16 @@ if (node->is_versioned_clone) return false; - /* virtual functions won't be deleted in the primary module. */ - if (DECL_VIRTUAL_P (decl)) - return true; - /* Comdat or weak functions in aux modules are not external -- there is no guarantee that the definitition will be emitted in the primary compilation of this auxiliary module. */ if (DECL_COMDAT (decl) || DECL_WEAK (decl)) return false; + /* virtual functions won't be deleted in the primary module. */ + if (DECL_VIRTUAL_P (decl)) + return true; + if (!TREE_PUBLIC (decl)) return false;