Commit 979721f8 by Michael Meissner

Cygwin32 support; Make eabi update stack first before doing stores in prolog

From-SVN: r11259
parent 126e5b0d
......@@ -35,7 +35,7 @@ Boston, MA 02111-1307, USA. */
#define CPP_PREDEFINES "-DWIN32 -D__WIN32__ -D__WINNT__ \
-D__CYGWIN32__ -DPOSIX \
-D_POWER -DPPC -Asystem(winnt) -Acpu(powerpc) -Amachine(powerpc)"
-D_POWER -D_ARCH_PPC -D__PPC__ -Asystem(winnt) -Acpu(powerpc) -Amachine(powerpc)"
/* We have to dynamic link to get to the system dlls,
and I've put all of libc and libm and the unix stuff into
......@@ -49,10 +49,6 @@ Boston, MA 02111-1307, USA. */
#define LINK_SPEC "%{v:-V}"
/* No need for libgcc, it's in the shared library. */
#undef LIBGCC_SPEC
#define LIBGCC_SPEC ""
#undef STARTFILE_SPEC
#define STARTFILE_SPEC "%{!:crt0%O%s}"
......@@ -62,3 +58,7 @@ Boston, MA 02111-1307, USA. */
#define WCHAR_TYPE "short unsigned int"
/* XXX set up stack probing */
#define DBX_DEBUGGING_INFO
#undef SDB_DEBUGGING_INFO
#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
# CYGNUS LOCAL -- NT/WRS development, meissner
# Allocate stack for NT, inserting stack probes every 4k pages
.file "ntstack.asm"
# Setup MS Structured-Exception-Handling
.pdata
.align 2
.ualong ..__allocate_stack,__allocate_stack.e,0,0,__allocate_stack.b
# Switch to the relocation section
.reldata
.globl __allocate_stack
.globl ..__allocate_stack
__allocate_stack:
.ualong ..__allocate_stack,.toc
.text
.align 2
..__allocate_stack:
.function ..__allocate_stack
__allocate_stack.b:
lwz 0,0(1) # old stack link
srawi. 4,3,12 # get # of pages to check
neg 3,3 # negate so we can use stwux
bgt- 0,.Lcheck
stwux 0,1,3 # small request, just decrement and return
blr
.Lcheck:
mtctr 4 # number of pages to check
mr 5,1 # tmp pointer
.Lloop:
lwzu 6,-4096(5) # touch the page
bdnz+ .Lloop # and loop back
stwux 0,1,3 # update stack pointer
blr
__allocate_stack.e:
FE_MOT_RESVD..__allocate_stack:
# END CYGNUS LOCAL -- NT/WRS development, meissner
......@@ -6327,6 +6327,18 @@
emit_move_insn (chain, stack_bot);
/* Under Windows NT, we need to add stack probes for large/variable allocations,
so do it via a call to the external function alloca, instead of doing it
inline. */
if (DEFAULT_ABI == ABI_NT
&& (GET_CODE (operands[0]) != CONST_INT || INTVAL (operands[0]) > 4096))
{
emit_library_call (gen_rtx (SYMBOL_REF, Pmode, \"__allocate_stack\"), 0,
VOIDmode, 1,
operands[0], Pmode);
DONE;
}
if (GET_CODE (operands[0]) != CONST_INT
|| INTVAL (operands[0]) < -32767
|| INTVAL (operands[0]) > 32768)
......
......@@ -9,7 +9,7 @@ LIBGCC1_TEST =
# These are really part of libgcc1, but this will cause them to be
# built correctly, so... [taken from t-sparclite]
LIB2FUNCS_EXTRA = fp-bit.c dp-bit.c
LIB2FUNCS_EXTRA = fp-bit.c dp-bit.c ntstack.s
dp-bit.c: $(srcdir)/config/fp-bit.c
cat $(srcdir)/config/fp-bit.c > dp-bit.c
......@@ -18,10 +18,5 @@ fp-bit.c: $(srcdir)/config/fp-bit.c
echo '#define FLOAT' > fp-bit.c
cat $(srcdir)/config/fp-bit.c >> fp-bit.c
# Build the libraries for both hard and soft floating point
MULTILIB_OPTIONS = msoft-float
MULTILIB_DIRNAMES = soft-float
LIBGCC = stmp-multilib
INSTALL_LIBGCC = install-multilib
ntstack.s: $(srcdir)/config/rs6000/ntstack.asm
cat $(srcdir)/config/rs6000/ntstack.asm > ntstack.s
......@@ -36,7 +36,7 @@ Boston, MA 02111-1307, USA. */
#undef CPP_PREDEFINES
#define CPP_PREDEFINES "-DWIN32 -D_WIN32 \
-DWINNT -D__STDC__=0 -DALMOST_STDC \
-D_POWER -DPPC -Asystem(winnt) -Acpu(powerpc) -Amachine(powerpc)"
-D_POWER -D_ARCH_PPC -D__PPC__ -Asystem(winnt) -Acpu(powerpc) -Amachine(powerpc)"
#if 0
#include "winnt/win-nt.h"
......
/* Configuration for GNU C-compiler for hosting on Windows NT.
using a unix style C library.
Copyright (C) 1995 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
#define NO_STAB_H
#include "rs6000/xm-rs6000.h"
#define HAVE_STRERROR
#define HAVE_RUSAGE
#define HAVE_FILE_H
......@@ -95,6 +95,9 @@ dfoo ()
message saying the start address is defaulted. */
extern void start() __asm__("start");
extern void _start() __asm__("_start");
extern void __start() __asm__("__start");
void start() {}
void _start() {}
void __start() {}
void mainCRTStartup() {}
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