From: Andy <hewanxiang@gmail.com>
To: gcc@gcc.gnu.org
Subject: How to link a static lib when build a shared lib ?
Date: Sat, 08 Aug 2009 12:17:00 -0000 [thread overview]
Message-ID: <2cd8d8530908080504t30e938d7qeaba0af91de5af16@mail.gmail.com> (raw)
Hi all,
I got that, glibc can support SHA in crypt lib since v2.7.
There is a requirement in my application to use SHA, but update the
whole glibc is too risky. So I want to build a specific crypt lib for
the module using crypt function in my application.
Now the calling graph seems like this, from a simple view.
crypt_user.c ----> call crypt() function in libcrypt.so
myutil.c -----> call functions in crypt_user.c, and it will be build
to a shared lib, libmyutil.so
Executable program : server -----> need to use libmyutil.so to work.
Now I can ONLY use the latest static lib libcrypt.a from the new
glibc. How should I use it ? Link it when build libmyutil.so or build
server ?
I tried to update my Makefile to link the libcrypt.a, but seems that
the called crypt function is not as I expected, it's still from the old glibc.
Could anybody give me a help with how to use the gcc option and write
a working Makefile ?
Any reply will be appreciated!
Thanks,
next reply other threads:[~2009-08-08 12:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-08 12:17 Andy [this message]
2009-08-10 11:43 ` Ian Lance Taylor
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=2cd8d8530908080504t30e938d7qeaba0af91de5af16@mail.gmail.com \
--to=hewanxiang@gmail.com \
--cc=gcc@gcc.gnu.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 read-only IMAP folder(s) and NNTP newsgroup(s).