ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> boost
boost
Re: [boost] shared-linkable-true, runtime-link-dynamic and runtime-link-static
by David Abrahams other posts by this author
Oct 15 2002 10:11PM messages near this date
Re: [boost] shared-linkable-true, runtime-link-dynamic and runtime-link-static | Re: [boost] shared-linkable-true, runtime-link-dynamic and runtime-link-static
Alkis Evlogimenos <alkis@[...].com>  writes:

>  So if I get it correctly:
>  runtime-link-static: creates a static library that is statically linked to the 
>  C++ runtime

No, the use of runtime-link-static is not limited to static library
building. If your Jamfile says:

   exe foo : foo.cpp : <runtime-link> static ;

it creates an executable which is always statically linked to the
runtime library. So <runtime-link> static compiles and links objects
which are suitable for linking statically to the runtime.

>  runtime-link-dynamic: creates a static library that is dynamically linked to 
>  the C++ runtime (is this possible?)

Likewise, not specific to static libraries.

>  shared-linkable-true: creates a shared library that is dynamically linked to 
>  the C++ library

No, <shared-linkable> true generates code which can be linked
dynamically. On linux gcc this means it uses -fPIC.

>  I am using linux and both runtime-link-dynamic and
>  runtime-link-static are static libraries.

Let's just get the terminology straight. They are not static
libraries. They are subvariant path components which correspond to the
build properties <runtime-link> dynamic and <runtime-link>static,
respectively. In that build directory tree you will find a
built product. Depending on the type of main target you've built, it
will be a static or dynamic library, an executable, or a python module.

>   They also have the same
>  size but the binaries differ (at least this is what diff says).
>  
>  As an example I dumped the symbols for 
>  ./libs/thread/build/bin/libboost_thread.a/rs/debug/runtime-link-{static,dynamic}/threading
-multi/libboost_thread.a 
>  and I get the following diff:

Ah, so you're building libboost_thread.

>  It looks like only the name mangling differs. 

<snip> 

>  So I assume linking to either 
>  one will result in an executable that will behave the same. Maybe linux 
>  doesn't do a distinction between linking dynamically to the C++ runtime or 
>  not?

Yes, it does. That's what -static in the g++ command-line means. You
can inspect the build command lines by passing 

   -n -a

to bjam when you invoke it. Inspecting the differences will tell you a
lot.

-- 
           David Abrahams * Boost Consulting
dave@[...].com * http://www.boost-consulting.com

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Thread:
Alkis Evlogimenos
Rene Rivera
David Abrahams
Petr Kocmid
Alkis Evlogimenos
David Abrahams
Alkis Evlogimenos
David Abrahams
Neal D. Becker
Rene Rivera
Jeff Garland

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved