This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: possible Linux bootstrap problem possible fix


On Tue, Oct 31, 2006 at 10:30:27PM -0800, Geoffrey Keating wrote:
> Andrew claims that there is a GCC bootstrap problem on Linux because
> some parts of GCC build with -std=c99 and the Linux headers are not
> compatible with C99.

It is not just about GCC bootstrap, basically everything that compiles
in Linux with -std=gnu99 or -std=c99 (many programs) are now broken.
And not just because of glibc headers, but dozens of other packages.

Swapping the meaning of 'inline' vs. 'extern inline' certainly isn't
sufficient, I'd add that's the easy part which can be easily fixed
in the headers just by macroizing all current uses of extern inline.

What's far more problematic is the rest of the changes.  The more I look
at the ISO C99 inline semantics, the more I like the GNU inline semantics,
which has been designed to accomodate the needs of GNU C library when
it was added to GCC.

In particular, glibc often has a function prototype in a generic
header:

extern void foo (void);

and then, optionally, in some target specific header an inline optimization
for it:

extern inline void foo (void) { whatever; }

but e.g. not all targets provide the inline optimizations or they are
guarded by some complicated preprocessor conditions.
In the ISO C99 inline semantics we'd need to know beforehand if a function
will have an inline optimization or not and depending on that either use
extern or inline keywords on the prototype in the generic header.
I don't know what the ISO C99 inline semantics is supposed to be good for,
but certainly not for this case.

Therefore, I'd like to reiterate my request that we at least
add a new attribute which will provide the far more useful GNU inline
semantics to functions marked with it, no matter what -std= option
is used on the command line.  Then a fixincludes change (and changes
the GNU C Library maintainers are able to live with) would be a simple
replacing of all extern inline keywords with a new macro that would
expand to extern inline in ISO C89 mode or GCC < 4.3 and to
__attribute__((__gnu_inline__)) inline or something similar in C99/GNU99
modes.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]