Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/gnu gcc for sh3



details:   https://anonhg.NetBSD.org/src/rev/0f55c7201fe9
branches:  trunk
changeset: 477042:0f55c7201fe9
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Thu Oct 07 17:27:35 1999 +0000

description:
gcc for sh3

diffstat:

 gnu/dist/gcc/config/sh/netbsdcoff.h |   91 +++++++++++++++++++++++++
 gnu/dist/gcc/config/sh/netbsdelf.h  |  130 ++++++++++++++++++++++++++++++++++++
 gnu/usr.bin/egcs/arch/sh3/tconfig.h |    3 +
 gnu/usr.bin/egcs/arch/sh3/tm.h      |    7 +
 4 files changed, 231 insertions(+), 0 deletions(-)

diffs (247 lines):

diff -r 7d65a94c9223 -r 0f55c7201fe9 gnu/dist/gcc/config/sh/netbsdcoff.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/gnu/dist/gcc/config/sh/netbsdcoff.h       Thu Oct 07 17:27:35 1999 +0000
@@ -0,0 +1,91 @@
+#include <sh/sh.h>
+
+#undef CPP_SPEC
+#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} \
+%{ml:-D__LITTLE_ENDIAN__} \
+%{m1:-D__sh1__} \
+%{m2:-D__sh2__} \
+%{m3:-D__sh3__} \
+%{m3e:-D__SH3E__} \
+%{!m1:%{!m2:%{!m3:%{!m3e:-D__sh1__}}}}"
+
+#ifdef NETBSD_NATIVE
+
+/* 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, "G++", 1, 1 },    \
+    { GCC_INCLUDE_DIR, "GCC", 0, 0 },          \
+    { 0, 0, 0, 0 }                             \
+  }
+
+/* Under NetBSD, the normal location of the compiler back ends is the
+   /usr/libexec directory.  */
+
+#undef MD_EXEC_PREFIX
+#define MD_EXEC_PREFIX                 "/usr/libexec/"
+
+/* 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/"
+
+#endif
+
+#undef CPP_PREDEFINES
+#define CPP_PREDEFINES "-D__sh__ -Dunix -Dsh3 -D__NetBSD__ -Asystem(unix) -Asystem(NetBSD) -Acpu(sh) -Amachine(sh)"
+
+/* XXX -fpic -fPIC? (msaitoh) */
+#undef ASM_SPEC
+#define ASM_SPEC  "%{ml:-little} %{mrelax:-relax}"
+
+#undef LIB_SPEC
+#define LIB_SPEC "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}"
+
+#undef LINK_SPEC
+#define LINK_SPEC \
+  "%{ml:-m shl} %{mrelax:-relax} %{!nostdlib:%{!r*:%{!e*:-e start}}} -dc -dp %{R*} %{static:-Bstatic} %{assert*}"
+
+/* We have atexit(3).  */
+
+#define HAVE_ATEXIT
+
+/* Implicit library calls should use memcpy, not bcopy, etc.  */
+
+#define TARGET_MEM_FUNCTIONS
+
+/* Handle #pragma weak and #pragma pack.  */
+
+#define HANDLE_SYSV_PRAGMA
+
+
+/* Make gcc agree with <machine/ansi.h> */
+
+#undef SIZE_TYPE
+#define SIZE_TYPE "unsigned int"
+
+#undef PTRDIFF_TYPE
+#define PTRDIFF_TYPE "int"
+
+#undef WCHAR_TYPE
+#define WCHAR_TYPE "int"
+
+#undef WCHAR_UNSIGNED
+#define WCHAR_UNSIGNED 0
+
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE 32
+
+/* Until they use ELF or something that handles dwarf2 unwinds
+   and initialization stuff better.  */
+#undef DWARF2_UNWIND_INFO
+
diff -r 7d65a94c9223 -r 0f55c7201fe9 gnu/dist/gcc/config/sh/netbsdelf.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/gnu/dist/gcc/config/sh/netbsdelf.h        Thu Oct 07 17:27:35 1999 +0000
@@ -0,0 +1,130 @@
+/* Definitions of target machine for gcc for Hitachi Super-H using ELF.
+   Copyright (C) 1996 Free Software Foundation, Inc.
+   Contributed by Ian Lance Taylor <ian%cygnus.com@localhost>.
+
+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, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+/* Get generic SH definitions. */
+#include <sh/sh.h>
+
+/* No SDB debugging info.  */
+#undef SDB_DEBUGGING_INFO
+
+/* Undefine some macros defined in both sh.h and svr4.h.  */
+#undef IDENT_ASM_OP
+#undef ASM_FILE_END
+#undef ASM_OUTPUT_SOURCE_LINE
+#undef DBX_OUTPUT_MAIN_SOURCE_FILE_END
+#undef CTORS_SECTION_ASM_OP
+#undef DTORS_SECTION_ASM_OP
+#undef ASM_OUTPUT_SECTION_NAME
+#undef ASM_OUTPUT_CONSTRUCTOR
+#undef ASM_OUTPUT_DESTRUCTOR
+#undef ASM_DECLARE_FUNCTION_NAME
+#undef PREFERRED_DEBUGGING_TYPE
+#undef MAX_OFILE_ALIGNMENT
+
+/* Be ELF-like.  */
+#include <svr4.h>
+
+/* Get generic NetBSD ELF definitions. */
+#define NETBSD_ELF
+#include <netbsd.h>
+
+/* The prefix to add to user-visible assembler symbols.
+   Note that svr4.h redefined it from the original value (that we want)
+   in sh.h */
+
+#undef USER_LABEL_PREFIX
+#define USER_LABEL_PREFIX "_"
+
+#undef LOCAL_LABEL_PREFIX
+#define LOCAL_LABEL_PREFIX "."
+
+#undef ASM_FILE_START
+#define ASM_FILE_START(FILE) do {                              \
+  output_file_directive ((FILE), main_input_filename);         \
+  if (TARGET_LITTLE_ENDIAN)                                    \
+    fprintf ((FILE), "\t.little\n");                           \
+} while (0)
+
+/* Let code know that this is ELF.  */
+#define CPP_PREDEFINES \
+"-D__sh__ -D__sh3__ -D__NetBSD__ -D__ELF__ -D__KPRINTF_ATTRIBUTE__ \
+-Asystem(unix) -Asystem(NetBSD) -Acpu(sh3) -Amachine(sh3)"
+
+/* svr4.h undefined DBX_REGISTER_NUMBER, so we need to define it
+   again.  */
+#define DBX_REGISTER_NUMBER(REGNO)     \
+  (((REGNO) >= 22 && (REGNO) <= 39) ? ((REGNO) + 1) : (REGNO))
+
+/* SH ELF, unlike most ELF implementations, uses underscores before
+   symbol names.  */
+#undef ASM_OUTPUT_LABELREF
+#define ASM_OUTPUT_LABELREF(STREAM,NAME) \
+  asm_fprintf (STREAM, "%U%s", NAME)
+
+#undef ASM_GENERATE_INTERNAL_LABEL
+#define ASM_GENERATE_INTERNAL_LABEL(STRING, PREFIX, NUM) \
+  sprintf ((STRING), "*%s%s%d", LOCAL_LABEL_PREFIX, (PREFIX), (NUM))
+
+#undef ASM_OUTPUT_INTERNAL_LABEL
+#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
+  asm_fprintf ((FILE), "%L%s%d:\n", (PREFIX), (NUM))
+
+#undef  ASM_OUTPUT_SOURCE_LINE
+#define ASM_OUTPUT_SOURCE_LINE(file, line)                             \
+do                                                                     \
+  {                                                                    \
+    static int sym_lineno = 1;                                         \
+    asm_fprintf ((file), ".stabn 68,0,%d,%LLM%d-",                     \
+            (line), sym_lineno);                                       \
+    assemble_name ((file),                                             \
+                  XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0));\
+    asm_fprintf ((file), "\n%LLM%d:\n", sym_lineno);                   \
+    sym_lineno += 1;                                                   \
+  }                                                                    \
+while (0)
+
+#undef DBX_OUTPUT_MAIN_SOURCE_FILE_END
+#define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME)                        \
+do {                                                                   \
+  text_section ();                                                     \
+  fprintf ((FILE), "\t.stabs \"\",%d,0,0,Letext\nLetext:\n", N_SO);    \
+} while (0)
+
+/* HANDLE_SYSV_PRAGMA (defined by svr4.h) takes precedence over HANDLE_PRAGMA.
+   We want to use the HANDLE_PRAGMA from sh.h.  */
+#undef HANDLE_SYSV_PRAGMA
+
+#undef ASM_SPEC
+#define ASM_SPEC \
+ "%{ml:-little} %{mrelax:-relax} %{fpic:-k} %{fPIC:-k}"
+
+#undef LINK_SPEC
+#define        LINK_SPEC \
+ "%{ml:-m shlelf} %{mrelax:-relax} \
+  %{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}}"
diff -r 7d65a94c9223 -r 0f55c7201fe9 gnu/usr.bin/egcs/arch/sh3/tconfig.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/gnu/usr.bin/egcs/arch/sh3/tconfig.h       Thu Oct 07 17:27:35 1999 +0000
@@ -0,0 +1,3 @@
+/*     $NetBSD: tconfig.h,v 1.1 1999/10/07 17:27:36 msaitoh Exp $      */
+
+#include "sh/xm-sh.h"
diff -r 7d65a94c9223 -r 0f55c7201fe9 gnu/usr.bin/egcs/arch/sh3/tm.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/gnu/usr.bin/egcs/arch/sh3/tm.h    Thu Oct 07 17:27:35 1999 +0000
@@ -0,0 +1,7 @@
+/*     $NetBSD: tm.h,v 1.1 1999/10/07 17:27:36 msaitoh Exp $   */
+
+#ifdef DEFAULT_ELF
+#include "sparc/netbsdelf.h"
+#else
+#include "sparc/netbsdcoff.h"
+#endif



Home | Main Index | Thread Index | Old Index