linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Mark Hatle <fray@mvista.com>
To: Jon-Erling Dahl <jon-erling.dahl@its4mobility.com>
Cc: Michael Habermann <MHabermann@gmx.de>,
	"'Linux PPC'" <linuxppc-embedded@lists.linuxppc.org>
Subject: Re: libraryopt
Date: Sat, 02 Mar 2002 23:08:54 -0600	[thread overview]
Message-ID: <3C81AFE6.CDE1010D@mvista.com> (raw)
In-Reply-To: GKEKJGELJKLLBBAFIGAIMEKACAAA.jon-erling.dahl@its4mobility.com


Jon-Erling Dahl wrote:
> files as input. My build script didn't get any object files at
> all and I think its because of this:
>
> I have an application 'myapp' that depends on a shared library
> 'mylib'. 'mylib' in turn depends on 'somelib', like this:
>
> myapp -> mylib -> somelib -> libc, libstdc++, etc
>
> What I tried was to create an optimizer for somelib. But since
> myapp doesn't depend on somelib directly, it seems that libopt
> doesn't think any of the object files in 'somelib' is needed,
> and hence no object files as input to the build script.
> Is this correct? Does libopt only work when an application is
> linked directly against the lib you're trying to optimize?
> Am I completely missing something here?
> I built an optimizer for 'mylib', and it worked correctly...

How did you link your app and the various libraries involved?  If you
used ld and did not specify the required libs, then the information
would not have gotten embedded into the elf information for each
required object.  If the elf information isn't there (or correct) the
library optimizer will be unable to correctly discover the link chain.
(You can use ldd or cross-ldd w/ hardhat linux to identify the required
libraries as listed in the elf information.)

When building software you should always use gcc to both compile and
link the software.  That is the only way to ensure that you get proper
library information, especially libc and libstdc++.  (In most cases you
can just replace ld w/ gcc, but for some apps you may have to throw in
some special gcc options.)

--Mark

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

  reply	other threads:[~2002-03-03  5:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-30 21:16 SMC2 causes failure? Gessner, Matt
2002-01-30 22:11 ` Dan Malek
2002-02-28 12:24 ` libraryopt Jon-Erling Dahl
     [not found] ` <GKEKJGELJKLLBBAFIGAIGEJGCAAA.jon-erling.dahl@its4mobility. com>
2002-03-01  0:37   ` libraryopt Michael Habermann
2002-03-02  9:53     ` libraryopt Jon-Erling Dahl
2002-03-03  5:08       ` Mark Hatle [this message]
2002-03-08 15:07         ` libraryopt Jon-Erling Dahl

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=3C81AFE6.CDE1010D@mvista.com \
    --to=fray@mvista.com \
    --cc=MHabermann@gmx.de \
    --cc=jon-erling.dahl@its4mobility.com \
    --cc=linuxppc-embedded@lists.linuxppc.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).