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


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


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