* options for later passes @ 2011-02-21 20:58 kevin diggs 2011-02-21 23:37 ` Andi Hellmund 0 siblings, 1 reply; 4+ messages in thread From: kevin diggs @ 2011-02-21 20:58 UTC (permalink / raw) To: gcc-help Hi, Is there an easy way to figure out which options need to be passed to later compilation passes? If I do a: gcc -S -dA -fverbose-asm -mcpu=750 -O2 -mmultiple -fpic gcc1test.c What should be used for assembly: gcc -c ??? gcc1test.s and linking: gcc -ogcc1test gcc1test.s I am pretty sure the link will need the -fpic. Probably also something like -pthread? Maybe the assembler would need to allow something like altivec? So as a general rule should it see the cpu (or arch) option? Does anyone else need the -O2? kevin P.S.: Do the order of the optimization options matter: '-O2 -mcpu=750 -mmultiple' the same as '-mmultiple -mcpu=750 -O2'? ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: options for later passes 2011-02-21 20:58 options for later passes kevin diggs @ 2011-02-21 23:37 ` Andi Hellmund 2011-02-22 0:34 ` kevin diggs 0 siblings, 1 reply; 4+ messages in thread From: Andi Hellmund @ 2011-02-21 23:37 UTC (permalink / raw) To: kevin diggs; +Cc: gcc-help Hey Kevin, > Is there an easy way to figure out which options need to be passed to > later compilation passes? Well, I think it's quite easy: it depends on what you want to build, how you want to build it and which library it requires. For example, gcc/linker can't know that function xyz() belongs to libabc. > What should be used for assembly: > > gcc -c ??? gcc1test.s I doubt that you really need to assemble a file directly, but it also depends on your needs. I would say that default options (though no specific options) could be sufficient. > I am pretty sure the link will need the -fpic. -fpic _should_ be used when building a shared library. > Probably also something like -pthread? Only, if you are building a multi-threaded application. If not, you don't need to specify -lpthread. > So as a general rule should it see the cpu (or arch) option? Sorry, but this also depends. If you for example build an application to be used by a Linux distro which might run on a various number of CPUs, you would possible use the "generic" option, but if you are building a high-performance application, you would specifically tune your application for the target processor. > Does anyone else need the -O2? No, only the compiler (cc1, cc1plus, ...) > P.S.: Do the order of the optimization options matter: '-O2 -mcpu=750 > -mmultiple' the same as '-mmultiple -mcpu=750 -O2'? No, it shouldn't. GCC firstly reads in the parameter and then does a post-processing on the options where necessary. Best regards, Andi ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: options for later passes 2011-02-21 23:37 ` Andi Hellmund @ 2011-02-22 0:34 ` kevin diggs 2011-02-22 15:47 ` Andi Hellmund 0 siblings, 1 reply; 4+ messages in thread From: kevin diggs @ 2011-02-22 0:34 UTC (permalink / raw) To: Andi Hellmund; +Cc: gcc-help On Mon, Feb 21, 2011 at 5:10 PM, Andi Hellmund <mail@andihellmund.com> wrote: > >> Does anyone else need the -O2? > > No, only the compiler (cc1, cc1plus, ...) > Can I assume this also includes all of -O's -f friends? Thanks! kevin ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: options for later passes 2011-02-22 0:34 ` kevin diggs @ 2011-02-22 15:47 ` Andi Hellmund 0 siblings, 0 replies; 4+ messages in thread From: Andi Hellmund @ 2011-02-22 15:47 UTC (permalink / raw) To: kevin diggs; +Cc: gcc-help Hey Kevin, > Can I assume this also includes all of -O's -f friends? > Yes, I think so. Andi ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-02-22 14:31 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2011-02-21 20:58 options for later passes kevin diggs 2011-02-21 23:37 ` Andi Hellmund 2011-02-22 0:34 ` kevin diggs 2011-02-22 15:47 ` Andi Hellmund
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).