incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Lemings" <lemi...@roguewave.com>
Subject RE: [PATCH] for STDCXX-262 "Multiple vtable definitions on Darwin platforms"
Date Tue, 13 Mar 2007 23:07:30 GMT

If LDSOFLAGS is only used when linking the library then I don't see
a problem with that since -dynamiclib is only need when linking the
library.  I'm not sure what will happen if that flag is given when
linking executables.

Now that I think about it, the -dynamiclib flag probably needs to be
within the build mode conditionals that check see if a shared
library is being built.  Not sure what will happen if that flag is
specified when building a static library.

I guess you could define yet another platform-specific variable in
gcc.config that gets added to LDFLAGS only when linking the library
(if one doesn't already exist of course).

Brad.

> -----Original Message-----
> From: Martin Sebor [mailto:sebor@roguewave.com] 
> Sent: Tuesday, March 13, 2007 2:34 PM
> To: stdcxx-dev@incubator.apache.org
> Subject: Re: [PATCH] for STDCXX-262 "Multiple vtable 
> definitions on Darwin platforms"
> 
> Eric Lemings wrote:
> > "[gcc/Mac OS X 10.4.6 Tiger] Multiple vtable definitions for 
> > bad_exception and bad_alloc"
> 
> Thanks Brad! Good to know there is an easy solution for this.
> 
> As for the patch, my comment is the same as what I just said 
> to Farid, i.e., that (like stdcxx C++ sources) the makefiles 
> are intended to be platform-agnostic and free of platform 
> specific ifs (and ifdefs).
> 
> Fortunately, unlike in Farid's case, the solution here should 
> be straightforward: add the -dynamiclib option to LDSOFLAGS 
> in gcc.config instead of GNUmakefile.lib.
> 
> If you post a (tested) patch that does that I'll be happy to 
> commit it on trunk.
> 
> Thanks
> Martin
> 
> > 
> > $ svn diff etc/config/GNUmakefile.lib
> > Index: etc/config/GNUmakefile.lib
> > ===================================================================
> > --- etc/config/GNUmakefile.lib  (revision 517771)
> > +++ etc/config/GNUmakefile.lib  (working copy)
> > @@ -39,6 +39,10 @@
> >  ONE_REPOSITORY = 1
> >  include ../makefile.common
> >  
> > +ifeq ($(findstring darwin,$(PLATFORM)),darwin)
> > +LDSOFLAGS   += -dynamiclib
> > +endif
> > +
> >  CXXFLAGS    += $(PICFLAGS)
> >  LDFLAGS     += $(LDSOFLAGS) $(MAPFLAGS) $(MAPFILE)
> >  
> > 
> > Tested with gcc-4.2-20070307 snapshot on Mac OS X 10.4.8.
> >  
> > Eric.
> 
> 

Mime
View raw message