Commit 93ca1662 by Niibe Yutaka Committed by Alexandre Oliva

configure.in (sh-*-linux*): Added.

* configure.in (sh-*-linux*): Added.
* configure: Rebuilt.
* config/sh/t-linux: New file.
* config/sh/sh.h (USERMODE_BIT): Define.
(TARGET_USERMODE): Likewise.
(TARGET_SWITCHES): New switches for the bits above.
(INITIALIZE_TRAMPOLINE): Call __ic_invalidate in USERMODE.
* config/sh/linux.h: New file.
* config/sh/lib1funcs.asm (GLOBAL): Don't prefix symbols with
underscore on linux.
(L_sdivsi3, L_udivsi3): Define for linux.
(L_ic_invalidate): Define.
* invoke.texi (SH Options): Document -musermode.

From-SVN: r36227
parent 4979c2a9
2000-09-07 Niibe Yutaka <gniibe@m17n.org>, Kaz Kojima <kkojima@rr.iij4u.or.jp>, Alexandre Oliva <aoliva@redhat.com>
* configure.in (sh-*-linux*): Added.
* configure: Rebuilt.
* config/sh/t-linux: New file.
* config/sh/sh.h (USERMODE_BIT): Define.
(TARGET_USERMODE): Likewise.
(TARGET_SWITCHES): New switches for the bits above.
(INITIALIZE_TRAMPOLINE): Call __ic_invalidate in USERMODE.
* config/sh/linux.h: New file.
* config/sh/lib1funcs.asm (GLOBAL): Don't prefix symbols with
underscore on linux.
(L_sdivsi3, L_udivsi3): Define for linux.
(L_ic_invalidate): Define.
* invoke.texi (SH Options): Document -musermode.
2000-09-07 Alexandre Oliva <aoliva@redhat.com>
* config/sh/sh.h (OVERRIDE_OPTIONS): Don't disable function
......
......@@ -42,6 +42,10 @@ Boston, MA 02111-1307, USA. */
#define LOCAL(X) L_##X
#endif
#ifdef __linux__
#define GLOBAL(X) __##X
#endif
#ifndef GLOBAL
#define GLOBAL(X) ___##X
#endif
......@@ -903,7 +907,7 @@ GLOBAL(sdivsi3_i4):
#ifdef L_sdivsi3
/* __SH4_SINGLE_ONLY__ keeps this part for link compatibility with
sh3e code. */
#if ! defined(__SH4__) && ! defined (__SH4_SINGLE__)
#if (! defined(__SH4__) && ! defined (__SH4_SINGLE__)) || defined (__linux__)
!!
!! Steve Chamberlain
!! sac@cygnus.com
......@@ -1105,7 +1109,7 @@ L1:
#ifdef L_udivsi3
/* __SH4_SINGLE_ONLY__ keeps this part for link compatibility with
sh3e code. */
#if ! defined(__SH4__) && ! defined (__SH4_SINGLE__)
#if (! defined(__SH4__) && ! defined (__SH4_SINGLE__)) || defined (__linux__)
!!
!! Steve Chamberlain
!! sac@cygnus.com
......@@ -1207,3 +1211,25 @@ LOCAL(set_fpscr_L1):
#endif /* ELF */
#endif /* SH3E / SH4 */
#endif /* L_set_fpscr */
#ifdef L_ic_invalidate
#if defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY__)
.global GLOBAL(ic_invalidate)
GLOBAL(ic_invalidate):
ocbwb @r4
mova 0f,r0
mov.w 1f,r1
sub r0,r4
and r1,r4
add #4,r4
braf r4
nop
1:
.short 0x1fe0
nop
0:
.rept 2048
rts
nop
.endr
#endif /* SH4 */
#endif /* L_ic_invalidate */
/* Definitions for SH running Linux-based GNU systems using ELF
Copyright (C) 1999, 2000 Free Software Foundation, Inc.
Contributed by Kazumoto Kojima <kkojima@rr.iij4u.or.jp>
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 this program; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* Run-time Target Specification. */
#undef TARGET_VERSION
#define TARGET_VERSION fputs (" (SH GNU/Linux with ELF)", stderr);
/* Return to the original ELF way. */
#undef USER_LABEL_PREFIX
#define USER_LABEL_PREFIX ""
#undef SIZE_TYPE
#define SIZE_TYPE "unsigned int"
#undef PTRDIFF_TYPE
#define PTRDIFF_TYPE "int"
#undef WCHAR_TYPE
#define WCHAR_TYPE "long int"
#undef WCHAR_TYPE_SIZE
#define WCHAR_TYPE_SIZE BITS_PER_WORD
#undef CPP_SPEC
#define CPP_SPEC \
"%{mb:-D__BIG_ENDIAN__} \
%{!mb:-D__LITTLE_ENDIAN__} \
%{m3e:-D__SH3E__} \
%{m4:-D__SH4__} \
%{!m3e:%{!m4:-D__SH3__ -D__sh3__}} \
%{fPIC:-D__PIC__ -D__pic__} \
%{fpic:-D__PIC__ -D__pic__} \
%{posix:-D_POSIX_SOURCE} \
%{pthread:-D_REENTRANT -D_PTHREADS}"
#undef CPP_PREDEFINES
#define CPP_PREDEFINES "-D__ELF__ -Dunix -D__sh__ -Dlinux -Asystem(posix)"
#undef ASM_SPEC
#define ASM_SPEC "%{!mb:-little} %{mrelax:-relax}"
#undef CC1_SPEC
#define CC1_SPEC \
"-musermode %{!mb:-ml} %{!m3e:%{!m4:-m3}}"
#undef CC1PLUS_SPEC
#define CC1PLUS_SPEC \
"-musermode %{!mb:-ml} %{!m3e:%{!m4:-m3}}"
#undef LINK_SPEC
#define LINK_SPEC \
"%{!mb:-m shlelf_linux} %{mrelax:-relax} \
%{shared:-shared} \
%{!static: \
%{rdynamic:-export-dynamic} \
%{!dynamic-linker:-dynamic-linker /lib/ld.so.1} \
%{!rpath:-rpath /lib}} \
%{static:-static}"
#undef LIB_SPEC
#define LIB_SPEC \
"%{shared: -lc} \
%{!shared: %{pthread:-lthread} \
%{profile:-lc_p} %{!profile: -lc}}"
#undef STARTFILE_SPEC
#define STARTFILE_SPEC \
"%{!shared: \
%{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
%{!p:%{profile:gcrt1.o%s} \
%{!profile:crt1.o%s}}}} \
crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
......@@ -109,6 +109,7 @@ extern int target_flags;
#define SPACE_BIT (1<<13)
#define BIGTABLE_BIT (1<<14)
#define RELAX_BIT (1<<15)
#define USERMODE_BIT (1<<16)
#define HITACHI_BIT (1<<22)
#define NOMACSAVE_BIT (1<<23)
#define PREFERGOT_BIT (1<<24)
......@@ -184,6 +185,9 @@ extern int target_flags;
/* Nonzero if generating code for a little endian SH. */
#define TARGET_LITTLE_ENDIAN (target_flags & LITTLE_ENDIAN_BIT)
/* Nonzero if we should do everything in userland. */
#define TARGET_USERMODE (target_flags & USERMODE_BIT)
/* Nonzero if we should prefer @GOT calls when generating PIC. */
#define TARGET_PREFERGOT (target_flags & PREFERGOT_BIT)
......@@ -210,6 +214,7 @@ extern int target_flags;
{"prefergot", PREFERGOT_BIT}, \
{"relax", RELAX_BIT}, \
{"space", SPACE_BIT}, \
{"usermode", USERMODE_BIT}, \
SUBTARGET_SWITCHES \
{"", TARGET_DEFAULT} \
}
......@@ -1201,6 +1206,13 @@ extern int current_function_anonymous_args;
emit_move_insn (gen_rtx_MEM (SImode, plus_constant ((TRAMP), 12)), \
(FNADDR)); \
if (TARGET_HARVARD) \
{ \
if (TARGET_USERMODE) \
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__ic_invalidate"),\
0, VOIDmode, 1, (TRAMP), SImode); \
else \
emit_insn (gen_ic_invalidate_line (TRAMP)); \
} \
emit_insn (gen_ic_invalidate_line (TRAMP)); \
}
......
TARGET_LIBGCC2_CFLAGS = -fpic
LIBGCC1 = libgcc1-asm.a
LIB1ASMFUNCS = _ashiftrt _ashiftrt_n _ashiftlt _lshiftrt _movstr \
_movstr_i4 _mulsi3 _sdivsi3 _sdivsi3_i4 _udivsi3 _udivsi3_i4 _set_fpscr \
_ic_invalidate
MULTILIB_OPTIONS= mb m3e/m4
MULTILIB_DIRNAMES=
MULTILIB_MATCHES =
EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o crtbeginS.o crtendS.o
......@@ -3358,6 +3358,16 @@ changequote([,])dnl
tm_file="sh/sh.h sh/rtems.h"
float_format=sh
;;
sh-*-linux*)
tm_file="sh/sh.h sh/elf.h sh/linux.h"
tmake_file="sh/t-sh sh/t-elf sh/t-linux"
xmake_file=x-linux
gas=yes gnu_ld=yes
if test x$enable_threads = xyes; then
thread_file='posix'
fi
float_format=sh
;;
sh-*-*)
float_format=sh
;;
......
......@@ -419,6 +419,7 @@ in the following sections.
-mbigtable -mfmovd -mhitachi -mnomacsave
-misize -mpadstruct -mspace
-mprefergot
-musermode
@emph{System V Options}
-Qy -Qn -YP,@var{paths} -Ym,@var{dir}
......@@ -6722,6 +6723,12 @@ Optimize for space instead of speed. Implied by @code{-Os}.
@item -mprefergot
When generating position-independent code, emit function calls using
the Global Offset Table instead of the Procedure Linkage Table.
@item -musermode
Generate a library function call to invalidate instruction cache
entries, after fixing up a trampoline. This library function call
doesn't assume it can write to the whole memory address space. This
is the default when the target is @code{sh-*-linux*}.
@end table
@node System V Options
......
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