Commit d1be3be3 by Jim Wilson Committed by Jim Wilson

Add m68k-elf port from Cygnus gcc sources.

	* configure.in (m68020-*-elf*, m68k-*-elf*): New targets.
	* configure: Rebuild.
	* config/elfos.h: New file.
	* config/m68k/m68020-elf.h, config/m68k/m68kelf.h,
	config/m68k/t-m68kelf: New file.

From-SVN: r23835
parent 23a79c61
Tue Nov 24 20:24:59 1998 Jim Wilson <wilson@cygnus.com>
* configure.in (m68020-*-elf*, m68k-*-elf*): New targets.
* configure: Rebuild.
* config/elfos.h: New file.
* config/m68k/m68020-elf.h, config/m68k/m68kelf.h,
config/m68k/t-m68kelf: New file.
Tue Nov 24 13:40:06 1998 Jeffrey A Law (law@cygnus.com)
* Makefile.in (HOST_AR): Define.
......
/* Definitions of target machine for GNU compiler. "naked" 68020,
elf object files and debugging, version.
Copyright (C) 1987, 1988, 1992, 1995, 1996 Free Software Foundation, Inc.
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. */
/* This comment is here to see if it will keep Sun's cpp from dying. */
#include "m68k/m68k-none.h"
#include "m68k/m68kelf.h"
#include "elfos.h"
/* m68k/m68kemb.h sets some macros in ways that override the svr4 abi. */
#include "m68k/m68kemb.h"
/* We need to override the default specs from elfos.h. This suppresses the
loading of crt0.o by gcc's default linker spec. For embedded targets crt0
now comes from the linker script. */
#undef STARTFILE_SPEC
#define STARTFILE_SPEC "crtbegin.o%s"
#undef ENDFILE_SPEC
#define ENDFILE_SPEC "crtend.o%s"
#define LIB_SPEC "-lc"
/* end of m68020-elf.h */
/* m68kelf support, derived from m68kv4.h */
/* Target definitions for GNU compiler for mc680x0 running System V.4
Copyright (C) 1991, 1993 Free Software Foundation, Inc.
Written by Ron Guilmette (rfg@netcom.com) and Fred Fish (fnf@cygnus.com).
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. */
/* #notinclude "m68k/sgs.h" /* The m68k/SVR4 assembler is SGS based */
/* These are necessary for -fpic/-fPIC to work correctly. */
#ifndef MOTOROLA
#define MOTOROLA /* Use MOTOROLA syntax. */
#endif
#ifdef USE_GAS /* when present, forces jsbr instead of jsr. */
#undef USE_GAS
#endif
#ifndef SWBEG_ASM_OP
#define SWBEG_ASM_OP ".swbeg"
#endif
/* Here are four prefixes that are used by asm_fprintf to
facilitate customization for alternate assembler syntaxes.
Machines with no likelihood of an alternate syntax need not
define these and need not use asm_fprintf. */
/* The prefix for register names. Note that REGISTER_NAMES
is supposed to include this prefix. Also note that this is NOT an
fprintf format string, it is a literal string */
#undef REGISTER_PREFIX
#define REGISTER_PREFIX "%"
/* The prefix for local (compiler generated) labels.
These labels will not appear in the symbol table. */
#undef LOCAL_LABEL_PREFIX
#define LOCAL_LABEL_PREFIX "."
/* The prefix to add to user-visible assembler symbols. */
#undef USER_LABEL_PREFIX
#define USER_LABEL_PREFIX ""
/* The prefix for immediate operands. */
#undef IMMEDIATE_PREFIX
#define IMMEDIATE_PREFIX "#"
/* In the machine description we can't use %R, because it will not be seen
by ASM_FPRINTF. (Isn't that a design bug?). */
#undef REGISTER_PREFIX_MD
#define REGISTER_PREFIX_MD "%%"
/* config/m68k.md has an explicit reference to the program counter,
prefix this by the register prefix. */
#define ASM_RETURN_CASE_JUMP return "jmp %%pc@(2,%0:w)"
/* How to refer to registers in assembler output.
This sequence is indexed by compiler's hard-register-number.
Motorola format uses different register names than defined
in m68k.h. */
#undef REGISTER_NAMES
#define REGISTER_NAMES \
{"%d0", "%d1", "%d2", "%d3", "%d4", "%d5", "%d6", "%d7", \
"%a0", "%a1", "%a2", "%a3", "%a4", "%a5", "%a6", "%sp", \
"%fp0", "%fp1", "%fp2", "%fp3", "%fp4", "%fp5", "%fp6", "%fp7" }
/* This is how to output an assembler line that says to advance the
location counter to a multiple of 2**LOG bytes. */
#undef ASM_OUTPUT_ALIGN
#define ASM_OUTPUT_ALIGN(FILE,LOG) \
if ((LOG) > 0) \
fprintf ((FILE), "\t%s \t%u\n", ALIGN_ASM_OP, 1 << (LOG)); \
else if ((LOG) > 31) \
abort ();
/* Use proper assembler syntax for these macros. */
#undef ASM_OUTPUT_REG_PUSH
#define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \
asm_fprintf (FILE, "\t%Omove.l %s,-(%Rsp)\n", reg_names[REGNO])
#undef ASM_OUTPUT_REG_POP
#define ASM_OUTPUT_REG_POP(FILE,REGNO) \
asm_fprintf (FILE, "\t%Omove.l (%Rsp)+,%s\n", reg_names[REGNO])
/* Override the definition of NO_DOLLAR_IN_LABEL in svr4.h, for special
g++ assembler names. When this is defined, g++ uses embedded '.'
characters and some m68k assemblers have problems with this. The
chances are much greater that any particular assembler will permit
embedded '$' characters. */
#undef NO_DOLLAR_IN_LABEL
/* Define PCC_STATIC_STRUCT_RETURN if the convention on the target machine
is to use the nonreentrant technique for returning structure and union
values, as commonly implemented by the AT&T Portable C Compiler (PCC).
When defined, the gcc option -fpcc-struct-return can be used to cause
this form to be generated. When undefined, the option does nothing.
For m68k SVR4, the convention is to use a reentrant technique compatible
with the gcc default, so override the definition of this macro in m68k.h */
#undef PCC_STATIC_STRUCT_RETURN
/* Local common symbols are declared to the assembler with ".lcomm" rather
than ".bss", so override the definition in svr4.h */
#undef BSS_ASM_OP
#define BSS_ASM_OP ".lcomm"
/* Register in which address to store a structure value is passed to a
function. The default in m68k.h is a1. For m68k/SVR4 it is a0. */
#undef STRUCT_VALUE_REGNUM
#define STRUCT_VALUE_REGNUM 8
#define ASM_COMMENT_START "|"
#undef TYPE_OPERAND_FMT
#define TYPE_OPERAND_FMT "@%s"
/* Define how the m68k registers should be numbered for Dwarf output.
The numbering provided here should be compatible with the native
SVR4 SDB debugger in the m68k/SVR4 reference port, where d0-d7
are 0-7, a0-a8 are 8-15, and fp0-fp7 are 16-23. */
#undef DBX_REGISTER_NUMBER
#define DBX_REGISTER_NUMBER(REGNO) (REGNO)
/* The ASM_OUTPUT_SKIP macro is first defined in m68k.h, using ".skip".
It is then overridden by m68k/sgs.h to use ".space", and again by svr4.h
to use ".zero". The m68k/SVR4 assembler uses ".space", so repeat the
definition from m68k/sgs.h here. Note that ASM_NO_SKIP_IN_TEXT is
defined in m68k/sgs.h, so we don't have to repeat it here. */
#undef ASM_OUTPUT_SKIP
#define ASM_OUTPUT_SKIP(FILE,SIZE) \
fprintf (FILE, "\t%s %u\n", SPACE_ASM_OP, (SIZE))
#if 0
/* SVR4 m68k assembler is bitching on the `comm i,1,1' which askes for
1 byte alignment. Don't generate alignment for COMMON seems to be
safer until we the assembler is fixed. */
#undef ASM_OUTPUT_ALIGNED_COMMON
/* Same problem with this one. */
#undef ASM_OUTPUT_ALIGNED_LOCAL
#endif
/* The `string' directive on m68k svr4 does not handle string with
escape char (ie., `\') right. Use normal way to output ASCII bytes
seems to be safer. */
#undef ASM_OUTPUT_ASCII
#define ASM_OUTPUT_ASCII(FILE,PTR,LEN) \
do { \
register int sp = 0, lp = 0, ch; \
fprintf ((FILE), "\t%s ", BYTE_ASM_OP); \
do { \
ch = (PTR)[sp]; \
if (ch > ' ' && ! (ch & 0x80) && ch != '\\') \
{ \
fprintf ((FILE), "'%c", ch); \
} \
else \
{ \
fprintf ((FILE), "0x%x", ch); \
} \
if (++sp < (LEN)) \
{ \
if ((sp % 10) == 0) \
{ \
fprintf ((FILE), "\n\t%s ", BYTE_ASM_OP); \
} \
else \
{ \
putc (',', (FILE)); \
} \
} \
} while (sp < (LEN)); \
putc ('\n', (FILE)); \
} while (0)
/* SVR4 m68k assembler is bitching on the syntax `2.b'.
So use the "LLDnnn-LLnnn" format. Define LLDnnn after the table. */
#undef ASM_OUTPUT_CASE_END
#define ASM_OUTPUT_CASE_END(FILE,NUM,TABLE) \
do { \
if (switch_table_difference_label_flag) \
asm_fprintf ((FILE), "\t%s %LLD%d,%LL%d\n", SET_ASM_OP, (NUM), (NUM));\
switch_table_difference_label_flag = 0; \
} while (0)
extern int switch_table_difference_label_flag;
#undef ASM_OUTPUT_COMMON
#undef ASM_OUTPUT_LOCAL
#define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
( fputs (".comm ", (FILE)), \
assemble_name ((FILE), (NAME)), \
fprintf ((FILE), ",%u\n", (SIZE)))
#define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \
( fputs (".lcomm ", (FILE)), \
assemble_name ((FILE), (NAME)), \
fprintf ((FILE), ",%u\n", (SIZE)))
/* Currently, JUMP_TABLES_IN_TEXT_SECTION must be defined in order to
keep switch tables in the text section. */
#define JUMP_TABLES_IN_TEXT_SECTION 1
/* Override the definition in svr4.h. In m68k svr4, using swbeg is the
standard way to do switch table. */
#undef ASM_OUTPUT_BEFORE_CASE_LABEL
#define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE,PREFIX,NUM,TABLE) \
fprintf ((FILE), "\t%s &%d\n", SWBEG_ASM_OP, XVECLEN (PATTERN (TABLE), 1));
/* In m68k svr4, a symbol_ref rtx can be a valid PIC operand if it is an
operand of a function call. */
#undef LEGITIMATE_PIC_OPERAND_P
#define LEGITIMATE_PIC_OPERAND_P(X) \
(! symbolic_operand (X, VOIDmode) \
|| ((GET_CODE(X) == SYMBOL_REF) && SYMBOL_REF_FLAG(X)))
/* Turn off function cse if we are doing PIC. We always want function call
to be done as `bsr foo@PLTPC', so it will force the assembler to create
the PLT entry for `foo'. Doing function cse will cause the address of `foo'
to be loaded into a register, which is exactly what we want to avoid when
we are doing PIC on svr4 m68k. */
#undef OVERRIDE_OPTIONS
#define OVERRIDE_OPTIONS \
{ \
if (flag_pic) flag_no_function_cse = 1; \
if (! TARGET_68020 && flag_pic == 2) \
error("-fPIC is not currently supported on the 68000 or 68010\n"); \
}
/* end of stuff from m68kv4.h */
#undef SGS_CMP_ORDER
#undef ENDFILE_SPEC
#define ENDFILE_SPEC "crtend.o%s"
#undef STARTFILE_SPEC
#define STARTFILE_SPEC "crtbegin.o%s"
CROSS_LIBGCC1 = libgcc1-asm.a
LIB1ASMSRC = m68k/lb1sf68.asm
LIB1ASMFUNCS = _mulsi3 _udivsi3 _divsi3 _umodsi3 _modsi3 \
_double _float _floatex \
_eqdf2 _nedf2 _gtdf2 _gedf2 _ltdf2 _ledf2 \
_eqsf2 _nesf2 _gtsf2 _gesf2 _ltsf2 _lesf2
# These are really part of libgcc1, but this will cause them to be
# built correctly, so...
LIB2FUNCS_EXTRA = fpgnulib.c xfgnulib.c
fpgnulib.c: $(srcdir)/config/m68k/fpgnulib.c
cp $(srcdir)/config/m68k/fpgnulib.c fpgnulib.c
xfgnulib.c: $(srcdir)/config/m68k/fpgnulib.c
echo '#define EXTFLOAT' > xfgnulib.c
cat $(srcdir)/config/m68k/fpgnulib.c >> xfgnulib.c
MULTILIB_OPTIONS = m68000/m68020/m5200 m68881/msoft-float
MULTILIB_DIRNAMES =
MULTILIB_MATCHES = m68000=mc68000 m68000=m68302 m68000=m68332 m68020=mc68020 m68020=m68040
MULTILIB_EXCEPTIONS = *m5200/*m68881 *m5200/*msoft-float
LIBGCC = stmp-multilib
INSTALL_LIBGCC = install-multilib
# from ../t-svr4
EXTRA_PARTS=crtbegin.o crtend.o
# no pic for now
#CRTSTUFF_T_CFLAGS=-fpic
......@@ -4189,6 +4189,12 @@ for machine in $build $host $target; do
extra_headers=math-68881.h
float_format=m68k
;;
m68020-*-elf* | m68k-*-elf*)
tm_file="m68k/m68020-elf.h libgloss.h"
xm_file=m68k/xm-m68kv.h
tmake_file=m68k/t-m68kelf
header_files=math-68881.h
;;
m68k-*-lynxos*)
if test x$gas = xyes
then
......@@ -5951,7 +5957,7 @@ fi
# Figure out what assembler alignment features are present.
echo $ac_n "checking assembler alignment features""... $ac_c" 1>&6
echo "configure:5955: checking assembler alignment features" >&5
echo "configure:5961: checking assembler alignment features" >&5
gcc_cv_as=
gcc_cv_as_alignment_features=
gcc_cv_as_gas_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/gas
......@@ -6024,7 +6030,7 @@ fi
echo "$ac_t""$gcc_cv_as_alignment_features" 1>&6
echo $ac_n "checking assembler subsection support""... $ac_c" 1>&6
echo "configure:6028: checking assembler subsection support" >&5
echo "configure:6034: checking assembler subsection support" >&5
gcc_cv_as_subsections=
if test x$gcc_cv_as != x; then
# Check if we have .subsection
......@@ -6260,7 +6266,7 @@ fi
# Warn if using init_priority.
echo $ac_n "checking whether to enable init_priority by default""... $ac_c" 1>&6
echo "configure:6264: checking whether to enable init_priority by default" >&5
echo "configure:6270: checking whether to enable init_priority by default" >&5
if test x$enable_init_priority != xyes; then
enable_init_priority=no
fi
......
......@@ -1936,6 +1936,12 @@ changequote([,])dnl
extra_headers=math-68881.h
float_format=m68k
;;
m68020-*-elf* | m68k-*-elf*)
tm_file="m68k/m68020-elf.h libgloss.h"
xm_file=m68k/xm-m68kv.h
tmake_file=m68k/t-m68kelf
header_files=math-68881.h
;;
m68k-*-lynxos*)
if test x$gas = xyes
then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment