This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
RE: [PATCH] Inline defn's in stdio.h break gcc bootstrap on cygwin.
- From: Eric Blake <ebb9 at byu dot net>
- To: newlib at sources dot redhat dot com
- Date: Mon, 09 Apr 2007 20:23:59 -0600
- Subject: RE: [PATCH] Inline defn's in stdio.h break gcc bootstrap on cygwin.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
> 2007-03-30 Dave Korn <dave.korn@artimi.com>
>
> * libc/include/stdio.h (_ELIDABLE_INLINE): New macro to conceal
> conflicting inline semantics between C99 and GNU89.
> (__sgetc_r): Replace static inline with _ELIDABLE_INLINE to be
> compatible with -fkeep-inline-functions usage.
> (__sputc_r): Likewise for consistency even though disabled.
>
> Retested that cygwin dll still builds, verified that it solves bootstrap
> failure for gcc, and checked in. Thanks Jeff!
However, it breaks cygwin builds with CFLAGS=-O0. This additional patch
is needed to force gcc to inline even when optimizations are disabled, now
that you use extern inline (whereas the old gcc 'static inline' used to
already do that).
2007-04-09 Eric Blake <ebb9@byu.net>
* libc/include/stdio.h (_ELIDABLE_INLINE): Work even when using
CFLAGS=-O0.
- --
Don't work too hard, make some time for fun as well!
Eric Blake ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGGvU/84KuGfSFAYARAm+iAJwJjdgGcs/Q4DmIQV3768/6iBgaEgCg1yax
LN3k3e6r7wJRsBiZ24665ds=
=4iVp
-----END PGP SIGNATURE-----
Index: libc/include/stdio.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/stdio.h,v
retrieving revision 1.42
diff -u -p -r1.42 stdio.h
--- libc/include/stdio.h 4 Apr 2007 18:32:48 -0000 1.42
+++ libc/include/stdio.h 10 Apr 2007 02:12:01 -0000
@@ -434,7 +434,7 @@ FILE *_EXFUN(funopen,(const _PTR _cookie
'extern inline'. */
#if defined(__GNUC__) && !defined(__GNUC_STDC_INLINE__)
/* We're using GCC, but without the new C99-compatible behaviour. */
-#define _ELIDABLE_INLINE extern __inline__
+#define _ELIDABLE_INLINE extern __inline__ _ATTRIBUTE ((__always_inline__))
#else
/* We're using GCC in C99 mode, or an unknown compiler which
we just have to hope obeys the C99 semantics of inline. */