Commit 345a6161 by David S. Miller

[multiple changes]

Thu Sep 24 01:35:34 1998  David S. Miller  <davem@pierdol.cobaltmicro.com>
	* config/sparc/sol2-sld-64.h (TRANSFER_FROM_TRAMPOLINE): Define.
	* config/sparc/sparc.c (sparc64_initialize_trampoline): If that is
	defined, emit libcall to __enable_execute_stack.  Also fix opcodes
	and offsets in actual stack trampoline code so they match the
	commentary and actually work.
Thu Sep 24 01:19:02 1998  Jakub Jelinek  <jj@sunsite.ms.mff.cuni.cz>
	* configure.in (sparcv9-*-solaris): Use t-sol2 and t-sol2-64 for
	tmake_file.
	(sparc64-*-linux): Use t-linux and sparc/t-linux64 for
	tmake_file.  Set extra_parts to needed crt objects.
	* configure: Rebuilt.
	* config/sparc/linux64.h (SPARC_BI_ARCH): Define.
	(TARGET_DEFAULT): Set if default is v9 or ultra.
	(STARTFILE_SPEC32, STARTFILE_SPEC64): New macros.
	(STARTFILE_SPEC): Set to those upon SPARC_BI_ARCH.
	(ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_SPEC): Likewise.
	(SUBTARGET_EXTRA_SPECS, LINK_ARCH32_SPEC, LINK_ARCH64_SPEC,
	LINK_SPEC, LINK_ARCH_SPEC): Likewise.
	(TARGET_VERSION): Define.
	(MULTILIB_DEFAULT): Define.
	* config/sparc/sparc.h (CPP_CPU_DEFAULT_SPEC): Rearrange so that
	mixed 32/64 bit compilers based upon SPARC_BI_ARCH work.
	(CPP_CPU64_DEFAULT_SPEC, CPP_CPU32_DEFAULT_SEC): Define
	appropriately.
	(TARGET_SWITCHES): Allow ptr32/ptr64 options once more.
	* config/sparc/sparc.c (sparc_override_options): If arch and
	pointer size disagree, emit diagnostic and fix it up.  If
	SPARC_BI_ARCH and TARGET_ARCH32, set cmodel to CM_32.  Turn off
	V8PLUS in 64-bit mode.
	* config/sparc/t-linux64: New file.
	* config/sparc/t-sol2-64: New file.
	* config/sparc/t-sol2: Adjust build rules to use MULTILIB_CFLAGS.
	* config/sparc/sol2-sld-64.h (SPARC_BI_ARCH): Define.
	(ASM_CPU32_DEFAULT_SPEC, ASM_CPU64_DEFAULT_SPEC,
	CPP_CPU32_DEFAULT_SPEC, CPP_CPU64_DEFAULT_SPEC): Define.
	(ASM_SPEC, CPP_CPU_SPEC): Set appropriately based upon those.
	(STARTFILE_SPEC32, STARTFILE_SPEC32, STARTFILE_ARCH_SPEC):
	Define.
	(STARTFILE_SPEC): Set approriately based upon those.
	(CPP_CPU_DEFAULT_SPEC, ASM_CPU_DEFAULT_SPEC): Set based upon
	disposition of DEFAULT_ARCH32_P.
	(LINK_ARCH32_SPEC, LINK_ARCH64_SPEC): Define.
	(LINK_ARCH_SPEC, LINK_ARCH_DEFAULT_SPEC): Set based upon those.
	(CC1_SPEC, MULTILIB_DEFAULTS): Set based upon DEFAULT_ARCH32_P.
	(MD_STARTFILE_PREFIX): Set correctly based upon SPARC_BI_ARCH.
	* config/sparc/xm-sysv4-64.h (HOST_BITS_PER_LONG): Only set on
	arch64/v9.
	* config/sparc/xm-sp64.h (HOST_BITS_PER_LONG): Likewise.

From-SVN: r22565
parent 8d9716c6
Thu Sep 24 01:35:34 1998 David S. Miller <davem@pierdol.cobaltmicro.com>
* config/sparc/sol2-sld-64.h (TRANSFER_FROM_TRAMPOLINE): Define.
* config/sparc/sparc.c (sparc64_initialize_trampoline): If that is
defined, emit libcall to __enable_execute_stack. Also fix opcodes
and offsets in actual stack trampoline code so they match the
commentary and actually work.
Thu Sep 24 01:19:02 1998 Jakub Jelinek <jj@sunsite.ms.mff.cuni.cz>
* configure.in (sparcv9-*-solaris): Use t-sol2 and t-sol2-64 for
tmake_file.
(sparc64-*-linux): Use t-linux and sparc/t-linux64 for
tmake_file. Set extra_parts to needed crt objects.
* configure: Rebuilt.
* config/sparc/linux64.h (SPARC_BI_ARCH): Define.
(TARGET_DEFAULT): Set if default is v9 or ultra.
(STARTFILE_SPEC32, STARTFILE_SPEC64): New macros.
(STARTFILE_SPEC): Set to those upon SPARC_BI_ARCH.
(ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_SPEC): Likewise.
(SUBTARGET_EXTRA_SPECS, LINK_ARCH32_SPEC, LINK_ARCH64_SPEC,
LINK_SPEC, LINK_ARCH_SPEC): Likewise.
(TARGET_VERSION): Define.
(MULTILIB_DEFAULT): Define.
* config/sparc/sparc.h (CPP_CPU_DEFAULT_SPEC): Rearrange so that
mixed 32/64 bit compilers based upon SPARC_BI_ARCH work.
(CPP_CPU64_DEFAULT_SPEC, CPP_CPU32_DEFAULT_SEC): Define
appropriately.
(TARGET_SWITCHES): Allow ptr32/ptr64 options once more.
* config/sparc/sparc.c (sparc_override_options): If arch and
pointer size disagree, emit diagnostic and fix it up. If
SPARC_BI_ARCH and TARGET_ARCH32, set cmodel to CM_32. Turn off
V8PLUS in 64-bit mode.
* config/sparc/t-linux64: New file.
* config/sparc/t-sol2-64: New file.
* config/sparc/t-sol2: Adjust build rules to use MULTILIB_CFLAGS.
* config/sparc/sol2-sld-64.h (SPARC_BI_ARCH): Define.
(ASM_CPU32_DEFAULT_SPEC, ASM_CPU64_DEFAULT_SPEC,
CPP_CPU32_DEFAULT_SPEC, CPP_CPU64_DEFAULT_SPEC): Define.
(ASM_SPEC, CPP_CPU_SPEC): Set appropriately based upon those.
(STARTFILE_SPEC32, STARTFILE_SPEC32, STARTFILE_ARCH_SPEC):
Define.
(STARTFILE_SPEC): Set approriately based upon those.
(CPP_CPU_DEFAULT_SPEC, ASM_CPU_DEFAULT_SPEC): Set based upon
disposition of DEFAULT_ARCH32_P.
(LINK_ARCH32_SPEC, LINK_ARCH64_SPEC): Define.
(LINK_ARCH_SPEC, LINK_ARCH_DEFAULT_SPEC): Set based upon those.
(CC1_SPEC, MULTILIB_DEFAULTS): Set based upon DEFAULT_ARCH32_P.
(MD_STARTFILE_PREFIX): Set correctly based upon SPARC_BI_ARCH.
* config/sparc/xm-sysv4-64.h (HOST_BITS_PER_LONG): Only set on
arch64/v9.
* config/sparc/xm-sp64.h (HOST_BITS_PER_LONG): Likewise.
Wed Sep 23 22:32:31 1998 Mark Mitchell <mark@markmitchell.com>
* rtl.h (init_virtual_regs): New function.
......
......@@ -19,9 +19,7 @@ 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. */
/* ??? bi-architecture support will require changes to the linker
related specs, among perhaps other things (multilibs). */
/* #define SPARC_BI_ARCH */
#define SPARC_BI_ARCH
#define LINUX_DEFAULT_ELF
......@@ -36,6 +34,16 @@ Boston, MA 02111-1307, USA. */
#undef MD_EXEC_PREFIX
#undef MD_STARTFILE_PREFIX
#if TARGET_CPU_DEFAULT == TARGET_CPU_v9 || TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc
/* A 64 bit v9 compiler with stack-bias,
in a Medium/Low code model environment. */
#undef TARGET_DEFAULT
#define TARGET_DEFAULT \
(MASK_V9 + MASK_PTR64 + MASK_64BIT /* + MASK_HARD_QUAD */ \
+ MASK_STACK_BIAS + MASK_APP_REGS + MASK_EPILOGUE + MASK_FPU)
#endif
/* Output at beginning of assembler file. */
/* The .file command should always begin the output. */
#undef ASM_FILE_START
......@@ -54,11 +62,37 @@ Boston, MA 02111-1307, USA. */
object constructed before entering `main'. */
#undef STARTFILE_SPEC
#define STARTFILE_SPEC \
#define STARTFILE_SPEC32 \
"%{!shared: \
%{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}}\
crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
#define STARTFILE_SPEC64 \
"%{!shared: \
%{pg:/usr/lib64/gcrt1.o%s} %{!pg:%{p:/usr/lib64/gcrt1.o%s} %{!p:/usr/lib64/crt1.o%s}}}\
/usr/lib64/crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
#ifdef SPARC_BI_ARCH
#if DEFAULT_ARCH32_P
#define STARTFILE_SPEC "\
%{m32:" STARTFILE_SPEC32 "} \
%{m64:" STARTFILE_SPEC64 "} \
%{!m32:%{!m64:" STARTFILE_SPEC32 "}}"
#else
#define STARTFILE_SPEC "\
%{m32:" STARTFILE_SPEC32 "} \
%{m64:" STARTFILE_SPEC64 "} \
%{!m32:%{!m64:" STARTFILE_SPEC64 "}}"
#endif
#else
#define STARTFILE_SPEC STARTFILE_SPEC64
#endif
/* Provide a ENDFILE_SPEC appropriate for GNU/Linux. Here we tack on
the GNU/Linux magical crtend.o file (see crtstuff.c) which
provides part of the support for getting C++ file-scope static
......@@ -66,19 +100,35 @@ Boston, MA 02111-1307, USA. */
GNU/Linux "finalizer" file, `crtn.o'. */
#undef ENDFILE_SPEC
#define ENDFILE_SPEC \
#define ENDFILE_SPEC32 \
"%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
#undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (sparc64 GNU/Linux with ELF)");
#define ENDFILE_SPEC64 \
"%{!shared:crtend.o%s} %{shared:crtendS.o%s} /usr/lib64/crtn.o%s"
#ifdef SPARC_BI_ARCH
/* A 64 bit v9 compiler with stack-bias,
in a Medium/Anywhere code model environment. */
#if DEFAULT_ARCH32_P
#define ENDFILE_SPEC "\
%{m32:" ENDFILE_SPEC32 "} \
%{m64:" ENDFILE_SPEC64 "} \
%{!m32:%{!m64:" ENDFILE_SPEC32 "}}"
#else
#define ENDFILE_SPEC "\
%{m32:" ENDFILE_SPEC32 "} \
%{m64:" ENDFILE_SPEC64 "} \
%{!m32:%{!m64:" ENDFILE_SPEC64 "}}"
#endif
#undef TARGET_DEFAULT
#define TARGET_DEFAULT \
(MASK_V9 + MASK_PTR64 + MASK_64BIT /* + MASK_HARD_QUAD */ \
+ MASK_STACK_BIAS + MASK_APP_REGS + MASK_EPILOGUE + MASK_FPU)
#else
#define ENDFILE_SPEC ENDFILE_SPEC64
#endif
#undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (sparc64 GNU/Linux with ELF)");
/* The default code model. */
#undef SPARC_DEFAULT_CMODEL
......@@ -92,7 +142,7 @@ Boston, MA 02111-1307, USA. */
#undef LONG_DOUBLE_TYPE_SIZE
#define LONG_DOUBLE_TYPE_SIZE 128
#undef CPP_PREDEFINES
#define CPP_PREDEFINES "-D__ELF__ -Dunix -Dsparc -Dlinux -Asystem(unix) -Asystem(posix)"
......@@ -126,17 +176,88 @@ Boston, MA 02111-1307, USA. */
/* If ELF is the default format, we should not use /lib/elf. */
#ifdef SPARC_BI_ARCH
#undef SUBTARGET_EXTRA_SPECS
#define SUBTARGET_EXTRA_SPECS \
{ "link_arch32", LINK_ARCH32_SPEC }, \
{ "link_arch64", LINK_ARCH64_SPEC }, \
{ "link_arch_default", LINK_ARCH_DEFAULT_SPEC }, \
{ "link_arch", LINK_ARCH_SPEC },
#define LINK_ARCH32_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
%{!shared: \
%{!ibcs: \
%{!static: \
%{rdynamic:-export-dynamic} \
%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
%{static:-static}}} \
"
#define LINK_ARCH64_SPEC "-m elf64_sparc -Y P,/usr/lib64 %{shared:-shared} \
%{!shared: \
%{!ibcs: \
%{!static: \
%{rdynamic:-export-dynamic} \
%{!dynamic-linker:-dynamic-linker /lib64/ld-linux.so.2}} \
%{static:-static}}} \
"
#define LINK_ARCH_SPEC "\
%{m32:%(link_arch32)} \
%{m64:%(link_arch64)} \
%{!m32:%{!m64:%(link_arch_default)}} \
"
#define LINK_ARCH_DEFAULT_SPEC \
(DEFAULT_ARCH32_P ? LINK_ARCH32_SPEC : LINK_ARCH64_SPEC)
#undef LINK_SPEC
#define LINK_SPEC "-m elf64_sparc -Y P,/usr/lib %{shared:-shared} \
#define LINK_SPEC "\
%(link_arch) \
%{mlittle-endian:-EL} \
"
#undef CC1_SPEC
#if DEFAULT_ARCH32_P
#define CC1_SPEC "\
%{sun4:} %{target:} \
%{mcypress:-mcpu=cypress} \
%{msparclite:-mcpu=sparclite} %{mf930:-mcpu=f930} %{mf934:-mcpu=f934} \
%{mv8:-mcpu=v8} %{msupersparc:-mcpu=supersparc} \
%{m64:-mptr64 -mcpu=ultrasparc -mstack-bias} \
"
#else
#define CC1_SPEC "\
%{sun4:} %{target:} \
%{mcypress:-mcpu=cypress} \
%{msparclite:-mcpu=sparclite} %{mf930:-mcpu=f930} %{mf934:-mcpu=f934} \
%{mv8:-mcpu=v8} %{msupersparc:-mcpu=supersparc} \
%{m32:-mptr32 -mcpu=cypress -mno-stack-bias} \
"
#endif
#if DEFAULT_ARCH32_P
#define MULTILIB_DEFAULTS { "m32" }
#else
#define MULTILIB_DEFAULTS { "m64" }
#endif
#else /* !SPARC_BI_ARCH */
#undef LINK_SPEC
#define LINK_ARCH_SPEC "-m elf64_sparc -Y P,/usr/lib64 %{shared:-shared} \
%{!shared: \
%{!ibcs: \
%{!static: \
%{rdynamic:-export-dynamic} \
%{!dynamic-linker:-dynamic-linker /lib/ld-linux64.so.2}} \
%{!dynamic-linker:-dynamic-linker /lib64/ld-linux.so.2}} \
%{static:-static}}} \
%{mlittle-endian:-EL} \
"
#endif /* !SPARC_BI_ARCH */
/* The sun bundled assembler doesn't accept -Yd, (and neither does gas).
It's safe to pass -s always, even if -g is not used. */
#undef ASM_SPEC
......
......@@ -210,7 +210,7 @@ sparc_override_options ()
struct cpu_table *cpu;
struct sparc_cpu_select *sel;
int fpu;
#ifndef SPARC_BI_ARCH
/* Check for unsupported architecture size. */
if (! TARGET_64BIT != DEFAULT_ARCH32_P)
......@@ -220,8 +220,25 @@ sparc_override_options ()
}
#endif
/* At the moment we don't allow different pointer size and architecture */
if (! TARGET_64BIT != ! TARGET_PTR64)
{
error ("-mptr%d not allowed on -m%d",
TARGET_PTR64 ? 64 : 32, TARGET_64BIT ? 64 : 32);
if (TARGET_64BIT)
target_flags |= MASK_PTR64;
else
target_flags &= ~MASK_PTR64;
}
/* Code model selection. */
sparc_cmodel = SPARC_DEFAULT_CMODEL;
#ifdef SPARC_BI_ARCH
if (TARGET_ARCH32)
sparc_cmodel = CM_32;
#endif
if (sparc_cmodel_string != NULL)
{
if (TARGET_ARCH64)
......@@ -280,8 +297,8 @@ sparc_override_options ()
if (TARGET_V9 && TARGET_ARCH32)
target_flags |= MASK_DEPRECATED_V8_INSNS;
/* V8PLUS requires V9 */
if (! TARGET_V9)
/* V8PLUS requires V9, makes no sense in 64 bit mode. */
if (! TARGET_V9 || TARGET_ARCH64)
target_flags &= ~MASK_V8PLUS;
/* Don't use stack biasing in 32 bit mode. */
......@@ -5453,6 +5470,11 @@ void
sparc64_initialize_trampoline (tramp, fnaddr, cxt)
rtx tramp, fnaddr, cxt;
{
#ifdef TRANSFER_FROM_TRAMPOLINE
emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "__enable_execute_stack"),
0, VOIDmode, 1, tramp, Pmode);
#endif
/*
rd %pc, %g1
ldx [%g1+24], %g5
......@@ -5466,12 +5488,13 @@ sparc64_initialize_trampoline (tramp, fnaddr, cxt)
emit_move_insn (gen_rtx_MEM (SImode, plus_constant (tramp, 4)),
GEN_INT (0xca586018));
emit_move_insn (gen_rtx_MEM (SImode, plus_constant (tramp, 8)),
GEN_INT (0x81c04000));
GEN_INT (0x81c14000));
emit_move_insn (gen_rtx_MEM (SImode, plus_constant (tramp, 12)),
GEN_INT (0xca586010));
emit_move_insn (gen_rtx_MEM (DImode, plus_constant (tramp, 16)), cxt);
emit_move_insn (gen_rtx_MEM (DImode, plus_constant (tramp, 20)), fnaddr);
emit_move_insn (gen_rtx_MEM (DImode, plus_constant (tramp, 24)), fnaddr);
emit_insn (gen_flush (validize_mem (gen_rtx_MEM (DImode, tramp))));
if (sparc_cpu != PROCESSOR_ULTRASPARC)
emit_insn (gen_flush (validize_mem (gen_rtx_MEM (DImode, plus_constant (tramp, 8)))));
}
......
......@@ -109,34 +109,74 @@ extern enum cmodel sparc_cmodel;
#define TARGET_CPU_sparc64 5 /* alias */
#define TARGET_CPU_ultrasparc 6
#if TARGET_CPU_DEFAULT == TARGET_CPU_sparc || TARGET_CPU_DEFAULT == TARGET_CPU_v8 || TARGET_CPU_DEFAULT == TARGET_CPU_supersparc
#define CPP_CPU_DEFAULT_SPEC ""
#define ASM_CPU_DEFAULT_SPEC ""
#endif
#if TARGET_CPU_DEFAULT == TARGET_CPU_sparclet
#define CPP_CPU_DEFAULT_SPEC "-D__sparclet__"
#define ASM_CPU_DEFAULT_SPEC "-Asparclet"
#endif
#if TARGET_CPU_DEFAULT == TARGET_CPU_sparclite
#define CPP_CPU_DEFAULT_SPEC "-D__sparclite__"
#define ASM_CPU_DEFAULT_SPEC "-Asparclite"
#endif
#if TARGET_CPU_DEFAULT == TARGET_CPU_v9 || TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc
#define CPP_CPU32_DEFAULT_SPEC ""
#define ASM_CPU32_DEFAULT_SPEC ""
#if TARGET_CPU_DEFAULT == TARGET_CPU_v9
/* ??? What does Sun's CC pass? */
#define CPP_CPU_DEFAULT_SPEC "-D__sparc_v9__"
#define CPP_CPU64_DEFAULT_SPEC "-D__sparc_v9__"
/* ??? It's not clear how other assemblers will handle this, so by default
use GAS. Sun's Solaris assembler recognizes -xarch=v8plus, but this case
is handled in sol2.h. */
#define ASM_CPU_DEFAULT_SPEC "-Av9"
#define ASM_CPU64_DEFAULT_SPEC "-Av9"
#endif
#if TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc
#define CPP_CPU_DEFAULT_SPEC "-D__sparc_v9__"
#define ASM_CPU_DEFAULT_SPEC "-Av9a"
#define CPP_CPU64_DEFAULT_SPEC "-D__sparc_v9__"
#define ASM_CPU64_DEFAULT_SPEC "-Av9a"
#endif
#else
#define CPP_CPU64_DEFAULT_SPEC ""
#define ASM_CPU64_DEFAULT_SPEC ""
#if TARGET_CPU_DEFAULT == TARGET_CPU_sparc || TARGET_CPU_DEFAULT == TARGET_CPU_v8 || TARGET_CPU_DEFAULT == TARGET_CPU_supersparc
#define CPP_CPU32_DEFAULT_SPEC ""
#define ASM_CPU32_DEFAULT_SPEC ""
#endif
#if TARGET_CPU_DEFAULT == TARGET_CPU_sparclet
#define CPP_CPU32_DEFAULT_SPEC "-D__sparclet__"
#define ASM_CPU32_DEFAULT_SPEC "-Asparclet"
#endif
#ifndef CPP_CPU_DEFAULT_SPEC
#if TARGET_CPU_DEFAULT == TARGET_CPU_sparclite
#define CPP_CPU32_DEFAULT_SPEC "-D__sparclite__"
#define ASM_CPU32_DEFAULT_SPEC "-Asparclite"
#endif
#endif
#if !defined(CPP_CPU32_DEFAULT_SPEC) || !defined(CPP_CPU64_DEFAULT_SPEC)
Unrecognized value in TARGET_CPU_DEFAULT.
#endif
#ifdef SPARC_BI_ARCH
#define CPP_CPU_DEFAULT_SPEC \
(DEFAULT_ARCH32_P ? "\
%{m64:" CPP_CPU64_DEFAULT_SPEC "} \
%{!m64:" CPP_CPU32_DEFAULT_SPEC "} \
" : "\
%{m32:" CPP_CPU32_DEFAULT_SPEC "} \
%{!m32:" CPP_CPU64_DEFAULT_SPEC "} \
")
#define ASM_CPU_DEFAULT_SPEC \
(DEFAULT_ARCH32_P ? "\
%{m64:" ASM_CPU64_DEFAULT_SPEC "} \
%{!m64:" ASM_CPU32_DEFAULT_SPEC "} \
" : "\
%{m32:" ASM_CPU32_DEFAULT_SPEC "} \
%{!m32:" ASM_CPU64_DEFAULT_SPEC "} \
")
#else /* !SPARC_BI_ARCH */
#define CPP_CPU_DEFAULT_SPEC (DEFAULT_ARCH32_P ? CPP_CPU32_DEFAULT_SPEC : CPP_CPU64_DEFAULT_SPEC)
#define ASM_CPU_DEFAULT_SPEC (DEFAULT_ARCH32_P ? ASM_CPU32_DEFAULT_SPEC : ASM_CPU64_DEFAULT_SPEC)
#endif /* !SPARC_BI_ARCH */
/* Names to predefine in the preprocessor for this target machine.
??? It would be nice to not include any subtarget specific values here,
however there's no way to portably provide subtarget values to
......@@ -171,8 +211,20 @@ Unrecognized value in TARGET_CPU_DEFAULT.
sparc64 in 32 bit environments, so for now we only use `sparc64' in
64 bit environments. */
#ifdef SPARC_BI_ARCH
#define CPP_ARCH32_SPEC "-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int \
-D__GCC_NEW_VARARGS__ -Acpu(sparc) -Amachine(sparc)"
#define CPP_ARCH64_SPEC "-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int \
-D__arch64__ -Acpu(sparc64) -Amachine(sparc64)"
#else
#define CPP_ARCH32_SPEC "-D__GCC_NEW_VARARGS__ -Acpu(sparc) -Amachine(sparc)"
#define CPP_ARCH64_SPEC "-D__arch64__ -Acpu(sparc64) -Amachine(sparc64)"
#endif
#define CPP_ARCH_DEFAULT_SPEC \
(DEFAULT_ARCH32_P ? CPP_ARCH32_SPEC : CPP_ARCH64_SPEC)
......@@ -413,8 +465,7 @@ extern int target_flags;
/* 0x2000, 0x4000 are unused */
/* Nonzero if pointers are 64 bits.
This is not a user selectable option, though it may be one day -
so it is used to determine pointer size instead of an architecture flag. */
At the moment it must follow architecture size flag. */
#define MASK_PTR64 0x8000
#define TARGET_PTR64 (target_flags & MASK_PTR64)
......@@ -512,9 +563,8 @@ extern int target_flags;
{"v8", 0}, \
{"supersparc", 0}, \
/* End of deprecated options. */ \
/* -mptrNN exists for *experimental* purposes. */ \
/* {"ptr64", MASK_PTR64}, */ \
/* {"ptr32", -MASK_PTR64}, */ \
{"ptr64", MASK_PTR64}, \
{"ptr32", -MASK_PTR64}, \
{"32", -MASK_64BIT}, \
{"64", MASK_64BIT}, \
{"stack-bias", MASK_STACK_BIAS}, \
......
MULTILIB_OPTIONS = m64/m32
MULTILIB_DIRNAMES = 64 32
MULTILIB_MATCHES =
LIBGCC = stmp-multilib
INSTALL_LIBGCC = install-multilib
EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o crtbeginS.o crtendS.o
tcrtbeginS.o: crtstuff.c $(GCC_PASSES) $(CONFIG_H) \
defaults.h frame.h gbl-ctors.h
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
-finhibit-size-directive -fno-inline-functions -fno-exceptions $(CRTSTUFF_T_CFLAGS_S) \
-c $(srcdir)/crtstuff.c -DCRT_BEGIN -o tcrtbeginS$(objext)
tcrtendS.o: crtstuff.c $(GCC_PASSES) $(CONFIG_H) \
defaults.h frame.h gbl-ctors.h
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
-finhibit-size-directive -fno-inline-functions -fno-exceptions $(CRTSTUFF_T_CFLAGS_S) \
-c $(srcdir)/crtstuff.c -DCRT_END -o tcrtendS$(objext)
......@@ -6,19 +6,19 @@ CROSS_LIBGCC1 =
LIBGCC1_TEST =
# gmon build rule:
gmon.o: $(srcdir)/config/sparc/gmon-sol2.c $(GCC_PASSES) $(CONFIG_H) stmp-int-hdrs
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) \
-c $(srcdir)/config/sparc/gmon-sol2.c -o gmon.o
$(T)gmon.o: $(srcdir)/config/sparc/gmon-sol2.c $(GCC_PASSES) $(CONFIG_H) stmp-int-hdrs
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) \
-c $(srcdir)/config/sparc/gmon-sol2.c -o $(T)gmon.o
# Assemble startup files.
crt1.o: $(srcdir)/config/sparc/sol2-c1.asm $(GCC_PASSES)
$(GCC_FOR_TARGET) -c -o crt1.o -x assembler-with-cpp $(srcdir)/config/sparc/sol2-c1.asm
crti.o: $(srcdir)/config/sparc/sol2-ci.asm $(GCC_PASSES)
$(GCC_FOR_TARGET) -c -o crti.o -x assembler-with-cpp $(srcdir)/config/sparc/sol2-ci.asm
crtn.o: $(srcdir)/config/sparc/sol2-cn.asm $(GCC_PASSES)
$(GCC_FOR_TARGET) -c -o crtn.o -x assembler-with-cpp $(srcdir)/config/sparc/sol2-cn.asm
gcrt1.o: $(srcdir)/config/sparc/sol2-c1.asm $(GCC_PASSES)
$(GCC_FOR_TARGET) -c -DGCRT1 -o gcrt1.o -x assembler-with-cpp $(srcdir)/config/sparc/sol2-c1.asm
$(T)crt1.o: $(srcdir)/config/sparc/sol2-c1.asm $(GCC_PASSES)
$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)crt1.o -x assembler-with-cpp $(srcdir)/config/sparc/sol2-c1.asm
$(T)crti.o: $(srcdir)/config/sparc/sol2-ci.asm $(GCC_PASSES)
$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/sparc/sol2-ci.asm
$(T)crtn.o: $(srcdir)/config/sparc/sol2-cn.asm $(GCC_PASSES)
$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/sparc/sol2-cn.asm
$(T)gcrt1.o: $(srcdir)/config/sparc/sol2-c1.asm $(GCC_PASSES)
$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -DGCRT1 -o $(T)gcrt1.o -x assembler-with-cpp $(srcdir)/config/sparc/sol2-c1.asm
# We need to use -fPIC when we are using gcc to compile the routines in
# crtstuff.c. This is only really needed when we are going to use gcc/g++
......
MULTILIB_OPTIONS = m32/m64
MULTILIB_DIRNAMES = sparcv7 sparcv9
MULTILIB_MATCHES =
LIBGCC = stmp-multilib
INSTALL_LIBGCC = install-multilib
EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o gmon.o crt1.o crti.o crtn.o gcrt1.o
......@@ -21,5 +21,7 @@ Boston, MA 02111-1307, USA. */
#include <sparc/xm-sparc.h>
/* This describes the machine the compiler is hosted on. */
#if defined(__arch64__) || defined(__sparc_v9__) || defined(__sparcv9)
#undef HOST_BITS_PER_LONG
#define HOST_BITS_PER_LONG 64
#endif
......@@ -21,5 +21,7 @@ Boston, MA 02111-1307, USA. */
#include <sparc/xm-sysv4.h>
/* This describes the machine the compiler is hosted on. */
#if defined(__arch64__) || defined(__sparc_v9__) || defined(__sparcv9)
#undef HOST_BITS_PER_LONG
#define HOST_BITS_PER_LONG 64
#endif
......@@ -2878,7 +2878,7 @@ changequote([,])dnl
tm_file=sparc/sol2-sld-64.h
xm_file="sparc/xm-sysv4-64.h sparc/xm-sol2.h"
xm_defines="USG POSIX"
tmake_file=sparc/t-sol2
tmake_file="sparc/t-sol2 sparc/t-sol2-64"
xmake_file=sparc/x-sysv4
extra_parts="crt1.o crti.o crtn.o gcrt1.o crtbegin.o crtend.o"
fixincludes=fixinc.wrap
......@@ -2986,11 +2986,12 @@ changequote([,])dnl
extra_parts="crtbegin.o crtend.o"
;;
sparc64-*-linux*) # 64-bit Sparc's running GNU/Linux
tmake_file=sparc/t-sp64
tmake_file="t-linux sparc/t-linux64"
xm_file="sparc/xm-sp64.h sparc/xm-linux.h"
tm_file=sparc/linux64.h
xmake_file=x-linux
fixincludes=Makefile.in # The headers are ok already.
extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
gnu_ld=yes
;;
# This hasn't been upgraded to GCC 2.
......
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