From: Richard Kenner Date: Thu, 14 Jul 1994 16:58:37 +0000 (-0400) Subject: Initial revision X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0e3ce1df695bceebc688819066cbc15714c05e06;p=gcc.git Initial revision From-SVN: r7772 --- diff --git a/gcc/config/convex/fixinc.convex b/gcc/config/convex/fixinc.convex new file mode 100644 index 00000000000..0dc5f302c8c --- /dev/null +++ b/gcc/config/convex/fixinc.convex @@ -0,0 +1,416 @@ + +# This is a shell archive. Remove anything before this line, +# then unpack it by saving it in a file and typing "sh file". +# +# Wrapped by on Fri Mar 12 08:41:28 CST 1993 +# Contents: include/ include/limits.h include/math.h include/stddef.h +# include/stdlib.h + +echo mkdir - include +mkdir include +chmod u=rwx,g=rwx,o=rx include + +echo x - include/limits.h +sed 's/^@//' > "include/limits.h" <<'@//E*O*F include/limits.h//' +#ifndef _LIMITS_H +#define _LIMITS_H + +#include_next + +/* Minimum and maximum values a `char' can hold. */ +#ifdef __CHAR_UNSIGNED__ +#undef CHAR_MIN +#define CHAR_MIN 0 +#undef CHAR_MAX +#define CHAR_MAX 255 +#endif + +#endif /* _LIMITS_H */ +@//E*O*F include/limits.h// +chmod u=rw,g=rw,o=r include/limits.h + +echo x - include/math.h +sed 's/^@//' > "include/math.h" <<'@//E*O*F include/math.h//' +#ifndef _MATH_H +#define _MATH_H + +#include_next + +#undef HUGE_VAL + +#if _IEEE_FLOAT_ +#define HUGE_VAL 1.79769313486231570e+308 +#else +#define HUGE_VAL 8.98846567431157854e+307 +#endif + +#if __OPTIMIZE__ && ! __NO_INLINE + +#define frexp(x,y) __inline_frexp ((x), (y)) +#define ldexp(x,y) __inline_ldexp ((x), (y)) +#define irint(x) __inline_irint (x) +#define frexpf(x,y) __inline_frexpf ((x), (y)) +#define ldexpf(x,y) __inline_ldexpf ((x), (y)) +#define irintf(x) __inline_irintf (x) + +#if __convex_c2__ || __convex_c32__ || __convex_c34__ || __convex_c38__ + +#define atan(x) __inline_atan (x) +#define ceil(x) __inline_ceil (x) +#define cos(x) __inline_cos (x) +#define exp(x) __inline_exp (x) +#define floor(x) __inline_floor (x) +#define log(x) __inline_log (x) +#define log10(x) __inline_log10 (x) +#define modf(x,y) __inline_modf ((x), (y)) +#define rint(x) __inline_rint (x) +#define sin(x) __inline_sin (x) +#define sqrt(x) __inline_sqrt (x) + +#define atanf(x) __inline_atanf (x) +#define ceilf(x) __inline_ceilf (x) +#define cosf(x) __inline_cosf (x) +#define expf(x) __inline_expf (x) +#define floorf(x) __inline_floorf (x) +#define logf(x) __inline_logf (x) +#define log10f(x) __inline_log10f (x) +#define modff(x,y) __inline_modff ((x), (y)) +#define rintf(x) __inline_rintf (x) +#define sinf(x) __inline_sinf (x) +#define sqrtf(x) __inline_sqrtf (x) + +#endif /* __convex_c[23*]__ */ + +#endif /* __OPTIMIZE__ */ + +static __inline__ __const__ double __inline_atan (double x) +{ + double z; + __asm__ ("atan.d %0" : "=d" (z) : "0" (x)); + return z; +} + +static __inline__ __const__ float __inline_atanf (float x) +{ + float z; + __asm__ ("atan.s %0" : "=d" (z) : "0" (x)); + return z; +} + +static __inline__ __const__ double __inline_cos (double x) +{ + double z; + __asm__ ("cos.d %0" : "=d" (z) : "0" (x)); + return z; +} + +static __inline__ __const__ float __inline_cosf (float x) +{ + float z; + __asm__ ("cos.s %0" : "=d" (z) : "0" (x)); + return z; +} + +static __inline__ __const__ double __inline_exp (double x) +{ + double z; + __asm__ ("exp.d %0" : "=d" (z) : "0" (x)); + return z; +} + +static __inline__ __const__ float __inline_expf (float x) +{ + float z; + __asm__ ("exp.s %0" : "=d" (z) : "0" (x)); + return z; +} + +static __inline__ __const__ double __inline_log (double x) +{ + double z; + __asm__ ("ln.d %0" : "=d" (z) : "0" (x)); + return z; +} + +static __inline__ __const__ float __inline_logf (float x) +{ + float z; + __asm__ ("ln.s %0" : "=d" (z) : "0" (x)); + return z; +} + +static __inline__ __const__ double __inline_sin (double x) +{ + double z; + __asm__ ("sin.d %0" : "=d" (z) : "0" (x)); + return z; +} + +static __inline__ __const__ float __inline_sinf (float x) +{ + float z; + __asm__ ("sin.s %0" : "=d" (z) : "0" (x)); + return z; +} + +static __inline__ __const__ double __inline_sqrt (double x) +{ + double z; + __asm__ ("sqrt.d %0" : "=d" (z) : "0" (x)); + return z; +} + +static __inline__ __const__ float __inline_sqrtf (float x) +{ + float z; + __asm__ ("sqrt.s %0" : "=d" (z) : "0" (x)); + return z; +} + +static __inline__ __const__ double __inline_ceil (double x) +{ + double z; + __asm__ ("frint.d %1,%0" : "=d" (z) : "d" (x)); + if (z < x) z += 1.0; + return z; +} + +static __inline__ __const__ float __inline_ceilf (float x) +{ + float z; + __asm__ ("frint.s %1,%0" : "=d" (z) : "d" (x)); + if (z < x) z += 1.0F; + return z; +} + +static __inline__ __const__ double __inline_floor (double x) +{ + double z; + __asm__ ("frint.d %1,%0" : "=d" (z) : "d" (x)); + if (z > x) z -= 1.0; + return z; +} + +static __inline__ __const__ float __inline_floorf (float x) +{ + float z; + __asm__ ("frint.s %1,%0" : "=d" (z) : "d" (x)); + if (z > x) z -= 1.0F; + return z; +} + +static __inline__ __const__ double __inline_log10 (double x) +{ + return 0.43429448190325182765 * __inline_log (x); +} + +static __inline__ __const__ float __inline_log10f (float x) +{ + return 0.43429448190325182765F * __inline_logf (x); +} + +static __inline__ double __inline_modf (double x, double *np) +{ + double intpart; + __asm__ ("frint.d %1,%0" : "=d" (intpart) : "d" (x)); + *np = intpart; + return x - intpart; +} + +static __inline__ float __inline_modff (float x, float *np) +{ + float intpart; + __asm__ ("frint.s %1,%0" : "=d" (intpart) : "d" (x)); + *np = intpart; + return x - intpart; +} + +static __inline__ double __inline_frexp (double x, int *np) +{ + union u { double d; unsigned long long ll; } u; + if ((u.d = x) == 0) + *np = 0; + else + { +#if _IEEE_FLOAT_ + *np = ((u.ll >> 52) & 03777) - 01776; + u.ll = (u.ll & 0x800fffffffffffffLL) | 0x3fe0000000000000LL; +#else + *np = ((u.ll >> 52) & 03777) - 02000; + u.ll = (u.ll & 0x800fffffffffffffLL) | 0x4000000000000000LL; +#endif + } + return u.d; +} + +static __inline__ float __inline_frexpf (float x, int *np) +{ + union u { float f; unsigned int i; } u; + if ((u.f = x) == 0) + *np = 0; + else + { +#if _IEEE_FLOAT_ + *np = ((u.i >> 23) & 0377) - 0176; + u.i = (u.i & 0x807fffff) | 0x3f000000; +#else + *np = ((u.i >> 23) & 0377) - 0200; + u.i = (u.i & 0x807fffff) | 0x40000000; +#endif + } + return u.f; +} + +static __inline__ double __inline_ldexp (double x, int n) +{ + extern int errno; + union { double d; long long ll; unsigned sexp : 12; } u; + if ((u.d = x) != 0) + { + int exp = n + (u.sexp & 03777); + long long nn = (long long) n << 52; +#if _IEEE_FLOAT_ + if (exp <= 0) + u.ll &= 0x8000000000000000LL, errno = 34; + else if (exp > 03776) + u.ll = u.ll & 0x8000000000000000LL | 0x7fefffffffffffffLL, errno = 34; +#else + if (exp <= 0) + u.ll = 0, errno = 34; + else if (exp > 03777) + u.ll |= 0x7fffffffffffffffLL, errno = 34; +#endif + else + u.ll += nn; + } + return u.d; +} + +static __inline__ float __inline_ldexpf (float x, int n) +{ + extern int errno; + union { float f; int i; unsigned sexp : 9; } u; + if ((u.f = x) != 0) + { + int exp = n + (u.sexp & 0377); + int nn = n << 23; +#if _IEEE_FLOAT_ + if (exp <= 0) + u.i &= 0x80000000, errno = 34; + else if (exp > 0376) + u.i = u.i & 0x80000000 | 0x7f7fffff, errno = 34; +#else + if (exp <= 0) + u.i = 0, errno = 34; + else if (exp > 0377) + u.i |= 0x7fffffff, errno = 34; +#endif + else + u.i += nn; + } + return u.f; +} + +static __inline__ __const__ double __inline_rint (double x) +{ + double z; + union { double d; unsigned long long ll; } u; + u.d = x; +#if _IEEE_FLOAT_ + u.ll = (u.ll & 0x8000000000000000LL) | 0x3fe0000000000000LL; +#else + u.ll = (u.ll & 0x8000000000000000LL) | 0x4000000000000000LL; +#endif + __asm__ ("frint.d %1,%0" : "=d" (z) : "d" (x + u.d)); + return z; +} + +static __inline__ __const__ float __inline_rintf (float x) +{ + float z; + union { float f; unsigned int i; } u; + u.f = x; +#if _IEEE_FLOAT_ + u.i = (u.i & 0x80000000) | 0x3f000000; +#else + u.i = (u.i & 0x80000000) | 0x40000000; +#endif + __asm__ ("frint.s %1,%0" : "=d" (z) : "d" (x + u.f)); + return z; +} + +static __inline__ __const__ int __inline_irint (double x) +{ + union { double d; unsigned long long ll; } u; + u.d = x; +#if _IEEE_FLOAT_ + u.ll = (u.ll & 0x8000000000000000LL) | 0x3fe0000000000000LL; +#else + u.ll = (u.ll & 0x8000000000000000LL) | 0x4000000000000000LL; +#endif + return x + u.d; +} + +static __inline__ __const__ int __inline_irintf (float x) +{ + union { float f; unsigned int i; } u; + u.f = x; +#if _IEEE_FLOAT_ + u.i = (u.i & 0x80000000) | 0x3f000000; +#else + u.i = (u.i & 0x80000000) | 0x40000000; +#endif + return x + u.f; +} + +#endif /* _MATH_H */ +@//E*O*F include/math.h// +chmod u=rw,g=rw,o=r include/math.h + +echo x - include/stddef.h +sed 's/^@//' > "include/stddef.h" <<'@//E*O*F include/stddef.h//' +#ifndef _STDDEF_H +#define _STDDEF_H + +#ifndef __WCHAR_T +#define __WCHAR_T + +#ifdef __GNUG__ +/* In C++, wchar_t is a distinct basic type, + and we can expect __wchar_t to be defined by cc1plus. */ +typedef __wchar_t wchar_t; +#else +/* In C, cpp tells us which type to make an alias for. */ +typedef __WCHAR_TYPE__ wchar_t; +#endif + +#endif /* __WCHAR_T */ + +#include_next + +#endif /* _STDDEF_H */ +@//E*O*F include/stddef.h// +chmod u=rw,g=rw,o=r include/stddef.h + +echo x - include/stdlib.h +sed 's/^@//' > "include/stdlib.h" <<'@//E*O*F include/stdlib.h//' +#ifndef _STDLIB_H +#define _STDLIB_H + +#if _CONVEX_SOURCE + +#define alloca __non_builtin_alloca +#include_next +#undef alloca + +#else + +#include_next + +#endif /* _CONVEX_SOURCE */ + +#endif /* _STDLIB_H */ +@//E*O*F include/stdlib.h// +chmod u=rw,g=rw,o=r include/stdlib.h + +exit 0 diff --git a/gcc/config/i386/freebsd.h b/gcc/config/i386/freebsd.h new file mode 100644 index 00000000000..98a8d25e108 --- /dev/null +++ b/gcc/config/i386/freebsd.h @@ -0,0 +1,320 @@ +/* Definitions of target machine for GNU compiler for Intel 80386 + running FreeBSD. + Copyright (C) 1988, 1992, 1994 Free Software Foundation, Inc. + Contributed by Poul-Henning Kamp + +This file is part of GNU CC. + +GNU CC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU CC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU CC; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +/* This goes away when the math-emulator is fixed */ +#define TARGET_CPU_DEFAULT 0400 /* TARGET_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 -Di386 -D__FreeBSD__ -D__386BSD__ -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)" + +#define INCLUDE_DEFAULTS { \ + { "/usr/include", 0 }, \ + { "/usr/include/g++", 1 }, \ + { 0, 0} \ + } + +/* Like the default, except no -lg. */ +#define LIB_SPEC "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}" + +#undef SIZE_TYPE +#define SIZE_TYPE "unsigned int" + +#undef PTRDIFF_TYPE +#define PTRDIFF_TYPE "int" + +#undef WCHAR_TYPE +#define WCHAR_TYPE "short unsigned int" + +#define WCHAR_UNSIGNED 1 + +#undef WCHAR_TYPE_SIZE +#define WCHAR_TYPE_SIZE 16 + +#define HAVE_ATEXIT + +/* 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 + +/* + * Some imports from svr4.h in support of shared libraries. + * Currently, we need the DECLARE_OBJECT_SIZE stuff. + */ + +/* Define the strings used for the special svr4 .type and .size directives. + These strings generally do not vary from one system running svr4 to + another, but if a given system (e.g. m88k running svr) needs to use + different pseudo-op names for these, they may be overridden in the + file which includes this one. */ + +#define TYPE_ASM_OP ".type" +#define SIZE_ASM_OP ".size" +#define WEAK_ASM_OP ".weak" + +/* The following macro defines the format used to output the second + operand of the .type assembler directive. Different svr4 assemblers + expect various different forms for this operand. The one given here + is just a default. You may need to override it in your machine- + specific tm.h file (depending upon the particulars of your assembler). */ + +#define TYPE_OPERAND_FMT "@%s" + +/* Write the extra assembler code needed to declare a function's result. + Most svr4 assemblers don't require any special declaration of the + result value, but there are exceptions. */ + +#ifndef ASM_DECLARE_RESULT +#define ASM_DECLARE_RESULT(FILE, RESULT) +#endif + +/* These macros generate the special .type and .size directives which + are used to set the corresponding fields of the linker symbol table + entries in an ELF object file under SVR4. These macros also output + the starting labels for the relevant functions/objects. */ + +/* Write the extra assembler code needed to declare a function properly. + Some svr4 assemblers need to also have something extra said about the + function's return value. We allow for that here. */ + +#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \ + do { \ + fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \ + assemble_name (FILE, NAME); \ + putc (',', FILE); \ + fprintf (FILE, TYPE_OPERAND_FMT, "function"); \ + putc ('\n', FILE); \ + ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \ + ASM_OUTPUT_LABEL(FILE, NAME); \ + } while (0) + +/* Write the extra assembler code needed to declare an object properly. */ + +#define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \ + do { \ + fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \ + assemble_name (FILE, NAME); \ + putc (',', FILE); \ + fprintf (FILE, TYPE_OPERAND_FMT, "object"); \ + putc ('\n', FILE); \ + size_directive_output = 0; \ + if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \ + { \ + size_directive_output = 1; \ + fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \ + assemble_name (FILE, NAME); \ + fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \ + } \ + ASM_OUTPUT_LABEL(FILE, NAME); \ + } while (0) + +/* Output the size directive for a decl in rest_of_decl_compilation + in the case where we did not do so before the initializer. + Once we find the error_mark_node, we know that the value of + size_directive_output was set + by ASM_DECLARE_OBJECT_NAME when it was run for the same decl. */ + +#define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \ +do { \ + char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \ + if (!flag_inhibit_size_directive && DECL_SIZE (DECL) \ + && ! AT_END && TOP_LEVEL \ + && DECL_INITIAL (DECL) == error_mark_node \ + && !size_directive_output) \ + { \ + fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \ + assemble_name (FILE, name); \ + fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL)));\ + } \ + } while (0) + + +/* This is how to declare the size of a function. */ + +#define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \ + do { \ + if (!flag_inhibit_size_directive) \ + { \ + char label[256]; \ + static int labelno; \ + labelno++; \ + ASM_GENERATE_INTERNAL_LABEL (label, "Lfe", labelno); \ + ASM_OUTPUT_INTERNAL_LABEL (FILE, "Lfe", labelno); \ + fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \ + assemble_name (FILE, (FNAME)); \ + fprintf (FILE, ","); \ + assemble_name (FILE, label); \ + fprintf (FILE, "-"); \ + assemble_name (FILE, (FNAME)); \ + putc ('\n', FILE); \ + } \ + } while (0) + +#define ASM_SPEC " %| %{fpic:-k} %{fPIC:-k}" +#define LINK_SPEC \ + "%{!nostdlib:%{!r*:%{!e*:-e start}}} -dc -dp %{static:-Bstatic} %{assert*}" + +/* This section copied from i386/osfrose.h */ + +/* A C statement or compound statement to output to FILE some + assembler code to initialize basic-block profiling for the current + object module. This code should call the subroutine + `__bb_init_func' once per object module, passing it as its sole + argument the address of a block allocated in the object module. + + The name of the block is a local symbol made with this statement: + + ASM_GENERATE_INTERNAL_LABEL (BUFFER, "LPBX", 0); + + Of course, since you are writing the definition of + `ASM_GENERATE_INTERNAL_LABEL' as well as that of this macro, you + can take a short cut in the definition of this macro and use the + name that you know will result. + + The first word of this block is a flag which will be nonzero if the + object module has already been initialized. So test this word + first, and do not call `__bb_init_func' if the flag is nonzero. */ + +#undef FUNCTION_BLOCK_PROFILER +#define FUNCTION_BLOCK_PROFILER(STREAM, LABELNO) \ +do \ + { \ + if (!flag_pic) \ + { \ + fprintf (STREAM, "\tcmpl $0,%sPBX0\n", LPREFIX); \ + fprintf (STREAM, "\tjne 0f\n"); \ + fprintf (STREAM, "\tpushl $%sPBX0\n", LPREFIX); \ + fprintf (STREAM, "\tcall ___bb_init_func\n"); \ + fprintf (STREAM, "0:\n"); \ + } \ + else \ + { \ + fprintf (STREAM, "\tpushl %eax\n"); \ + fprintf (STREAM, "\tmovl %sPBX0@GOT(%ebx),%eax\n"); \ + fprintf (STREAM, "\tcmpl $0,(%eax)\n"); \ + fprintf (STREAM, "\tjne 0f\n"); \ + fprintf (STREAM, "\tpushl %eax\n"); \ + fprintf (STREAM, "\tcall ___bb_init_func@PLT\n"); \ + fprintf (STREAM, "0:\n"); \ + fprintf (STREAM, "\tpopl %eax\n"); \ + } \ + } \ +while (0) + +/* A C statement or compound statement to increment the count + associated with the basic block number BLOCKNO. Basic blocks are + numbered separately from zero within each compilation. The count + associated with block number BLOCKNO is at index BLOCKNO in a + vector of words; the name of this array is a local symbol made + with this statement: + + ASM_GENERATE_INTERNAL_LABEL (BUFFER, "LPBX", 2); + + Of course, since you are writing the definition of + `ASM_GENERATE_INTERNAL_LABEL' as well as that of this macro, you + can take a short cut in the definition of this macro and use the + name that you know will result. */ + +#undef BLOCK_PROFILER +#define BLOCK_PROFILER(STREAM, BLOCKNO) \ +do \ + { \ + if (!flag_pic) \ + fprintf (STREAM, "\tincl %sPBX2+%d\n", LPREFIX, (BLOCKNO)*4); \ + else \ + { \ + fprintf (STREAM, "\tpushl %eax\n"); \ + fprintf (STREAM, "\tmovl %sPBX2@GOT(%ebx),%eax\n", LPREFIX); \ + fprintf (STREAM, "\tincl %d(%eax)\n", (BLOCKNO)*4); \ + fprintf (STREAM, "\tpopl %eax\n"); \ + } \ + } \ +while (0) + +/* This is defined when gcc is compiled in the BSD-directory-tree, and must + * make up for the gap to all the stuff done in the GNU-makefiles. + */ + +#ifdef FREEBSD_NATIVE + +#undef MD_EXEC_PREFIX +#define MD_EXEC_PREFIX "/usr/libexec/" + +#undef STANDARD_STARTFILE_PREFIX +#define STANDARD_STARTFILE_PREFIX "/usr/lib" + +#define DEFAULT_TARGET_MACHINE "i386-unknown-freebsd_1.0" +#define GPLUSPLUS_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include" +#define TOOL_INCLUDE_DIR "/usr/local/i386-unknown-freebsd_1.0/include" +#define GCC_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include" + +#endif /* FREEBSD_NATIVE */ diff --git a/gcc/config/netbsd.h b/gcc/config/netbsd.h new file mode 100644 index 00000000000..caa13fe88ed --- /dev/null +++ b/gcc/config/netbsd.h @@ -0,0 +1,176 @@ +/* Look for the include files in the system-defined places. */ + +#undef GPLUSPLUS_INCLUDE_DIR +#define GPLUSPLUS_INCLUDE_DIR "/usr/include/g++" + +#undef GCC_INCLUDE_DIR +#define GCC_INCLUDE_DIR "/usr/include" + +#undef INCLUDE_DEFAULTS +#define INCLUDE_DEFAULTS \ + { \ + { GPLUSPLUS_INCLUDE_DIR, 1, 1 }, \ + { GCC_INCLUDE_DIR, 0, 0 }, \ + { 0, 0, 0 } \ + } + + +/* Under NetBSD, the normal location of the `ld' and `as' programs is the + /usr/bin directory. */ + +#undef MD_EXEC_PREFIX +#define MD_EXEC_PREFIX "/usr/bin/" + +/* Under NetBSD, the normal location of the various *crt*.o files is the + /usr/lib directory. */ + +#undef MD_STARTFILE_PREFIX +#define MD_STARTFILE_PREFIX "/usr/lib/" + + +/* Provide a CPP_SPEC appropriate for NetBSD. Current we just deal with + the GCC option `-posix'. */ + +#undef CPP_SPEC +#define CPP_SPEC "%{posix:-D_POSIX_SOURCE}" + +/* Provide an ASM_SPEC appropriate for NetBSD. Currently we only deal + with the options for generating PIC code. */ + +#undef ASM_SPEC +#define ASM_SPEC " %| %{fpic:-k} %{fPIC:-k -K}" + +/* Provide a LIB_SPEC appropriate for NetBSD. Just select the appropriate + libc, depending on whether we're doing profiling. */ + +#undef LIB_SPEC +#define LIB_SPEC "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}" + +/* Provide a LINK_SPEC appropriate for NetBSD. Here we provide support + for the special GCC options -static, -assert, and -nostdlib. */ + +#undef LINK_SPEC +#define LINK_SPEC \ + "%{!nostdlib:%{!r*:%{!e*:-e start}}} -dc -dp %{static:-Bstatic} %{assert*}" + + +/* We have atexit(3). */ + +#define HAVE_ATEXIT + +/* Implicit library calls should use memcpy, not bcopy, etc. */ + +#define TARGET_MEM_FUNCTIONS + +/* + * Some imports from svr4.h in support of shared libraries. + * Currently, we need the DECLARE_OBJECT_SIZE stuff. + */ + +/* Define the strings used for the special svr4 .type and .size directives. + These strings generally do not vary from one system running svr4 to + another, but if a given system (e.g. m88k running svr) needs to use + different pseudo-op names for these, they may be overridden in the + file which includes this one. */ + +#define TYPE_ASM_OP ".type" +#define SIZE_ASM_OP ".size" +#define WEAK_ASM_OP ".weak" + +/* The following macro defines the format used to output the second + operand of the .type assembler directive. Different svr4 assemblers + expect various different forms for this operand. The one given here + is just a default. You may need to override it in your machine- + specific tm.h file (depending upon the particulars of your assembler). */ + +#define TYPE_OPERAND_FMT "@%s" + +/* Write the extra assembler code needed to declare a function's result. + Most svr4 assemblers don't require any special declaration of the + result value, but there are exceptions. */ + +#ifndef ASM_DECLARE_RESULT +#define ASM_DECLARE_RESULT(FILE, RESULT) +#endif + +/* These macros generate the special .type and .size directives which + are used to set the corresponding fields of the linker symbol table + entries in an ELF object file under SVR4. These macros also output + the starting labels for the relevant functions/objects. */ + +/* Write the extra assembler code needed to declare a function properly. + Some svr4 assemblers need to also have something extra said about the + function's return value. We allow for that here. */ + +#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \ + do { \ + fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \ + assemble_name (FILE, NAME); \ + putc (',', FILE); \ + fprintf (FILE, TYPE_OPERAND_FMT, "function"); \ + putc ('\n', FILE); \ + ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \ + ASM_OUTPUT_LABEL(FILE, NAME); \ + } while (0) + +/* Write the extra assembler code needed to declare an object properly. */ + +#define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \ + do { \ + fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \ + assemble_name (FILE, NAME); \ + putc (',', FILE); \ + fprintf (FILE, TYPE_OPERAND_FMT, "object"); \ + putc ('\n', FILE); \ + size_directive_output = 0; \ + if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \ + { \ + size_directive_output = 1; \ + fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \ + assemble_name (FILE, NAME); \ + fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \ + } \ + ASM_OUTPUT_LABEL(FILE, NAME); \ + } while (0) + +/* Output the size directive for a decl in rest_of_decl_compilation + in the case where we did not do so before the initializer. + Once we find the error_mark_node, we know that the value of + size_directive_output was set + by ASM_DECLARE_OBJECT_NAME when it was run for the same decl. */ + +#define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \ +do { \ + char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \ + if (!flag_inhibit_size_directive && DECL_SIZE (DECL) \ + && ! AT_END && TOP_LEVEL \ + && DECL_INITIAL (DECL) == error_mark_node \ + && !size_directive_output) \ + { \ + size_directive_output = 1; \ + fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \ + assemble_name (FILE, name); \ + fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \ + } \ + } while (0) + +/* This is how to declare the size of a function. */ + +#define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \ + do { \ + if (!flag_inhibit_size_directive) \ + { \ + char label[256]; \ + static int labelno; \ + labelno++; \ + ASM_GENERATE_INTERNAL_LABEL (label, "Lfe", labelno); \ + ASM_OUTPUT_INTERNAL_LABEL (FILE, "Lfe", labelno); \ + fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \ + assemble_name (FILE, (FNAME)); \ + fprintf (FILE, ","); \ + assemble_name (FILE, label); \ + fprintf (FILE, "-"); \ + assemble_name (FILE, (FNAME)); \ + putc ('\n', FILE); \ + } \ + } while (0)