This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: An i960-*-elf configuration
- To: egcs-patches at egcs dot cygnus dot com
- Subject: Re: An i960-*-elf configuration
- From: Martin Dorey <martin dot dorey at madge dot com>
- Date: Fri, 18 Jun 1999 15:02:34 +0100
> From: Jeffrey A Law [mailto:law@cygnus.com]
> Sent: Wednesday, November 18, 1998 7:13 PM
> First note -- you'll need to get a copyright assignment
> on-file before we can
Tis finally done.
> Secondly, you're better off including some of the standard files and
> overriding the necessary definitions.
> Is there some reason you did not include svr4.h? If we need
> to add additional
> override capabilities, then we can do so.
Okay. Here's take 2. As well as providing an i960-elf configuration,
it fixes the tail call bug I mentioned previously, and includes svr4.h
with one small patch.
Index: configure.in
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/configure.in,v
retrieving revision 1.252
diff -c -3 -p -r1.252 configure.in
*** configure.in 1999/06/02 01:37:00 1.252
--- configure.in 1999/06/18 13:53:26
*************** changequote([,])dnl
*** 1660,1665 ****
--- 1660,1670 ----
tmake_file=i960/t-960bare
use_collect2=yes
;;
+ i960-*-elf*)
+ tm_file="i960/i960-elf.h"
+ tmake_file=i960/t-960bare
+ use_collect2=yes
+ ;;
i960-*-rtems)
tmake_file="i960/t-960bare t-rtems"
tm_file="${tm_file} dbxcoff.h i960/rtems.h"
Index: svr4.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/config/svr4.h,v
retrieving revision 1.12
diff -c -3 -p -r1.12 svr4.h
*** svr4.h 1999/03/26 10:45:24 1.12
--- svr4.h 1999/06/18 13:45:52
*************** do { \
*** 705,711 ****
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); \
--- 705,711 ----
Some svr4 assemblers need to also have something extra said about
the
function's return value. We allow for that here. */
! #define ASM_INTERNAL_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
do { \
fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \
assemble_name (FILE, NAME); \
*************** do { \
*** 715,720 ****
--- 715,726 ----
ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
ASM_OUTPUT_LABEL(FILE, NAME); \
} while (0)
+
+ /* An extra level of indirection, so that machine-specifc versions can
+ wrap ASM_DECLARE_FUNCTION_NAME without duplication. */
+
+ #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
+ ASM_INTERNAL_DECLARE_FUNCTION_NAME (FILE, NAME, DECL)
/* Write the extra assembler code needed to declare an object
properly. */
Index: i960.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/config/i960/i960.c,v
retrieving revision 1.10
diff -c -3 -p -r1.10 i960.c
*** i960.c 1999/04/07 23:02:59 1.10
--- i960.c 1999/06/18 13:42:41
*************** i960_function_name_declare (file, name,
*** 1088,1094 ****
/* Even if nobody uses extra parms, can't have leafproc or tail
calls if
argblock, because argblock uses g14 implicitly. */
! if (current_function_args_size != 0 || VARARGS_STDARG_FUNCTION
(fndecl))
{
tail_call_ok = 0;
leaf_proc_ok = 0;
--- 1088,1095 ----
/* Even if nobody uses extra parms, can't have leafproc or tail
calls if
argblock, because argblock uses g14 implicitly. */
! if (current_function_args_size != 0 || VARARGS_STDARG_FUNCTION
(fndecl)
! || current_function_calls_alloca)
{
tail_call_ok = 0;
leaf_proc_ok = 0;
*************** i960_function_name_declare (file, name,
*** 1195,1203 ****
--- 1196,1229 ----
fprintf (file, "\t.leafproc\t");
assemble_name (file, name);
fprintf (file, ",%s.lf\n", (name[0] == '*' ? &name[1] : name));
+ #ifdef ASM_INTERNAL_DECLARE_FUNCTION_NAME
+ ASM_INTERNAL_DECLARE_FUNCTION_NAME(file, (name[0] == '*' ?
&name[1] : name), fndecl);
+ #else
ASM_OUTPUT_LABEL (file, name);
+ #endif
fprintf (file, "\tlda LR%d,g14\n", ret_label);
+
+ #ifdef TYPE_ASM_OP
+ fprintf (file, "\t%s\t ", TYPE_ASM_OP);
+ assemble_name (file, (name[0] == '*' ? &name[1] : name));
+ fputs (".lf,", file);
+ fprintf (file, TYPE_OPERAND_FMT, "function");
+ putc ('\n', file);
+ ASM_DECLARE_RESULT (file, DECL_RESULT (fndecl));
+ assemble_name (file, (name[0] == '*' ? &name[1] : name));
+ fputs (".lf:\n", file);
+ #else
fprintf (file, "%s.lf:\n", (name[0] == '*' ? &name[1] : name));
+ #endif
+
+ #ifdef ASM_WEAKEN_LABEL
+ if (DECL_WEAK (fndecl))
+ {
+ fputs ("\t.weak\t", file);
+ assemble_name (file, (name[0] == '*' ? &name[1] : name));
+ fputs (".lf\n", file);
+ }
+ #endif
fprintf (file, "\tmov g14,g%d\n", i960_leaf_ret_reg);
if (TARGET_C_SERIES)
*************** i960_function_name_declare (file, name,
*** 1213,1219 ****
--- 1239,1249 ----
}
else
{
+ #ifdef ASM_INTERNAL_DECLARE_FUNCTION_NAME
+ ASM_INTERNAL_DECLARE_FUNCTION_NAME(file, (name[0] == '*' ?
&name[1] : name), fndecl);
+ #else
ASM_OUTPUT_LABEL (file, name);
+ #endif
i960_last_insn_type = I_TYPE_CTRL;
}
}
Index: t-960bare
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/config/i960/t-960bare,v
retrieving revision 1.3
diff -c -3 -p -r1.3 t-960bare
*** t-960bare 1999/01/19 12:03:00 1.3
--- t-960bare 1999/06/18 13:42:41
***************
*** 1,5 ****
--- 1,6 ----
LIBGCC1 =
CROSS_LIBGCC1 =
+ LIBGCC1_TEST =
LIB2FUNCS_EXTRA = fp-bit.c dp-bit.c xp-bit.c
==
Where config/i960/i960-elf.h is:
/* Definitions for generic i960-elf with some SVR4-style symbol
information.
Copyright (C) 1998 Free Software Foundation, Inc.
Contributed by Madge Networks
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. */
#include "svr4.h"
/* These are redefined in i960/i960.h. */
#undef ASM_DECLARE_FUNCTION_NAME
#undef ASM_FILE_START
#undef ASM_GENERATE_INTERNAL_LABEL
#undef ASM_OUTPUT_ALIGNED_LOCAL
#undef ASM_OUTPUT_IDENT
#undef ASM_OUTPUT_INTERNAL_LABEL
#undef ASM_OUTPUT_SKIP
#undef ASM_OUTPUT_SOURCE_LINE
#undef ASM_SPEC
#undef DBX_CONTIN_LENGTH
#undef LIB_SPEC
#undef LINK_SPEC
#undef PREFERRED_DEBUGGING_TYPE
#undef TARGET_MEM_FUNCTIONS
#undef USER_LABEL_PREFIX
#include "i960/i960.h"
/* The generic BFD linker doesn't quite work with linkonce sections.
Specifically, relocations that are relative to local symbols
in discarded duplicates of linkonce sections cause relocatable
links to fail. I see such relocations generated by .stabd.
martin.dorey@madge.com 1999-06-18. */
#undef ASM_OUTPUT_SECTION_NAME
#undef UNIQUE_SECTION
--