public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* gcc3.2.1 compilation failure on FreeBSD 5.0
@ 2003-01-27 17:14 Karel Gardas
  2003-01-28  3:01 ` Gerald Pfeifer
  0 siblings, 1 reply; 9+ messages in thread
From: Karel Gardas @ 2003-01-27 17:14 UTC (permalink / raw)
  To: GCC Mailing List


Hello,

While trying to build gcc3.2.1 on FreeBSD 5.0 box, I've found that
compilation fails with:

mkinstalldirs='/bin/sh ../../gcc-3.2.1/gcc/mkinstalldirs' \
  /bin/sh mklibgcc > tmp-libgcc.mk
mv tmp-libgcc.mk libgcc.mk
HEADERS="ansidecl.h  i386/i386.h i386/att.h dbxelf.h elfos.h freebsd5.h
freebsd-spec.h freebsd.h i386/freebsd.h defaults.h" DEFINES="POSIX" \
TARGET_CPU_DEFAULT="" \
/bin/sh ../../gcc-3.2.1/gcc/mkconfig.sh tconfig.h
./xgcc -B./
-B/home/kgardas/usr/local/gcc3.2.1/i386-unknown-freebsd5.0/bin/ -isystem
/home/kgardas/usr/local/gcc3.2.1/i386-unknown-freebsd5.0/include -isystem
/home/kgardas/usr/local/gcc3.2.1/i386-unknown-freebsd5.0/sys-include -O2
-DIN_GCC    -W -Wall -Wwrite-strings -Wstrict-prototypes
-Wmissing-prototypes -isystem ./include  -I. -I. -I../../gcc-3.2.1/gcc
-I../../gcc-3.2.1/gcc/. -I../../gcc-3.2.1/gcc/config
-I../../gcc-3.2.1/gcc/../include  -g0 -finhibit-size-directive
-fno-inline-functions -fno-exceptions  \
   -c ../../gcc-3.2.1/gcc/crtstuff.c -DCRT_BEGIN \
  -o crtbegin.o
In file included from ../../gcc-3.2.1/gcc/tsystem.h:37,
                 from ../../gcc-3.2.1/gcc/crtstuff.c:62:
include/stddef.h:57:26: machine/ansi.h: No such file or directory
gmake[2]: *** [crtbegin.o] Error 1
gmake[2]: Leaving directory `/usr/home/kgardas/usr/src/obj/gcc'
gmake[1]: *** [stage1_build] Error 2
gmake[1]: Leaving directory `/usr/home/kgardas/usr/src/obj/gcc'
gmake: *** [bootstrap-lean] Error 2


I've configured gcc with ganymed% ../gcc-3.2.1/configure
--prefix=$HOME/usr/local/gcc3.2.1 --enable-shared --enable-threads
--enable-languages=c++


JFYI: our software compilation fails on this box while compiled with
system supplied gcc3.2.1:

ganymed% gcc -v
Using built-in specs.
Configured with: FreeBSD/i386 system compiler
Thread model: posix
gcc version 3.2.1 [FreeBSD] 20021119 (release)
ganymed%


So I'd like to verify that it's not the bug of _this_ compiler. On the
other hand our software is perfectly compilable by using gcc3.2.1 on both
Debian GNU/Linux 3.0 and FreeBSD 4.7

Any hint, what should I do to compile real gcc3.2.1 release on FB5?

Thanks a lot,

Karel
--
Karel Gardas                  kgardas@objectsecurity.com
ObjectSecurity Ltd.           http://www.objectsecurity.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: gcc3.2.1 compilation failure on FreeBSD 5.0
  2003-01-27 17:14 gcc3.2.1 compilation failure on FreeBSD 5.0 Karel Gardas
@ 2003-01-28  3:01 ` Gerald Pfeifer
  2003-01-28  3:35   ` Joe Buck
                     ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Gerald Pfeifer @ 2003-01-28  3:01 UTC (permalink / raw)
  To: GCC Mailing List, Karel Gardas; +Cc: Gabriel Dos Reis, Loren J. Rittle

On Mon, 27 Jan 2003, Karel Gardas wrote:
> While trying to build gcc3.2.1 on FreeBSD 5.0 box, I've found that
> compilation fails with:
> [...]
> In file included from ../../gcc-3.2.1/gcc/tsystem.h:37,
>                  from ../../gcc-3.2.1/gcc/crtstuff.c:62:
> include/stddef.h:57:26: machine/ansi.h: No such file or directory
> gmake[2]: *** [crtbegin.o] Error 1
> gmake[2]: Leaving directory `/usr/home/kgardas/usr/src/obj/gcc'
> gmake[1]: *** [stage1_build] Error 2
> gmake[1]: Leaving directory `/usr/home/kgardas/usr/src/obj/gcc'
> gmake: *** [bootstrap-lean] Error 2

This is because FSF GCC lacks the patch below on the 3.2 release branch

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?

(Karel, would you mind testing this patch? I do not have a FreeBSD 5
system handy.)

Thanks,
Gerald


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

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

Index: stddef.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ginclude/stddef.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -p -r1.15 -r1.16
--- stddef.h	2 Aug 2002 06:09:14 -0000	1.15
+++ 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.
@@ -176,6 +180,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_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_
@@ -192,10 +197,15 @@ typedef __PTRDIFF_TYPE__ ptrdiff_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
@@ -209,6 +219,7 @@ 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_ */
@@ -243,6 +254,7 @@ typedef long ssize_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
@@ -263,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
@@ -281,7 +294,7 @@ typedef long ssize_t;
 typedef _BSD_RUNE_T_ rune_t;
 #define _BSD_WCHAR_T_DEFINED_
 #define _BSD_RUNE_T_DEFINED_	/* Darwin */
-#if defined (__FreeBSD__)
+#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
@@ -291,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
@@ -304,6 +330,7 @@ typedef __WCHAR_TYPE__ wchar_t;
 #endif
 #endif
 #endif
+#endif /* _WCHAR_T_DECLARED */
 #endif /* _BSD_RUNE_T_DEFINED_ */
 #endif
 #endif

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: gcc3.2.1 compilation failure on FreeBSD 5.0
  2003-01-28  3:01 ` Gerald Pfeifer
@ 2003-01-28  3:35   ` Joe Buck
  2003-01-28 19:40     ` Gerald Pfeifer
  2003-01-28  5:00   ` Gabriel Dos Reis
  2003-01-28  7:35   ` Karel Gardas
  2 siblings, 1 reply; 9+ messages in thread
From: Joe Buck @ 2003-01-28  3:35 UTC (permalink / raw)
  To: Gerald Pfeifer; +Cc: gcc

On Tue, Jan 28, 2003 at 02:38:27AM +0100, Gerald Pfeifer wrote:
> This is because FSF GCC lacks the patch below on the 3.2 release branch
> 
> 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?

Is there a PR for this issue?  Might be nice to make one even if we immediately
close it, just so the release notes can point to it and people can read
about the issue that was fixed.
 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: gcc3.2.1 compilation failure on FreeBSD 5.0
  2003-01-28  3:01 ` Gerald Pfeifer
  2003-01-28  3:35   ` Joe Buck
@ 2003-01-28  5:00   ` Gabriel Dos Reis
  2003-01-28 14:04     ` Gerald Pfeifer
  2003-01-28  7:35   ` Karel Gardas
  2 siblings, 1 reply; 9+ messages in thread
From: Gabriel Dos Reis @ 2003-01-28  5:00 UTC (permalink / raw)
  To: Gerald Pfeifer; +Cc: GCC Mailing List, Karel Gardas, Loren J. Rittle

Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at> writes:

| On Mon, 27 Jan 2003, Karel Gardas wrote:
| > While trying to build gcc3.2.1 on FreeBSD 5.0 box, I've found that
| > compilation fails with:
| > [...]
| > In file included from ../../gcc-3.2.1/gcc/tsystem.h:37,
| >                  from ../../gcc-3.2.1/gcc/crtstuff.c:62:
| > include/stddef.h:57:26: machine/ansi.h: No such file or directory
| > gmake[2]: *** [crtbegin.o] Error 1
| > gmake[2]: Leaving directory `/usr/home/kgardas/usr/src/obj/gcc'
| > gmake[1]: *** [stage1_build] Error 2
| > gmake[1]: Leaving directory `/usr/home/kgardas/usr/src/obj/gcc'
| > gmake: *** [bootstrap-lean] Error 2
| 
| This is because FSF GCC lacks the patch below on the 3.2 release branch
| 
| 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 

   ***************
   *** 176,181 ****
     #ifndef _SIZE_T_DEFINED_
     #ifndef _SIZE_T_DEFINED
     #ifndef _BSD_SIZE_T_DEFINED_	/* Darwin */
     #ifndef ___int_size_t_h
     #ifndef _GCC_SIZE_T
     #ifndef _SIZET_
   --- 180,186 ----
     #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_
   ***************
   *** 192,201 ****
     #define _SIZE_T_DEFINED_
     #define _SIZE_T_DEFINED
     #define _BSD_SIZE_T_DEFINED_	/* Darwin */
     #define ___int_size_t_h
     #define _GCC_SIZE_T
     #define _SIZET_
     #define __size_t
     #ifndef __SIZE_TYPE__
     #define __SIZE_TYPE__ long unsigned int
     #endif
   --- 197,211 ----
     #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
   ***************
   *** 209,214 ****
     #endif /* _SIZET_ */
     #endif /* _GCC_SIZE_T */
     #endif /* ___int_size_t_h */
     #endif /* _BSD_SIZE_T_DEFINED_ */
     #endif /* _SIZE_T_DEFINED */
     #endif /* _SIZE_T_DEFINED_ */
   --- 219,225 ----
     #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_ */
   ***************
   *** 243,248 ****
     #ifndef _BSD_WCHAR_T_
     #ifndef _BSD_WCHAR_T_DEFINED_    /* Darwin */
     #ifndef _BSD_RUNE_T_DEFINED_	/* Darwin */
     #ifndef _WCHAR_T_DEFINED_
     #ifndef _WCHAR_T_DEFINED
     #ifndef _WCHAR_T_H
   --- 254,260 ----
     #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
   ***************
   *** 277,283 ****
     typedef _BSD_RUNE_T_ rune_t;
     #define _BSD_WCHAR_T_DEFINED_
     #define _BSD_RUNE_T_DEFINED_	/* Darwin */
   - #if defined (__FreeBSD__)
     /* 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
   --- 290,296 ----
     typedef _BSD_RUNE_T_ rune_t;
     #define _BSD_WCHAR_T_DEFINED_
     #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
   ***************
   *** 299,304 ****
     #endif
     #endif
     #endif
     #endif /* _BSD_RUNE_T_DEFINED_ */
     #endif
     #endif
   --- 325,331 ----
     #endif
     #endif
     #endif
   + #endif /* _WCHAR_T_DECLARED */
     #endif /* _BSD_RUNE_T_DEFINED_ */
     #endif
     #endif

The problem seems to be that the lines

     #ifndef _BSD_SIZE_T_DEFINED_	/* Darwin */
     #define _BSD_SIZE_T_DEFINED_	/* Darwin */
     #ifndef _BSD_RUNE_T_DEFINED_	/* Darwin */
     #define _BSD_RUNE_T_DEFINED_	/* Darwin */

are missing from gcc-3_2-branch version of stddef.h.  Presumably they
were added on the other branches to solve some problems.  
I don't have access to a FreeBSD box, please could you or a FreeBSD folk
test a modified version of that patch against 3.2.2 and send a patch
against 3.2.2.? 

Thanks,

-- Gaby

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: gcc3.2.1 compilation failure on FreeBSD 5.0
  2003-01-28  3:01 ` Gerald Pfeifer
  2003-01-28  3:35   ` Joe Buck
  2003-01-28  5:00   ` Gabriel Dos Reis
@ 2003-01-28  7:35   ` Karel Gardas
  2 siblings, 0 replies; 9+ messages in thread
From: Karel Gardas @ 2003-01-28  7:35 UTC (permalink / raw)
  To: GCC Mailing List

On Tue, 28 Jan 2003, Gerald Pfeifer wrote:

> On Mon, 27 Jan 2003, Karel Gardas wrote:
> > While trying to build gcc3.2.1 on FreeBSD 5.0 box, I've found that
> > compilation fails with:
> > [...]
> > In file included from ../../gcc-3.2.1/gcc/tsystem.h:37,
> >                  from ../../gcc-3.2.1/gcc/crtstuff.c:62:
> > include/stddef.h:57:26: machine/ansi.h: No such file or directory
> > gmake[2]: *** [crtbegin.o] Error 1
> > gmake[2]: Leaving directory `/usr/home/kgardas/usr/src/obj/gcc'
> > gmake[1]: *** [stage1_build] Error 2
> > gmake[1]: Leaving directory `/usr/home/kgardas/usr/src/obj/gcc'
> > gmake: *** [bootstrap-lean] Error 2
>
> This is because FSF GCC lacks the patch below on the 3.2 release branch
>
> 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?
>
> (Karel, would you mind testing this patch? I do not have a FreeBSD 5
> system handy.)
>

I'll of course test it, but later today, when I can access our FB5 box
again. I'll provide feedback asap.

Thanks,

Karel
--
Karel Gardas                  kgardas@objectsecurity.com
ObjectSecurity Ltd.           http://www.objectsecurity.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: gcc3.2.1 compilation failure on FreeBSD 5.0
  2003-01-28  5:00   ` Gabriel Dos Reis
@ 2003-01-28 14:04     ` Gerald Pfeifer
  2003-01-28 14:07       ` Gabriel Dos Reis
  0 siblings, 1 reply; 9+ messages in thread
From: Gerald Pfeifer @ 2003-01-28 14:04 UTC (permalink / raw)
  To: Gabriel Dos Reis; +Cc: gcc, Karel Gardas, Loren J. Rittle

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: gcc3.2.1 compilation failure on FreeBSD 5.0
  2003-01-28 14:04     ` Gerald Pfeifer
@ 2003-01-28 14:07       ` Gabriel Dos Reis
  2003-01-28 14:13         ` Karel Gardas
  0 siblings, 1 reply; 9+ messages in thread
From: Gabriel Dos Reis @ 2003-01-28 14:07 UTC (permalink / raw)
  To: Gerald Pfeifer; +Cc: gcc, Karel Gardas, Loren J. Rittle

Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at> writes:

| 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!

No need to sorry.

| 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).

Patch applied.

I'll make a new pre-release tonight so that FreeBSD folks can test.

Thanks,

-- Gaby

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: gcc3.2.1 compilation failure on FreeBSD 5.0
  2003-01-28 14:07       ` Gabriel Dos Reis
@ 2003-01-28 14:13         ` Karel Gardas
  0 siblings, 0 replies; 9+ messages in thread
From: Karel Gardas @ 2003-01-28 14:13 UTC (permalink / raw)
  To: Gabriel Dos Reis; +Cc: Gerald Pfeifer, gcc, Loren J. Rittle

On Tue, 28 Jan 2003, Gabriel Dos Reis wrote:

> | 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).
>
> Patch applied.
>

JFYI: I've applied the patch into gcc3.2.1 source tree and build gcc
sucessfully (only c/c++):

ganymed% c++ -v
Reading specs from /home/kgardas/usr/local/gcc3.2.1/lib/gcc-lib/i386-unknown-freebsd5.0/3.2.1/specs
Configured with: ../gcc-3.2.1/configure --prefix=/home/kgardas/usr/local/gcc3.2.1 --enable-shared --enable-threads --enable-languages=c++
Thread model: posix
gcc version 3.2.1
ganymed%


Thanks all for your time,

Karel
--
Karel Gardas                  kgardas@objectsecurity.com
ObjectSecurity Ltd.           http://www.objectsecurity.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: gcc3.2.1 compilation failure on FreeBSD 5.0
  2003-01-28  3:35   ` Joe Buck
@ 2003-01-28 19:40     ` Gerald Pfeifer
  0 siblings, 0 replies; 9+ messages in thread
From: Gerald Pfeifer @ 2003-01-28 19:40 UTC (permalink / raw)
  To: Joe Buck; +Cc: gcc

On Mon, 27 Jan 2003, Joe Buck wrote:
> Is there a PR for this issue?  Might be nice to make one even if we
> immediately close it, just so the release notes can point to it and
> people can read about the issue that was fixed.

I just created (and closed) bootstrap/9484.

Not too many users should have experienced this, at FreeBSD 5.0 uses (a
variant of) GCC 3.2.1 as system compiler and the change in FreeBSD that
broke 3.2.1 was just a few months old.

Gerald

(Still, I'm starting to be annoyed by clean-up vendettas, whose primary
result is breakage of other packages, GCC in this case. This one alone
cost me, and others, hours. :-( )
-- 
Gerald "Jerry"   pfeifer@dbai.tuwien.ac.at   http://www.pfeifer.com/gerald/

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2003-01-28 17:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-27 17:14 gcc3.2.1 compilation failure on FreeBSD 5.0 Karel Gardas
2003-01-28  3:01 ` Gerald Pfeifer
2003-01-28  3:35   ` Joe Buck
2003-01-28 19:40     ` Gerald Pfeifer
2003-01-28  5:00   ` Gabriel Dos Reis
2003-01-28 14:04     ` Gerald Pfeifer
2003-01-28 14:07       ` Gabriel Dos Reis
2003-01-28 14:13         ` Karel Gardas
2003-01-28  7:35   ` Karel Gardas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).