This is the mail archive of the gcc@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: gcc3.2.1 compilation failure on FreeBSD 5.0


On Tue, 28 Jan 2003, Gabriel Dos Reis wrote:
>| Gaby, this patch is most critical for 3.2.2 on FreeBSD 5; without it, GCC
>| won't build at all.  Would you mind applying it?
> Sure, I would like to apply it.  I just need to sort out  the
> following issue.  The patch you appended doesn't seem to be done
> against gcc-3_2-branch.  In particular, the following hunks were
> rejected

Sorry Gaby!

I now obtained guest access to a FreeBSD 5.0 box and verified that the
following patches from mainline apply to the 3.2-branch and allow a full
bootstrap (without treelang and Ada).

The difference wrt. to the previous patchset is the second hunk which was
added after 3.1/3.2 branched from mainline.

Gerald


2002-10-04  Loren J. Rittle  <ljrittle@acm.org>

	* gcc/ginclude/stddef.h: Support the FreeBSD 5 typedef system.

2002-08-01  Stan Shebs  <shebs@apple.com>
            Andreas Tobler  <toa@pop.agri.ch>

	* ginclude/stddef.h (_BSD_SIZE_T_DEFINED_): Define if not defined,
	plays nice with Darwin headers.
	(_BSD_RUNE_T_DEFINED_): Likewise.

Index: stddef.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ginclude/stddef.h,v
retrieving revision 1.14
retrieving revision 1.16
diff -u -3 -p -r1.14 -r1.16
--- stddef.h	9 Jan 2002 04:56:25 -0000	1.14
+++ stddef.h	4 Oct 2002 21:16:05 -0000	1.16
@@ -1,4 +1,4 @@
-/* Copyright (C) 1989, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1989, 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc.

 This file is part of GNU CC.

@@ -53,9 +53,13 @@ Boston, MA 02111-1307, USA.  */

 /* On 4.3bsd-net2, make sure ansi.h is included, so we have
    one less case to deal with in the following.  */
-#if defined (__BSD_NET2__) || defined (____386BSD____) || defined (__FreeBSD__) || defined(__NetBSD__)
+#if defined (__BSD_NET2__) || defined (____386BSD____) || (defined (__FreeBSD__) && (__FreeBSD__ < 5)) || defined(__NetBSD__)
 #include <machine/ansi.h>
 #endif
+/* On FreeBSD 5, machine/ansi.h does not exist anymore... */
+#if defined (__FreeBSD__) && (__FreeBSD__ >= 5)
+#include <sys/_types.h>
+#endif

 /* In 4.3bsd-net2, machine/ansi.h defines these symbols, which are
    defined if the corresponding type is *not* defined.
@@ -175,6 +179,8 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
 #ifndef _BSD_SIZE_T_
 #ifndef _SIZE_T_DEFINED_
 #ifndef _SIZE_T_DEFINED
+#ifndef _BSD_SIZE_T_DEFINED_	/* Darwin */
+#ifndef _SIZE_T_DECLARED	/* FreeBSD 5 */
 #ifndef ___int_size_t_h
 #ifndef _GCC_SIZE_T
 #ifndef _SIZET_
@@ -190,10 +196,16 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
 #define _BSD_SIZE_T_
 #define _SIZE_T_DEFINED_
 #define _SIZE_T_DEFINED
+#define _BSD_SIZE_T_DEFINED_	/* Darwin */
+#define _SIZE_T_DECLARED	/* FreeBSD 5 */
 #define ___int_size_t_h
 #define _GCC_SIZE_T
 #define _SIZET_
+#if defined (__FreeBSD__) && (__FreeBSD__ >= 5)
+/* __size_t is a typedef on FreeBSD 5!, must not trash it. */
+#else
 #define __size_t
+#endif
 #ifndef __SIZE_TYPE__
 #define __SIZE_TYPE__ long unsigned int
 #endif
@@ -207,6 +219,8 @@ typedef long ssize_t;
 #endif /* _SIZET_ */
 #endif /* _GCC_SIZE_T */
 #endif /* ___int_size_t_h */
+#endif /* _SIZE_T_DECLARED */
+#endif /* _BSD_SIZE_T_DEFINED_ */
 #endif /* _SIZE_T_DEFINED */
 #endif /* _SIZE_T_DEFINED_ */
 #endif /* _BSD_SIZE_T_ */
@@ -239,6 +253,8 @@ typedef long ssize_t;
 #ifndef _WCHAR_T_
 #ifndef _BSD_WCHAR_T_
 #ifndef _BSD_WCHAR_T_DEFINED_    /* Darwin */
+#ifndef _BSD_RUNE_T_DEFINED_	/* Darwin */
+#ifndef _WCHAR_T_DECLARED /* FreeBSD 5 */
 #ifndef _WCHAR_T_DEFINED_
 #ifndef _WCHAR_T_DEFINED
 #ifndef _WCHAR_T_H
@@ -259,6 +275,7 @@ typedef long ssize_t;
 #define ___int_wchar_t_h
 #define __INT_WCHAR_T_H
 #define _GCC_WCHAR_T
+#define _WCHAR_T_DECLARED

 /* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_
    instead of _WCHAR_T_, and _BSD_RUNE_T_ (which, unlike the other
@@ -276,7 +293,8 @@ typedef long ssize_t;
 #if !defined (_ANSI_SOURCE) && !defined (_POSIX_SOURCE)
 typedef _BSD_RUNE_T_ rune_t;
 #define _BSD_WCHAR_T_DEFINED_
-#if defined (__FreeBSD__)
+#define _BSD_RUNE_T_DEFINED_	/* Darwin */
+#if defined (__FreeBSD__) && (__FreeBSD__ < 5)
 /* Why is this file so hard to maintain properly?  In constrast to
    the comment above regarding BSD/386 1.1, on FreeBSD for as long
    as the symbol has existed, _BSD_RUNE_T_ must not stay defined or
@@ -286,6 +304,19 @@ typedef _BSD_RUNE_T_ rune_t;
 #endif
 #endif
 #endif
+/* FreeBSD 5 can't be handled well using "traditional" logic above
+   since it no longer defines _BSD_RUNE_T_ yet still desires to export
+   rune_t in some cases... */
+#if defined (__FreeBSD__) && (__FreeBSD__ >= 5)
+#if !defined (_ANSI_SOURCE) && !defined (_POSIX_SOURCE)
+#if __BSD_VISIBLE
+#ifndef _RUNE_T_DECLARED
+typedef __rune_t        rune_t;
+#define _RUNE_T_DECLARED
+#endif
+#endif
+#endif
+#endif

 #ifndef __WCHAR_TYPE__
 #define __WCHAR_TYPE__ int
@@ -299,6 +330,8 @@ typedef __WCHAR_TYPE__ wchar_t;
 #endif
 #endif
 #endif
+#endif /* _WCHAR_T_DECLARED */
+#endif /* _BSD_RUNE_T_DEFINED_ */
 #endif
 #endif
 #endif


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