Re: [gentoo-dev] Using -frecord-gcc-switches

2009-03-03 Thread Rémi Cardona

Le 03/03/2009 07:33, Donnie Berkholz a écrit :

Thoughts? Could we do something useful with this?


What about the various objects that make up the final lib/binary? How is 
this handled?


Looks like a promising idea though

Cheers,

Rémi



[gentoo-dev] Using -frecord-gcc-switches

2009-03-02 Thread Donnie Berkholz
-frecord-gcc-switches is a really cool gcc option to save the CFLAGS a 
binary was built with in the binary itself. This could help with our bug 
reporting or with various QA checks. Imagine if `emerge --info cat/pkg` 
showed the CFLAGS that the binaries were actually built with, instead of 
some global setting or the CFLAGS environment variable that may well not 
be respected.

Here's a couple examples of it:

comet $ eu-readelf -p /usr/lib/libxdl_view.so | grep -v -e distcc -e ccache

String section [25] '.GCC.command.line' contains 1870 bytes at offset 0x69760:
  [27]  -march=core2
  [34]  -msse4.1
  [64]  -g
  [67]  -O2
  [6b]  -w
  [6e]  -ftree-vectorize
  [7f]  -frecord-gcc-switches
  [95]  -fPIC

comet $ eu-readelf -p /bin/ls | grep -v -e distcc -e ccache

String section [26] '.GCC.command.line' contains 4558 bytes at offset 0x1b4d0:
  [34]  -march=core2
  [41]  -msse4.1
  [80]  -g
  [83]  -O2
  [87]  -w
  [8a]  -std=gnu99
  [95]  -ftree-vectorize
  [a6]  -frecord-gcc-switches
  [  107e]  -I.
  [  1082]  -MD isnanl.d
  [  108f]  -MF .deps/isnanl.Tpo
  [  10a4]  -MP
  [  10a8]  -MT isnanl.o
  [  10b5]  isnanl.c
  [  10be]  -D_FORTIFY_SOURCE=2
  [  10d2]  -auxbase-strip isnanl.o


Thoughts? Could we do something useful with this?

-- 
Thanks,
Donnie

Donnie Berkholz
Developer, Gentoo Linux
Blog: http://dberkholz.wordpress.com


pgpXCVmv5SudV.pgp
Description: PGP signature