Commit 052dbd9e by Mumit Khan Committed by Jeff Law

configure.in: Add i386-pc-interix support.

        * configure.in: Add i386-pc-interix support.
        * configure: Regenerate.
        * fixinc.interix: New file.
        * config/interix.h: New file.
        * config/x-interix: New file.
        * config/xm-interix.h: New file.
        * i386/interix.h: New file.
        * i386/interix.c: New file.
        * i386/t-interix: New file.

Co-Authored-By: Donn Terry <donn@interix.com>

From-SVN: r25910
parent 65954bd8
Mon Mar 22 23:52:01 1999 Mumit Khan <khan@xraylith.wisc.edu>
Donn Terry <donn@interix.com>
* configure.in: Add i386-pc-interix support.
* configure: Regenerate.
* fixinc.interix: New file.
* config/interix.h: New file.
* config/x-interix: New file.
* config/xm-interix.h: New file.
* i386/interix.h: New file.
* i386/interix.c: New file.
* i386/t-interix: New file.
Mon Mar 22 23:41:49 1999 Jeffrey A Law (law@cygnus.com)
* i386.h (PREFERRED_STACK_BOUNDARY): Define.
......
/* Subroutines for insn-output.c for Windows NT.
Copyright (C) 1998, 1999 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. */
#include "config.h"
#include "system.h"
#include "rtl.h"
#include "regs.h"
#include "hard-reg-set.h"
#include "output.h"
#include "tree.h"
#include "flags.h"
/* Return string which is the former assembler name modified with a
suffix consisting of an atsign (@) followed by the number of bytes of
arguments */
char *
gen_stdcall_suffix (decl)
tree decl;
{
int total = 0;
/* ??? This probably should use XSTR (XEXP (DECL_RTL (decl), 0), 0) instead
of DECL_ASSEMBLER_NAME. */
char *asmname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
char *newsym;
if (TYPE_ARG_TYPES (TREE_TYPE (decl)))
if (TREE_VALUE (tree_last (TYPE_ARG_TYPES (TREE_TYPE (decl))))
== void_type_node)
{
tree formal_type = TYPE_ARG_TYPES (TREE_TYPE (decl));
while (TREE_VALUE (formal_type) != void_type_node)
{
int parm_size
= TREE_INT_CST_LOW (TYPE_SIZE (TREE_VALUE (formal_type)));
/* Must round up to include padding. This is done the same
way as in store_one_arg. */
parm_size = ((parm_size + PARM_BOUNDARY - 1)
/ PARM_BOUNDARY * PARM_BOUNDARY);
total += parm_size;
formal_type = TREE_CHAIN (formal_type);
}
}
newsym = xmalloc (strlen (asmname) + 10);
sprintf (newsym, "%s@%d", asmname, total/BITS_PER_UNIT);
return IDENTIFIER_POINTER (get_identifier (newsym));
}
#if 0
/* Turn this back on when the linker is updated to handle grouped
.data$ sections correctly. See corresponding note in i386/interix.h.
MK. */
/* Cover function for UNIQUE_SECTION. */
void
i386_pe_unique_section (decl, reloc)
tree decl;
int reloc;
{
int len;
char *name,*string,*prefix;
name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
/* Strip off any encoding in fnname. */
STRIP_NAME_ENCODING (name, name);
/* The object is put in, for example, section .text$foo.
The linker will then ultimately place them in .text
(everything from the $ on is stripped). Don't put
read-only data in .rdata section to avoid a PE linker
bug when .rdata$* grouped sections are used in code
without a .rdata section. */
if (TREE_CODE (decl) == FUNCTION_DECL)
prefix = ".text$";
else if (DECL_READONLY_SECTION (decl, reloc))
#ifdef READONLY_DATA_SECTION
prefix = ".rdata$";
#else
prefix = ".text$";
#endif
else
prefix = ".data$";
len = strlen (name) + strlen (prefix);
string = alloca (len + 1);
sprintf (string, "%s%s", prefix, name);
DECL_SECTION_NAME (decl) = build_string (len, string);
}
#endif /* 0 */
# t-interix
LIBGCC1 = libgcc1-asm.a
CROSS_LIBGCC1 = libgcc1-asm.a
LIB1ASMSRC = i386/cygwin.asm
LIB1ASMFUNCS = _chkstk
interix.o: $(srcdir)/config/i386/interix.c
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/i386/interix.c
/* Operating system specific defines to be used when targeting GCC for
Interix
Copyright (C) 1994, 1995, 1999 Free Software Foundation, Inc.
Donn Terry, Softway Systems, Inc. (donn@softway.com)
Modified from code
Contributed by Douglas B. Rupp (drupp@cs.washington.edu).
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. */
#define TARGET_MEM_FUNCTIONS
/* POSIX/Uni-thread only for now. Look at the winnt version
for windows/multi thread */
/* We need multiple -lc -lcpsx because they mutually refer;
that should go away someday */
#undef LIB_SPEC
#define LIB_SPEC "\
%{!shared:%{!dynamic:-lc -lcpsx -lc -lcpsx %$INTERIX_ROOT/usr/lib/psxdll.a \
%$INTERIX_ROOT/usr/lib/psxdll2.a \
}} \
%{!G:%{!dynamic:-lc -lcpsx -lc -lcpsx %$INTERIX_ROOT/usr/lib/psxdll.a \
%$INTERIX_ROOT/usr/lib/psxdll2.a \
}} \
%{dynamic:-lc %$INTERIX_ROOT/usr/lib/psxdll.a \
%$INTERIX_ROOT/usr/lib/psxdll2.a \
} \
%{v}"
#undef LINK_SPEC
#define LINK_SPEC "%{!shared:-stack 0x400000,0x10000} \
-subsystem posix \
%{g} \
%{dynamic:-Bdynamic} \
%{static:-Bstatic} \
%{shared:--shared -Bdynamic} \
%{G:--shared -Bdynamic} \
%{symbolic:--shared -Bsymbolic -Bdynamic} \
%{soname*:--soname %*} \
%{rpath*:--rpath %*} \
"
#undef STARTFILE_SPEC
#define STARTFILE_SPEC \
"%{!shared:%{pg:gcrt0%O%s}%{!pg:%{p:mcrt0%O%s}%{!p:crt0%O%s}}} %{shared:crti%O%s}"
#undef WORD_SWITCH_TAKES_ARG
#define WORD_SWITCH_TAKES_ARG(STR) \
((DEFAULT_WORD_SWITCH_TAKES_ARG (STR) \
|| !strcmp(STR, "rpath")) \
&& strcmp (STR, "Tdata") && strcmp (STR, "Ttext") \
&& strcmp (STR, "Tbss"))
#if 0
/* don't do this until we can sort out the default path issues. MK */
#undef STANDARD_EXEC_PREFIX
#define STANDARD_EXEC_PREFIX ""
#undef STANDARD_STARTFILE_PREFIX
#define STANDARD_STARTFILE_PREFIX ""
#undef TOOLDIR_BASE_PREFIX
#define TOOLDIR_BASE_PREFIX ""
#endif /* 0 */
#undef STDC_VALUE
#define STDC_VALUE 0
# These are host overrides
# From config dir
# Interix doesn't yet have alloca; it's better to use the portable C version for
# bootstrapping. Do this by defining ALLOCA.
ALLOCA = alloca.o
# See all the declarations.
FIXPROTO_DEFINES = -D_XOPEN_SOURCE
# Don't run fixproto
STMP_FIXPROTO =
RANLIB = :
RANLIB_TEST = false
SHELL = sh
# Existing CC/GCC may not define -D__INTERIX, so need this here.
X_CFLAGS= -D__INTERIX
LIBGCC2_INCLUDES = -idirafter $${INTERIX_ROOT}/usr/include
# Headers come from a funny place
SYSTEM_HEADER_DIR=$${INTERIX_ROOT}/usr/include
EXTRA_PARTS += crti.o
crti.o: $(srcdir)/crti.c
$(GCC_FOR_TARGET) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/crti.c
/* Configuration for GNU compiler for processor running Interix
Copyright (C) 1993, 1995, 1999 Free Software Foundation, Inc.
Donn Terry, Softway Systems, Inc,
from code
Contributed by Douglas B. Rupp (drupp@cs.washington.edu)
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. */
#ifndef USG
#define USG 1
#endif
#ifndef ONLY_INT_FIELDS
#define ONLY_INT_FIELDS 1
#endif
#ifndef USE_PROTOTYPES
#define USE_PROTOTYPES 1
#endif
/* If not compiled with GNU C, use the portable alloca. */
#ifndef __GNUC__
#define USE_C_ALLOCA 1
#endif
#define NO_SYS_SIGLIST 1
/* Our strategy for finding global constructors is a bit different, although
not a lot. */
#define DO_GLOBAL_CTORS_BODY \
do { \
int i; \
unsigned long nptrs; \
func_ptr *p; \
asm( \
" .section .ctor_head, \"rw\"\n" \
"1:\n" \
" .text \n" \
ASM_LOAD_ADDR(1b,%0) \
: "=r" (p) : : "cc"); \
for (nptrs = 0; p[nptrs] != 0; nptrs++); \
for (i = nptrs-1; i >= 0; i--) \
p[i] (); \
} while (0)
#define DO_GLOBAL_DTORS_BODY \
do { \
func_ptr *p; \
asm( \
" .section .dtor_head, \"rw\"\n" \
"1:\n" \
" .text \n" \
ASM_LOAD_ADDR(1b,%0) \
: "=r" (p) : : "cc"); \
while (*p) \
{ \
p++; \
(*(p-1)) (); \
} \
} while (0)
......@@ -1500,6 +1500,23 @@ changequote([,])dnl
exeext=.exe
;;
changequote(,)dnl
i[34567]86-*-interix*)
changequote([,])dnl
tm_file=i386/interix.h
xm_file="${xm_file} xm-interix.h"
xm_defines="USG NO_SYS_SIGLIST"
tmake_file="i386/t-interix"
extra_objs=interix.o
xmake_file=x-interix
fixincludes=fixinc.interix
if [[ x$enable_threads = xyes ]]; then
thread_file='posix'
fi
if [[ x$stabs = xyes ]]; then
tm_file="${tm_file} dbxcoff.h"
fi
;;
changequote(,)dnl
i[34567]86-*-winnt3*)
changequote([,])dnl
tm_file=i386/win-nt.h
......
#!/bin/sh
#
# fixinc.interix -- Install modified versions of Interix system include
# files.
#
# Based on fixinc.sco script by Ian Lance Taylor (ian@airs.com)).
# With modifications by Douglas Rupp (drupp@cs.washington.edu)
#
# 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.
#
# ?????? fixup comment
# This script munges the native include files provided with Windows NT
# 3.5 SDK systems so as to provide a reasonable namespace when
# compiling with gcc. The header files by default do not
# provide many essential definitions and declarations if
# __STDC__ is 1. This script modifies the header files to check
# for __STRICT_ANSI__ being defined instead. Once munged, the
# resulting new system include files are placed in a directory
# that GNU C will search *before* searching the Include
# directory.
#
# See README-fixinc for more information.
ORIG_DIR=$(pwd)
# Fail if no arg to specify a directory for the output.
if [ x$1 = x ]; then
echo fixincludes: no output directory specified
echo usage $0 output input
exit 1
fi
# Fail if no arg to specify a directory for the input
if [ x$2 = x ]; then
echo fixincludes: no input directory specified
echo usage $0 output input
exit 1
fi
INPUT=$2
# Directory in which to store the results.
LIB=$1
mkdir -p $LIB || exit 1
# Make LIB absolute if it is relative.
# Don't do this if not necessary, since may screw up automounters.
case $LIB in
/*)
;;
*)
cd $LIB; LIB=$(pwd)
;;
esac
echo 'Building fixincludes in' ${LIB}
# Determine whether this filesystem has symbolic links.
if ln -s X $LIB/ShouldNotExist 2>/dev/null; then
rm -f $LIB/ShouldNotExist
LINKS=true
else
LINKS=false
fi
cd ${INPUT}
if $LINKS; then
files=`ls -LR | sed -n s/:$//p`
else
files=`find . -type d -print | sed '/^.$/d'`
fi
if [ "x$files" = x ]; then
echo No files found in $INPUT\; skipped
exit 0
fi
echo 'Making directories:'
for file in $files; do
rm -rf $LIB/$file
if [ ! -d $LIB/$file ]; then
echo $LIB/$file
mkdir $LIB/$file
fi
done
# treetops gets an alternating list
# of old directories to copy
# and the new directories to copy to.
treetops="${INPUT} ${LIB}"
set - $treetops
while [ $# != 0 ]; do
# $1 is an old directory to copy, and $2 is the new directory to copy to.
echo "Finding header files in $1:"
cd ${INPUT}
cd $1
files=`find . -name '*.[hH]' -type f -print`
echo "Checking header files in $1; transforming into directory $2:"
for file in $files; do
echo " " $file
if [ -r $file ]; then
cp $file $2/$file >/dev/null 2>&1 || echo "Can't copy $file"
chmod +w,a+r $2/$file
# The following have been removed from the sed command below
# because it is more useful to leave these things in.
# The only reason to remove them was for -pedantic,
# which isn't much of a reason. -- rms.
# ??? above/below
# /^[ ]*#[ ]*ident/d
# s/!__STDC__/!defined (__STRICT_ANSI__)/g
sed -e '/#[ ]*include.*[<"][A-Za-z]:\\/ s,\\,/,g' \
-e '/#[ ]*include.*[<"][A-Za-z]:\// s,\([A-Za-z]\):/,//\1/,' \
-e '\,#[ ]*include.*[<"]//[A-Za-z]/, y,abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ,' \
-e '\,#[ ]*INCLUDE.*[<"]//[A-Za-z]/, s,INCLUDE,include,' \
$2/$file > $2/$file.sed
mv $2/$file.sed $2/$file
if cmp $file $2/$file >/dev/null 2>&1; then
rm $2/$file
else
echo Fixed $file
flip -u $2/$file
fi
fi
done
shift; shift
done
echo 'Removing unneeded directories:'
# (Rmdir leaf to root, and if the rmdir fails, who cares....)
cd $LIB
files=`find . -type d -print | sort -r`
for file in $files; do
rmdir $LIB/$file > /dev/null 2>&1
done
exit 0
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