How to know default gcc flags ?
How to know default flags used in specific gcc version ? I am looking for difference between 3.4.3 and 4.1.1 These two have some difference regarding -nosse option but how can I find this ? -- Pritam Bankar
Hi.. On Thu, Aug 23, 2012 at 4:37 PM, Pritam Bankar <pritambankar1988@gmail.com> wrote:
How to know default flags used in specific gcc version ? I am looking for difference between 3.4.3 and 4.1.1 These two have some difference regarding -nosse option but how can I find this ?
try something like: echo "" | gcc -E -v - 2>&1 | grep -i cc and find the line like below: /usr/lib/gcc/i686-linux-gnu/4.6/cc1 -E -quiet -v -imultilib . -imultiarch i386-linux-gnu - -mtune=generic -march=i686 -fstack-protector (that's mine on Core Duo, Linux Mint 13 32 bit) -- regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com
Hi Pritam, You can use -frecord-gcc-switches. This switch causes the command line that was used to invoke the compiler to be recorded into the object file that is being created. $ gcc -O2 -frecord-gcc-switches -g -o test test.c $ <pravin@pravin-VirtualBox:/tmp$> readelf -p .GCC.command.line test String dump of section '.GCC.command.line': [ 0] test.c [ 7] -D_FORTIFY_SOURCE=2 [ 1b] -mtune=generic [ 2a] -march=i686 [ 36] -g [ 39] -O2 [ 3d] -frecord-gcc-switches [ 53] -fstack-protector<-fstack-protectorpravin@pravin-VirtualBox:/tmp$> $ $ readelf --debug-dump test <-fstack-protectorpravin@pravin-VirtualBox:/tmp$> checkout the *.debug_info* section of readelf output. Thanks & Regards, PraviN On Thu, Aug 23, 2012 at 7:50 PM, Mulyadi Santosa <mulyadi.santosa@gmail.com>wrote:
Hi..
On Thu, Aug 23, 2012 at 4:37 PM, Pritam Bankar <pritambankar1988@gmail.com> wrote:
How to know default flags used in specific gcc version ? I am looking for difference between 3.4.3 and 4.1.1 These two have some difference regarding -nosse option but how can I find this ?
try something like: echo "" | gcc -E -v - 2>&1 | grep -i cc
and find the line like below:
/usr/lib/gcc/i686-linux-gnu/4.6/cc1 -E -quiet -v -imultilib . -imultiarch i386-linux-gnu - -mtune=generic -march=i686 -fstack-protector
(that's mine on Core Duo, Linux Mint 13 32 bit)
-- regards,
Mulyadi Santosa Freelance Linux trainer and consultant
blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
-- Thanks & Regards,* ---------PraviN---------*
participants (3)
-
Mulyadi Santosa -
Pravin Shedage -
Pritam Bankar