Gentoo Logo
Gentoo Spaceship

Installation:
Gentoo Handbook
Installation Docs

Documentation:
Home
Listing
About Gentoo
Philosophy
Social Contract

Resources:
Bug Tracker
Developer List
Discussion Forums
Gentoo BitTorrents
Gentoo Linux Enhancement Proposals
IRC Channels
Mailing Lists
Mirrors
Name and Logo Guidelines
Online Package Database
Security Announcements
Staffing Needs
Supporting Vendors
View our CVS

Graphics:
Logos and themes
Icons
ScreenShots

Miscellaneous Resources:
Gentoo Linux Store
Gentoo-hosted projects
IBM dW/Intel article archive




List Archive: gentoo-dev
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-dev@g.o
From: Donnie Berkholz <dberkholz@g.o>
Subject: Using -frecord-gcc-switches
Date: Mon, 2 Mar 2009 22:33:36 -0800
-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
Attachment:
pgpeS1cTuljOb.pgp (PGP signature)
Replies:
Re: Using -frecord-gcc-switches
-- Rémi Cardona
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
bash-4.0-r1 for ~arch
Next by thread:
Re: Using -frecord-gcc-switches
Previous by date:
Re: bash-4.0-r1 for ~arch
Next by date:
Re: bash-4.0-r1 for ~arch


Updated Jun 17, 2009

Donate to support our development efforts.

Gentoo Centric Hosting: vr.org

VR Hosted

Tek Alchemy

Tek Alchemy

SevenL.net

SevenL.net

php|architect

php|architect

Copyright 2001-2007 Gentoo Foundation, Inc. Questions, Comments? Email www@gentoo.org.