public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Alain Meunier <deco33@hotmail.fr>
To: "gcc-help@gcc.gnu.org" <gcc-help@gcc.gnu.org>
Subject: lto + pgo + shared libraries : explanation ?‏
Date: Sat, 26 Jul 2014 09:39:00 -0000	[thread overview]
Message-ID: <DUB121-W167589A4465F2DD61F41B3B7FD0@phx.gbl> (raw)

Hello,

gcc 4.8.2

I just happen to be in need to use pgo,lto with shared libraries that I want to link.

I cannot figure out if lto will bring some efficiency to the links.

1) gcc -march=native -03 -shared -fPIC first_shared.c -flto -o libfoo.so
2) gcc -march=native -03 -shared -fPIC second_shared.c -flto -o libbar.so

3) gcc -march=native -03 main.c -lfoo -lbar -flto


Ok all my functions are static except some of them (public interface) inside the shared library.

What should I do exactly to take advantage of lto with shared libraries ?

Now, what does it take to create PGO on shared libraries ?

I know I can use fprofile-generate/fprofile-use on 3) but will it be enough to take 1) and 2) into account ?

I am a bit lost on what to do here in this context.

All the commands work fine but is it doing anything ?

Thanks

Alain
 		 	   		  

                 reply	other threads:[~2014-07-26  9:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=DUB121-W167589A4465F2DD61F41B3B7FD0@phx.gbl \
    --to=deco33@hotmail.fr \
    --cc=gcc-help@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).