From 290de3be42ecaba1b39a84e1527edfaef1a98a27 Mon Sep 17 00:00:00 2001 From: mrg Date: Mon, 30 Mar 1998 04:33:11 +0000 Subject: [PATCH] merge netbsd/powerpc gcc changes from toolchain/gcc --- gnu/dist/gcc/config/rs6000/netbsd.h | 102 ++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 gnu/dist/gcc/config/rs6000/netbsd.h diff --git a/gnu/dist/gcc/config/rs6000/netbsd.h b/gnu/dist/gcc/config/rs6000/netbsd.h new file mode 100644 index 000000000000..53cfe387ea80 --- /dev/null +++ b/gnu/dist/gcc/config/rs6000/netbsd.h @@ -0,0 +1,102 @@ +/* Start with SVR4 defaults. */ +#include + +/* Get generic NetBSD definitions. */ + +#include + +/* Use bcopy etc. instead of memcpy etc. */ +#undef TARGET_MEM_FUNCTIONS + +#undef SDB_DEBUGGING_INFO +#define SDB_DEBUGGING_INFO +#undef DBX_DEBUGGING_INFO +#define DBX_DEBUGGING_INFO + +#undef PREFERRED_DEBUGGING_TYPE +#define PREFERRED_DEBUGGING_TYPE \ + ((len > 1 && !strncmp (str, "gsdb", len)) ? SDB_DEBUG : DBX_DEBUG) + +/* Names to predefine in the preprocessor for this target machine. */ +#undef CPP_PREDEFINES +#define CPP_PREDEFINES "-DPPC -D__powerpc__ -D__NetBSD__ -Asystem(unix) -Asystem(NetBSD) -Acpu(powerpc) -Amachine(powerpc)" + +/* Make gcc agree with */ + +#undef SIZE_TYPE +#define SIZE_TYPE "unsigned int" + +#undef PTRDIFF_TYPE +#define PTRDIFF_TYPE "int" + +#undef WCHAR_TYPE +#define WCHAR_TYPE "int" + +#undef WCHAR_TYPE_SIZE +#define WCHAR_TYPE_SIZE 32 + +/* 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 + +/* XXX Duplicated from sysv4.h --thorpej@netbsd.org + Pass -mppc to the assembler, since that is what powerpc.h currently + implies */ +#undef ASM_SPEC +#define ASM_SPEC \ + "-u \ +%{mcpu=601: -m601} %{!mcpu=601: -mppc} \ +%{V} %{v:%{!V:-V}} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \ +%{mrelocatable} \ +%{mlittle} %{mlittle-endian} %{mbig} %{mbig-endian}" + +/* The `multiple' instructions may not be universally implemented. + We avoid their use here. */ +#undef CC1_SPEC +#define CC1_SPEC "-mno-multiple" + +/* Provide a LINK_SPEC approriate for NetBSD. */ +#undef LINK_SPEC +#define LINK_SPEC " \ + %{O*:-O3} %{!O*:-O1} \ + %{assert*} \ + %{shared:-shared} \ + %{!shared: \ + -dc -dp \ + %{!nostdlib:%{!r*:%{!e*:-e _start}}} \ + %{!static: \ + %{rdynamic:-export-dynamic} \ + %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}} \ + %{static:-static}}" + +/* Provide a STARTFILE_SPEC appropriate for NetBSD. Here we add + the crtbegin.o file (see crtstuff.c) which provides part of the + support for getting C++ file-scope static object constructed + before entering `main'. */ + +#undef STARTFILE_SPEC +#define STARTFILE_SPEC " \ + %{!shared: \ + %{pg:gcrt0.o%s} \ + %{!pg: \ + %{p:gcrt0.o%s} \ + %{!p:crt0.o%s}}} \ + crtbegin.o%s" + +/* Provide a ENDFILE_SPEC appropriate for NetBSD. Here we tack on + the file which provides part of the support for getting C++ + file-scope static object deconstructed after exiting `main' */ + +#undef ENDFILE_SPEC +#define ENDFILE_SPEC \ + "crtend.o%s" + +/* XXX Sort of a mix of ../netbsd.h and sysv4.h --thorpej@netbsd.org + Provide a CPP_SPEC appropriate for NetBSD. Currently we just deal with + the GCC option `-posix' and the calling convention definition. */ + +#undef CPP_SPEC +#define CPP_SPEC "\ +%{posix:-D_POSIX_SOURCE} \ +%{mcall-sysv: -D_CALL_SYSV} %{mcall-aix: -D_CALL_AIX} %{!mcall-sysv: %{!mcall-aix: -D_CALL_SYSV}}" +