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: fixincludes for glibc 'inline' non-C99 conformance


Hi,

there is another extern inline in a glibc header which is not wrapped in
a __USE_EXTERN_INLINES check.  The function __pthread_cleanup_routine is
defined in pthread.h like this:

extern __inline void
__pthread_cleanup_routine (struct __pthread_cleanup_frame *__frame)
{
  if (__frame->__do_it)
    __frame->__cancel_routine (__frame->__cancel_arg);
}

This caused a bootstrap failure when building with CFLAGS="-fexceptions"
during link step of libgfortran:

.libs/error.o(.text+0x0): In function `__pthread_cleanup_routine':
/usr/include/pthread.h:578: multiple definition of `__pthread_cleanup_routine'
.libs/environ.o(.text+0x0):/usr/include/pthread.h:578: first defined here
...

I've adjusted the glibc_c99_inline_2 fixinclude to cover that case as well.
This fixes the bootstrap problem.

Bootstrapped on s390x with -fexceptions.

Bye,

-Andreas-


Index: fixincludes/inclhack.def
===================================================================
*** fixincludes/inclhack.def.orig	2006-11-15 13:35:49.000000000 +0100
--- fixincludes/inclhack.def	2006-11-15 13:54:29.000000000 +0100
*************** EOT;
*** 1315,1321 ****
  fix = {
      hackname  = glibc_c99_inline_2;
      files     = sys/stat.h;
!     select    = "extern __inline__ int";
      sed	      = "s/extern int \\(stat\\|lstat\\|fstat\\|mknod\\)/"
  		"#if __STDC_VERSION__ < 199901L\\\nextern\\\n#endif\\\n"
      		"__inline__ int \\1/";
--- 1315,1322 ----
  fix = {
      hackname  = glibc_c99_inline_2;
      files     = sys/stat.h;
!     files     = pthread.h;
!     select    = "extern __inline";
      sed	      = "s/extern int \\(stat\\|lstat\\|fstat\\|mknod\\)/"
  		"#if __STDC_VERSION__ < 199901L\\\nextern\\\n#endif\\\n"
      		"__inline__ int \\1/";
*************** fix = {
*** 1325,1330 ****
--- 1326,1334 ----
      sed	      = "s/^extern __inline__ int/"
  		"#if __STDC_VERSION__ < 199901L\\\nextern\\\n#endif\\\n"
  		"__inline__ int/";
+     sed       = "s/^extern __inline void/"
+ 		"#if __STDC_VERSION__ < 199901L\\\nextern\\\n#endif\\\n"
+ 		"__inline void/";
      test_text = <<-EOT
  extern int fstat64 (int __fd, struct stat64 *__buf) __THROW __nonnull ((2));
  extern __inline__ int


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