This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Link time checking for incompatible flags
- From: Mike Stump <mrs at apple dot com>
- To: Ian Lance Taylor <ian at wasabisystems dot com>
- Cc: Rahul Joshi <rujoshi at uiuc dot edu>, gcc at gcc dot gnu dot org
- Date: Wed, 21 Apr 2004 19:02:24 -0700
- Subject: Re: Link time checking for incompatible flags
On Wednesday, April 21, 2004, at 06:24 PM, Ian Lance Taylor wrote:
The linker currently has no mechanism for anything like this.
Doesn't it? The compiler is free to create link once sections that are
named something like gcc.options.fshort-enums and place in it a 0 or a
1, and then mark up that section as having the linker validate that the
section is the same in all units, and not loaded, and then presto, if
you compile two units that differ in this flag, automagic link error?
Last I looked I thought this was in GNU ld. Other linkers, well, no,
they generally don't do this.
I thought I tested this once by hand many years ago, and I thought I
saw it work, though, I think I tested loaded contents.