/* Definitions of target machine for gcc for Super-H using sh-superh-elf.
|
/* Definitions of target machine for gcc for Super-H using sh-superh-elf.
|
Copyright (C) 2001, 2006, 2007 Free Software Foundation, Inc.
|
Copyright (C) 2001, 2006, 2007 Free Software Foundation, Inc.
|
|
|
This file is part of GNU CC.
|
This file is part of GNU CC.
|
|
|
GNU CC is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
the Free Software Foundation; either version 3, or (at your option)
|
the Free Software Foundation; either version 3, or (at your option)
|
any later version.
|
any later version.
|
|
|
GNU CC is distributed in the hope that it will be useful,
|
GNU CC is distributed in the hope that it will be useful,
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
GNU General Public License for more details.
|
GNU General Public License for more details.
|
|
|
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
along with GCC; see the file COPYING3. If not see
|
along with GCC; see the file COPYING3. If not see
|
<http://www.gnu.org/licenses/>. */
|
<http://www.gnu.org/licenses/>. */
|
|
|
|
|
/* This header file is used when the vendor name is set to 'superh'.
|
/* This header file is used when the vendor name is set to 'superh'.
|
config.gcc already configured the compiler for SH4 only and switched
|
config.gcc already configured the compiler for SH4 only and switched
|
the default endianess to little (although big endian is still available).
|
the default endianess to little (although big endian is still available).
|
This file configures the spec file to the default board configuration
|
This file configures the spec file to the default board configuration
|
but in such a way that it can be overridden by a boardspecs file
|
but in such a way that it can be overridden by a boardspecs file
|
(using the -specs= option). This file is expected to disable the
|
(using the -specs= option). This file is expected to disable the
|
defaults and provide options --defsym _start and --defsym _stack
|
defaults and provide options --defsym _start and --defsym _stack
|
which are required by the SuperH configuration of GNU ld.
|
which are required by the SuperH configuration of GNU ld.
|
|
|
This file is intended to override sh.h. */
|
This file is intended to override sh.h. */
|
|
|
|
|
#ifndef _SUPERH_H
|
#ifndef _SUPERH_H
|
#define _SUPERH_H
|
#define _SUPERH_H
|
#endif
|
#endif
|
|
|
|
|
#undef TARGET_VERSION
|
#undef TARGET_VERSION
|
#define TARGET_VERSION fprintf (stderr, " (SuperH SH special %s)", __DATE__);
|
#define TARGET_VERSION fprintf (stderr, " (SuperH SH special %s)", __DATE__);
|
|
|
/* Override the linker spec strings to use the new emulation
|
/* Override the linker spec strings to use the new emulation
|
The specstrings are concatenated as follows
|
The specstrings are concatenated as follows
|
LINK_EMUL_PREFIX.(''|'32'|'64'|LINK_DEFAULT_CPU_EMUL).SUBTARGET_LINK_EMUL_SUFFIX
|
LINK_EMUL_PREFIX.(''|'32'|'64'|LINK_DEFAULT_CPU_EMUL).SUBTARGET_LINK_EMUL_SUFFIX
|
*/
|
*/
|
#undef LINK_EMUL_PREFIX
|
#undef LINK_EMUL_PREFIX
|
#undef SUBTARGET_LINK_EMUL_SUFFIX
|
#undef SUBTARGET_LINK_EMUL_SUFFIX
|
|
|
#define LINK_EMUL_PREFIX "superh"
|
#define LINK_EMUL_PREFIX "superh"
|
#define SUBTARGET_LINK_EMUL_SUFFIX ""
|
#define SUBTARGET_LINK_EMUL_SUFFIX ""
|
|
|
/* Add the SUBTARGET_LINK_SPEC to add the board and runtime support and
|
/* Add the SUBTARGET_LINK_SPEC to add the board and runtime support and
|
change the endianness */
|
change the endianness */
|
#undef SUBTARGET_LINK_SPEC
|
#undef SUBTARGET_LINK_SPEC
|
#if TARGET_ENDIAN_DEFAULT == MASK_LITTLE_ENDIAN
|
#if TARGET_ENDIAN_DEFAULT == MASK_LITTLE_ENDIAN
|
#define SUBTARGET_LINK_SPEC "%(board_link) %(ldruntime) %{ml|!mb:-EL}%{mb:-EB}"
|
#define SUBTARGET_LINK_SPEC "%(board_link) %(ldruntime) %{ml|!mb:-EL}%{mb:-EB}"
|
#else
|
#else
|
#define SUBTARGET_LINK_SPEC "%(board_link) %(ldruntime) %{ml:-EL}%{mb|!ml:-EB}"
|
#define SUBTARGET_LINK_SPEC "%(board_link) %(ldruntime) %{ml:-EL}%{mb|!ml:-EB}"
|
#endif
|
#endif
|
|
|
|
|
/* This is used by the link spec if the boardspecs file is not used (for whatever reason).
|
/* This is used by the link spec if the boardspecs file is not used (for whatever reason).
|
If the boardspecs file overrides this then an alternative can be used. */
|
If the boardspecs file overrides this then an alternative can be used. */
|
#undef SUBTARGET_EXTRA_SPECS
|
#undef SUBTARGET_EXTRA_SPECS
|
#define SUBTARGET_EXTRA_SPECS \
|
#define SUBTARGET_EXTRA_SPECS \
|
{ "board_link", "--defsym _start=0x1000 --defsym _stack=0x30000" }, \
|
{ "board_link", "--defsym _start=0x1000 --defsym _stack=0x30000" }, \
|
{ "asruntime", "" }, \
|
{ "asruntime", "" }, \
|
{ "cppruntime", "-D__GDB_SIM__" }, \
|
{ "cppruntime", "-D__GDB_SIM__" }, \
|
{ "cc1runtime", "" }, \
|
{ "cc1runtime", "" }, \
|
{ "ldruntime", "" }, \
|
{ "ldruntime", "" }, \
|
{ "libruntime", "-lc -lgloss" }
|
{ "libruntime", "-lc -lgloss" }
|
|
|
|
|
/* Set the SUBTARGET_CPP_SPEC to define __EMBEDDED_CROSS__ which has an effect
|
/* Set the SUBTARGET_CPP_SPEC to define __EMBEDDED_CROSS__ which has an effect
|
on newlib and provide the runtime support */
|
on newlib and provide the runtime support */
|
#undef SUBTARGET_CPP_SPEC
|
#undef SUBTARGET_CPP_SPEC
|
#define SUBTARGET_CPP_SPEC \
|
#define SUBTARGET_CPP_SPEC \
|
"-D__EMBEDDED_CROSS__ %{m4-100*:-D__SH4_100__} %{m4-200*:-D__SH4_200__} %{m4-300*:-D__SH4_300__} %{m4-340:-D__SH4_340__} %{m4-400:-D__SH4_400__} %{m4-500:-D__SH4_500__} \
|
"-D__EMBEDDED_CROSS__ %{m4-100*:-D__SH4_100__} %{m4-200*:-D__SH4_200__} %{m4-300*:-D__SH4_300__} %{m4-340:-D__SH4_340__} %{m4-400:-D__SH4_400__} %{m4-500:-D__SH4_500__} \
|
%(cppruntime)"
|
%(cppruntime)"
|
|
|
/* Override the SUBTARGET_ASM_SPEC to add the runtime support */
|
/* Override the SUBTARGET_ASM_SPEC to add the runtime support */
|
#undef SUBTARGET_ASM_SPEC
|
#undef SUBTARGET_ASM_SPEC
|
#define SUBTARGET_ASM_SPEC "%{m4-100*|m4-200*:-isa=sh4} %{m4-400|m4-340:-isa=sh4-nommu-nofpu} %{m4-500:-isa=sh4-nofpu} %(asruntime)"
|
#define SUBTARGET_ASM_SPEC "%{m4-100*|m4-200*:-isa=sh4} %{m4-400|m4-340:-isa=sh4-nommu-nofpu} %{m4-500:-isa=sh4-nofpu} %(asruntime)"
|
|
|
/* Override the SUBTARGET_ASM_RELAX_SPEC so it doesn't interfere with the
|
/* Override the SUBTARGET_ASM_RELAX_SPEC so it doesn't interfere with the
|
runtime support by adding -isa=sh4 in the wrong place. */
|
runtime support by adding -isa=sh4 in the wrong place. */
|
#undef SUBTARGET_ASM_RELAX_SPEC
|
#undef SUBTARGET_ASM_RELAX_SPEC
|
#define SUBTARGET_ASM_RELAX_SPEC "%{!m4-100*:%{!m4-200*:%{!m4-300*:%{!m4-340:%{!m4-400:%{!m4-500:-isa=sh4}}}}}}"
|
#define SUBTARGET_ASM_RELAX_SPEC "%{!m4-100*:%{!m4-200*:%{!m4-300*:%{!m4-340:%{!m4-400:%{!m4-500:-isa=sh4}}}}}}"
|
|
|
/* Create the CC1_SPEC to add the runtime support */
|
/* Create the CC1_SPEC to add the runtime support */
|
#undef CC1_SPEC
|
#undef CC1_SPEC
|
#define CC1_SPEC "%(cc1runtime)"
|
#define CC1_SPEC "%(cc1runtime)"
|
|
|
#undef CC1PLUS_SPEC
|
#undef CC1PLUS_SPEC
|
#define CC1PLUS_SPEC "%(cc1runtime)"
|
#define CC1PLUS_SPEC "%(cc1runtime)"
|
|
|
|
|
/* Override the LIB_SPEC to add the runtime support */
|
/* Override the LIB_SPEC to add the runtime support */
|
#undef LIB_SPEC
|
#undef LIB_SPEC
|
#define LIB_SPEC "%{!shared:%{!symbolic:%(libruntime) -lc}} %{pg:-lprofile -lc}"
|
#define LIB_SPEC "%{!shared:%{!symbolic:%(libruntime) -lc}} %{pg:-lprofile -lc}"
|
|
|
/* Override STARTFILE_SPEC to add profiling and MMU support. */
|
/* Override STARTFILE_SPEC to add profiling and MMU support. */
|
#undef STARTFILE_SPEC
|
#undef STARTFILE_SPEC
|
#define STARTFILE_SPEC \
|
#define STARTFILE_SPEC \
|
"%{!shared: %{!m4-400*:%{!m4-340*: %{pg:gcrt1-mmu.o%s}%{!pg:crt1-mmu.o%s}}}} \
|
"%{!shared: %{!m4-400*:%{!m4-340*: %{pg:gcrt1-mmu.o%s}%{!pg:crt1-mmu.o%s}}}} \
|
%{!shared: %{m4-340*|m4-400*: %{pg:gcrt1.o%s}%{!pg:crt1.o%s}}} \
|
%{!shared: %{m4-340*|m4-400*: %{pg:gcrt1.o%s}%{!pg:crt1.o%s}}} \
|
crti.o%s \
|
crti.o%s \
|
%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
|
%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
|
|
|