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@xxxxxxxxxx> - 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)