gcc/ginclude/stddef.h fix for BSD/OS

Shigeya Suzuki shigeya@foretune.co.jp
Sat Apr 4 15:05:00 GMT 1998


>>>>> "law" == Jeffrey A Law <law@hurl.cygnus.com> writes:

law> Doesn't BSDI define BSD_NET2, ____386BSD____?  

Checked.

See below. on the gcc2 come with distribution, yes. Looks bit odd for
me.  I believe that they have defined them in old distributions..


The problem I'm facing is, I can't compile libstdc++/stdexcepti.cc
because in string.h..

typedef    size_t;		/* note no size declarator */

And it was start happening around of end of January snapshot. I was
trying to figure out why this happend and finally resolved by
replacing gcc/ginclude/stddef.h with the one comes with system (system
also uses gcc so no harm). 

I found that to add __bsdi__ to ginclude/stddef.h will solve this
problem (at least on my home machine, almost same configuration) and
triple checked that on my machine and submitted the patch.

Now I still have same problem on my office PC... Now I found stdlibc++ 
is compiled with just built egcs and it defines ___386BSD__ and
such... what's happening? I'll look into this problem today..

shigeya

------------------------------

/*	BSDI bsdi.h,v 2.1 1995/02/03 11:06:41 polk Exp	*/

/* Configuration for an i386 running BSDI 1.1 as the target machine.  */

/* Don't assume anything about the header files. */
/* (not actually used on bsdi, but should generally be on anyway) */
#define	NO_IMPLICIT_EXTERN_C

/* Emulator does not handle sqrt, sin, cos; default to library */
#define	TARGET_CPU_DEFAULT	MASK_NO_FANCY_MATH_387

/* This is tested by i386gas.h.  */
#define YES_UNDERSCORES

#include "i386/gstabs.h"

/* Get perform_* macros to build libgcc.a.  */
#include "i386/perform.h"

#undef CPP_PREDEFINES
#define CPP_PREDEFINES "-Dunix -D__i386__ -Di386 -D__bsdi__ -Dbsdi -Asystem(unix) -Asystem(bsd) -Acpu(i386) -Amachine(i386)"

/* Like the default, except no -lg.  */
#define LIB_SPEC "%{pg:-lc_p}%{!pg:%{p:-lc_p}%{!p:-lc}}"

/* There is no mcrt0.o; we always use gcrt0.o for profiling. */
#define	STARTFILE_SPEC "%{pg:gcrt0.o%s}%{!pg:%{p:gcrt0.o%s}%{!p:crt0.o%s}}"

#undef SIZE_TYPE
#define SIZE_TYPE "unsigned int"

#undef PTRDIFF_TYPE
#define PTRDIFF_TYPE "int"

#undef WCHAR_TYPE
#define WCHAR_TYPE "int"

#define WCHAR_UNSIGNED 0

#undef WCHAR_TYPE_SIZE
#define WCHAR_TYPE_SIZE 32

/* turns on `#pragma weak', among others -- not yet tested */
/* #define HANDLE_SYSV_PRAGMA */

/* BSD/OS does have atexit and strerror. */
#define HAVE_ATEXIT
#define	HAVE_STRERROR

/* Redefine this to use %eax instead of %edx.  */
#undef FUNCTION_PROFILER
#define FUNCTION_PROFILER(FILE, LABELNO)  \
{									\
  if (flag_pic)								\
    {									\
      fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%eax\n",		\
	       LPREFIX, (LABELNO));					\
      fprintf (FILE, "\tcall *mcount@GOT(%%ebx)\n");			\
    }									\
  else									\
    {									\
      fprintf (FILE, "\tmovl $%sP%d,%%eax\n", LPREFIX, (LABELNO));	\
      fprintf (FILE, "\tcall mcount\n");				\
    }									\
}

/* There are conflicting reports about whether this system uses
   a different assembler syntax.  wilson@cygnus.com says # is right.  */
#undef COMMENT_BEGIN
#define COMMENT_BEGIN "#"

#undef ASM_APP_ON
#define ASM_APP_ON "#APP\n"

#undef ASM_APP_OFF
#define ASM_APP_OFF "#NO_APP\n"

/* The following macros are stolen from i386v4.h */
/* These have to be defined to get PIC code correct */

/* This is how to output an element of a case-vector that is relative.
   This is only used for PIC code.  See comments by the `casesi' insn in
   i386.md for an explanation of the expression this outputs. */

#undef ASM_OUTPUT_ADDR_DIFF_ELT
#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) \
  fprintf (FILE, "\t.long _GLOBAL_OFFSET_TABLE_+[.-%s%d]\n", LPREFIX, VALUE)

/* Indicate that jump tables go in the text section.  This is
   necessary when compiling PIC code.  */

#define JUMP_TABLES_IN_TEXT_SECTION

/* Don't default to pcc-struct-return, because gcc is the only compiler, and
   we want to retain compatibility with older gcc versions.  */
#define DEFAULT_PCC_STRUCT_RETURN 0



More information about the Gcc-bugs mailing list