This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: shared libraries + lto ?
- From: Vincent Lefevre <vincent+gcc at vinc17 dot org>
- To: gcc-help at gcc dot gnu dot org
- Date: Sun, 3 Aug 2014 16:48:34 +0200
- Subject: Re: shared libraries + lto ?
- Authentication-results: sourceware.org; auth=none
- References: <DUB121-W87786570D9DA2D89611D2B7E70 at phx dot gbl> <20140801104716 dot GA11564 at ioooi dot vinc17 dot net> <DUB121-W22CA92DA02A75D1ACCFFF2B7E70 at phx dot gbl>
On 2014-08-01 13:59:28 +0200, Alain Meunier wrote:
[...]
> Both compiled with gcc
> gcc /*optim. flags here*/ -fPIC foo.c -o libfoo.a -flto
> gcc /*optim. flags here*/ -fPIC bar.c -o libbar.a -flto
>
> and a main program my_app.c :
>
> #include here
> int main(){
> int f1 = 5;
> int f2 = 3;
> cool(&f1,&f2);
> eatTheWorld(&f1,&f2)
>
> return 0;
> }
>
> I will compile it with
> gcc /*optim. flags here*/ my_app.c -lfoo -lbar -flto
>
> Is that it ? Nothing more ?
I compiled everything with "-flto=jobserve -fuse-linker-plugin"
(that was two years ago), but I don't know whether this is still
necessary.
--
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)