incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Lemings" <lemi...@roguewave.com>
Subject FW: Mac OS X Link Errors
Date Mon, 05 Jun 2006 19:04:29 GMT


-----Original Message-----
From: Martin Sebor 
Sent: Monday, June 05, 2006 10:44 AM
To: Eric Lemings
Subject: Re: Mac OS X Link Errors

Interesting. Could you forward this to the list for the record?

Thanks
Martin

Eric Lemings wrote:
>  
>
http://gcc.gnu.org/onlinedocs/gcc-4.0.3/gcc/Vague-Linkage.html#Vague-Lin
kage
> 
> "When used with GNU ld version 2.8 or later on an ELF system such as 
> GNU/Linux or Solaris 2, or on Microsoft Windows, duplicate copies of 
> these constructs will be discarded at link time. This is known as 
> COMDAT support.
> 
> On targets that don't support COMDAT, but do support weak symbols, GCC

> will use them. This way one copy will override all the others, but the

> unused copies will still take up space in the executable.
> 
> For targets which do not support either COMDAT or weak symbols, most 
> entities with vague linkage will be emitted as local symbols to avoid 
> duplicate definition errors from the linker. This will not happen for 
> local statics in inlines, however, as having multiple copies will 
> almost certainly break things."
> 
> It appears that the linker on Mac OS X is the BSD version, not the GNU

> version which is why the first option happens on other GCC 4.0 
> platforms with STDCXX.  I'll have to take a closer look at the other
two options.
> 
> Brad.
>  
> 
>
------------------------------------------------------------------------
>     *From:* Eric Lemings
>     *Sent:* Friday, June 02, 2006 11:43 AM
>     *To:* Martin Sebor
>     *Subject:* Mac OS X Link Errors
> 
>      
>     What do you make of this?
>      
>     gcc -c -I/Users/elemings/Work/stdcxx/include/ansi -D_RWSTDDEBUG   
>     -D_RWSTD_USE_CONFIG -I/Users/elemings/Work/stdcxx/include
>     -I/Users/elemings/Build/stdcxx/include  -pedantic -nostdinc++ -g
-W
>     -Wall -Wcast-qual -Winline -Wshadow -Wwrite-strings -Wno-long-long
>     -Wcast-align  -fPIC /Users/elemings/Work/stdcxx/src/wctype.cpp
>     gcc      assert.o atomic-cxx.o bitset.o catalog.o codecvt.o
>     collate.o ctype.o ctype_bits.o exception.o export.o facet.o file.o
>     instance.o ios.o ios_bits.o iostore.o iostream.o iso2022.o
limits.o
>     limits_bits.o locale_bits.o locale_body.o locale_classic.o
>     locale_combine.o locale_core.o locale_eq.o locale_global.o
>     locale_name.o memattr.o memory.o messages.o num_get.o num_put.o
>     punct.o random.o setlocale.o string.o strstream.o strtol.o
>     ti_collate.o ti_filebuf.o ti_insert_dbl.o ti_insert_int.o
>     ti_insert_ptr.o ti_ios.o ti_istream.o ti_messages.o ti_money_get.o
>     ti_money_put.o ti_moneypunct.o ti_num_get.o ti_num_put.o
>     ti_numpunct.o ti_ostream.o ti_streambuf.o ti_string.o
ti_stringbuf.o
>     ti_time_get.o ti_time_put.o ti_wcollate.o ti_wfilebuf.o
>     ti_winsert_dbl.o ti_winsert_int.o ti_winsert_ptr.o ti_wios.o
>     ti_wistream.o ti_wmessages.o ti_wmoney_get.o ti_wmoney_put.o
>     ti_wmoneypunct.o ti_wnum_get.o ti_wnum_put.o ti_wnumpunct.o
>     ti_wostream.o ti_wstreambuf.o ti_wstring.o ti_wstringbuf.o
>     ti_wtime_get.o ti_wtime_put.o time_get.o time_put.o tmpbuf.o
>     typeinfo.o valarray.o vecbool.o version.o wcodecvt.o wctype.o
>     -lsupc++ -lgcc_eh -o
/Users/elemings/Build/stdcxx/lib/libstd.so.4.2.0
>     /usr/bin/ld: multiple definitions of symbol vtable for
>     std::bad_exception
>     exception.o definition of vtable for std::bad_exceptionin section
>     (__DATA,__const)
>
/usr/lib/gcc/i686-apple-darwin8/4.0.1/../../../libsupc++.a(eh_exception.
o)
>     private external definition of vtable for std::bad_exceptionin
>     section (__DATA,__const)
>     /usr/bin/ld: multiple definitions of symbol vtable for
std::bad_alloc
>     memory.o definition of vtable for std::bad_allocin section
>     (__DATA,__const)
>
/usr/lib/gcc/i686-apple-darwin8/4.0.1/../../../libsupc++.a(new_handler.o
)
>     private external definition of vtable for std::bad_allocin section
>     (__DATA,__const)
>     collect2: ld returned 1 exit status
>     make[2]: *** [/Users/elemings/Build/stdcxx/lib/libstd.so] Error 1
>     make[1]: *** [lib] Error 2
>     make: *** [libstd] Error 2
>     I've tried without -lsupc++, without -lgcc_eh, without both of
>     them...  Nothing works.
>      
>     Brad.
>      
>      


Mime
View raw message