public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: Phil Edwards <pedwards@disaster.jaj.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org Subject: Re: c/2678: gcc/g++ should stick compilation options into the .o file Date: Sun, 29 Apr 2001 20:06:00 -0000 [thread overview] Message-ID: <20010430030601.10725.qmail@sourceware.cygnus.com> (raw) The following reply was made to PR c/2678; it has been noted by GNATS. From: Phil Edwards <pedwards@disaster.jaj.com> To: "Ronald F. Guilmette" <rfg@monkeys.com> Cc: gcc-gnats@gcc.gnu.org Subject: Re: c/2678: gcc/g++ should stick compilation options into the .o file Date: Sun, 29 Apr 2001 21:41:04 -0400 On Sun, Apr 29, 2001 at 06:56:00PM -0000, Ronald F. Guilmette wrote: > My alopogies if my slippery fingers typed in `.command' when I intended > to write `.comment'. :-) > For documentation of the intended usage and format of data in ELF .note > and .comment sections, you will need to refer to the original AT&T docu- > mentation of ELF. [...] > but when I glanced again at the original AT&T documentation on ELF the other > day, it appears to me that the contents of .note is supposed to be, in > effect, a set of name/value pairs (vaguely reminicent of UNIX environment > variables). The required ``structure'' of the .note section just tells > you where and how to encode one of these name/value pairs, in general. Yep. Just before I left last night (er, this morning), I pulled up wotsit.org and grabbed the ELF 1.1 spec. Useful site, that. After some sleep, I've concluded that my original idea of using the print_switch_values routine might be stupid. I don't think people would like options passed: -iprefix -D__GNUC__=3 -D__GNUC_MINOR__=1 -D__GNUC_PATCHLEVEL__=0 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__STDC_HOSTED__=1 -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i686__ -D__tune_pentiumpro__ -D__GNUG__=3 -D_GNU_SOURCE -D__DEPRECATED -D__EXCEPTIONS -D__GXX_ABI_VERSION=100 options enabled: -fpeephole -ffunction-cse -fkeep-static-consts -fpcc-struct-return -fgcse-lm -fgcse-sm -fsched-interblock -fsched-spec -fbranch-count-reg -fexceptions -fcommon -fgnu-linker -fargument-alias -fident -fmath-errno -ftrapping-math -m80387 -mhard-float -mno-soft-float -mieee-fp -mfp-ret-in-387 showing up in their object files, for example. (Or do you?) The kicker is that the driver doesn't pass down the set of command-line options directly to the compiler. It does some translations on them, and then adds a bunch of defaults, and then passes /all/ of that down. See the "options passed" block above, for example; all of those are options to the compiler that the driver is inserting. If I had used -fomit-frame-pointer, for example, then that would be at the end of the list after the -D__*'s. (Side note: the "options enabled" block are everything that's on by default, as modified by the "options passed". If you really wanted to re-create the compilation environment for a particular file, you'd need to use all of those. The defaults might have changed.) The compiler does have available a save_argv and save_argc, but that's how the "options passed" block is constructed in the first place. We don't have any obvious way of distinguishing which options the user passed from the default ones added by the specs file. Phil -- pedwards at disaster dot jaj dot com | pme at sources dot redhat dot com devphil at several other less interesting addresses in various dot domains The gods do not protect fools. Fools are protected by more capable fools.
next reply other threads:[~2001-04-29 20:06 UTC|newest] Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top 2001-04-29 20:06 Phil Edwards [this message] -- strict thread matches above, loose matches on Subject: below -- 2002-11-05 9:16 Wolfgang Bangerth 2002-11-05 9:08 bangerth 2002-11-05 9:06 Phil Edwards 2002-11-05 7:46 Wolfgang Bangerth 2001-05-07 16:56 Phil Edwards 2001-04-30 17:36 Ronald F. Guilmette 2001-04-30 17:16 Phil Edwards 2001-04-30 10:26 Ronald F. Guilmette 2001-04-30 9:46 Ronald F. Guilmette 2001-04-30 2:36 Phil Edwards 2001-04-30 2:16 Ronald F. Guilmette 2001-04-29 11:56 Ronald F. Guilmette 2001-04-29 5:46 Phil Edwards 2001-04-29 5:16 Phil Edwards 2001-04-29 4:16 Phil Edwards 2001-04-28 13:46 rfg
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20010430030601.10725.qmail@sourceware.cygnus.com \ --to=pedwards@disaster.jaj.com \ --cc=gcc-prs@gcc.gnu.org \ --cc=nobody@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).