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]

Re: [RFA:] libstdc++-v3 patches to bootstrap on gnulibc1 andglibc 2.0



This patch  looks fine to me, but I'd like one of the V3 people to
review it, so I've copied it to the V3 list.

Gaby/Benjamin, Would one of you review this patch?

Thanks,

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

These patches fixes bootstrap on libc5 (libc1) and glibc 2.0 systems, such
as RH 4.2 (libc1) and Debian Slink (glibc 2.0).  There used to be other
libio issues, but they are gone with the recent change to make
--enable-cstdio=stdio default.

This was bootstrapped on i686-pc-linux-gnulibc1, where bash 2.0 isn't
installed so I only tested with check-gcc and check-g++, and bootstrapped
and tested on i[56]86-pc-linux-gnu where one tested system had glibc 2.0
and another glibc 2.1 (for sanity).  Since all patches are needed, I
didn't see any use in separating them.

I had trouble interpreting the libstdc++ test result consequences.  Are
there supposed to be failures there?  And BTW libstdc++ testing *hogs*
memory.  Setting ulimit is most useful.

Note that below the change in the os_defines.h patch you can spot a bug
lurking, fixed with the patch by including <sys/types.h>.  The macro
__GLIBC__ is tested, but at least src/complex.cc had an include sequence
in which no system header had been included before os_defines.h.

Ok to commit?

libstdc++-v3:

	* config/os/gnu-linux/bits/os_defines.h: Include <sys/types.h>.
	If not glibc 2.1 or higher, include <gnu/types.h> and define
	__off64_t as __loff_t.

libio:
	* libio.h [__P]: Move __THROW and __PMT into their own ifndef:s.
	(__underflow, __overflow): Remove __THROW qualifier in declaration.

Index: os_defines.h
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/config/os/gnu-linux/bits/os_defines.h,v
retrieving revision 1.4
diff -p -c -r1.4 os_defines.h
*** os_defines.h	2000/10/31 01:26:05	1.4
--- os_defines.h	2000/11/21 11:05:58
***************
*** 40,45 ****
--- 40,55 ----
  // This keeps isanum, et al from being propagated as macros.
  #define __NO_CTYPE 1
  
+ #include <sys/types.h>
+ 
+ #if !defined (__GLIBC__) || (__GLIBC__ == 2 && __GLIBC_MINOR__+0 == 0)
+ /* The types __off_t and __off64_t are not defined through <sys/types.h>
+    for libc5 and glibc 2.0; instead use <gnu/types.h> and the old name for
+    __off64_t.  */
+ #include <gnu/types.h>
+ typedef __loff_t __off64_t;
+ #endif /* not glibc 2.1 or higher.  */
+ 
  # if defined __GLIBC__ && __GLIBC__ >= 2
  // We must not see the optimized string functions GNU libc defines.
  #  define __NO_STRING_INLINES

Index: libio.h
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/libio/libio.h,v
retrieving revision 1.11
diff -p -c -r1.11 libio.h
*** libio.h	2000/10/29 21:52:54	1.11
--- libio.h	2000/11/21 11:18:43
***************
*** 55,69 ****
  # endif /* __GNUC_VA_LIST */
  #endif
  
! #ifndef __P
  # ifdef __cplusplus
  #  define __THROW throw ()
  # else
  #  define __THROW
  # endif
  # define __P(p) p __THROW
  # define __PMT(p) p
! #endif /*!__P*/
  
  /* For backward compatibility */
  #ifndef _PARAMS
--- 55,75 ----
  # endif /* __GNUC_VA_LIST */
  #endif
  
! #ifndef __THROW
  # ifdef __cplusplus
  #  define __THROW throw ()
  # else
  #  define __THROW
  # endif
+ #endif /* not __THROW */
+ 
+ #ifndef __P
  # define __P(p) p __THROW
+ #endif /* not __P */
+ 
+ #ifndef __PMT
  # define __PMT(p) p
! #endif /* not __PMT */
  
  /* For backward compatibility */
  #ifndef _PARAMS
*************** extern void _IO_cookie_init (struct _IO_
*** 397,405 ****
  extern "C" {
  #endif
  
! extern int __underflow (_IO_FILE *) __THROW;
  extern int __uflow (_IO_FILE *) __THROW;
! extern int __overflow (_IO_FILE *, int) __THROW;
  extern _IO_wint_t __wunderflow (_IO_FILE *) __THROW;
  extern _IO_wint_t __wuflow (_IO_FILE *) __THROW;
  extern _IO_wint_t __woverflow (_IO_FILE *, _IO_wint_t) __THROW;
--- 403,415 ----
  extern "C" {
  #endif
  
! /* The absence of __THROW specifiers on __underflow and __overflow is
!    because those are declared in system headers on some systems without
!    any throw-specifier.  Those functions are not called from C++ within
!    libio anyway, so a throw specifier is redundant.  */
! extern int __underflow (_IO_FILE *);
  extern int __uflow (_IO_FILE *) __THROW;
! extern int __overflow (_IO_FILE *, int);
  extern _IO_wint_t __wunderflow (_IO_FILE *) __THROW;
  extern _IO_wint_t __wuflow (_IO_FILE *) __THROW;
  extern _IO_wint_t __woverflow (_IO_FILE *, _IO_wint_t) __THROW;

brgds, H-P


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