From: Shriramana Sharma <samjnaa@gmail.com>
To: linux-c-programming@vger.kernel.org
Subject: Re: unable to link to a static library present alongside a shared library
Date: Wed, 18 Apr 2007 18:03:03 +0530 [thread overview]
Message-ID: <46260FFF.9050909@gmail.com> (raw)
In-Reply-To: <70661EB74D51BD4889EE03CC34E733F5A76677@blr-m2-msg.wipro.com>
cyon.john@wipro.com wrote:
> You can use the '-static' option to gcc for forcing a static link even
> if a shared library is present.
So much for my being intelligent enough to have looked up the ld manual.
Thanks for your pointing out and I believe your reason for preferring
the shared libs must be the correct one.
BTW what does this mean (found it under man:ld for -static):
This option can be used with -shared. Doing so means that a shared
library is being created but that all of the library's external
references must be resolved by pulling in entries from static libraries.
Does it mean that while creating a shared library, static libraries
which the shared library itself depends on must be integrated into the
.so file?
So if libfoo depends on libgoo and libgoo.a is available (but not
libgoo.so) I will have to specify both -static and -shared to pull the
contents of libgoo.a into libfoo.so when it is created?
That must further mean that the default behaviour is NOT to integrate a
static library into a shared library. Is that right? Seems somewhat
contrary to the standard policy of integrating into the target whatever
static libraries are linked against, no?
Thanks.
Shriramana Sharma.
next prev parent reply other threads:[~2007-04-18 12:33 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-18 12:09 unable to link to a static library present alongside a shared library Shriramana Sharma
2007-04-18 12:19 ` cyon.john
2007-04-18 12:33 ` Shriramana Sharma [this message]
2007-04-18 14:00 ` cyon.john
2007-04-18 17:34 ` Shriramana Sharma
2007-04-18 15:12 ` Glynn Clements
2007-04-18 18:40 ` Shriramana Sharma
2007-04-18 20:18 ` Glynn Clements
2007-04-19 10:10 ` Shriramana Sharma
2007-04-19 12:34 ` leslie.polzer
2007-04-19 13:48 ` Shriramana Sharma
2007-04-19 16:30 ` leslie.polzer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46260FFF.9050909@gmail.com \
--to=samjnaa@gmail.com \
--cc=linux-c-programming@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).