cppfiles.c (INO_T_EQ): Handle UWIN.

* cppfiles.c (INO_T_EQ): Handle UWIN.
        * c-common.c (decl_attributes): Flag unrecognized attribute
        functions as warnings instead of as errors.
        Support for i386-pc-uwin.
        * i386/uwin.h: New file.
        * i386/xm-uwin.h: New file.
        * i386/t-uwin: New file.
        * i386/uwin.asm: New file.
        * configure.in (i[3456]86-*-uwin*): Define.
        Add Workaround for vfork bug when hosted on uwin.
        * configure: Regenerate.
        * cccp.c (INO_T_EQ): Undefine. UWIN has inodes.
        (absolute_filename): UWIN uses POSIX pathnames only.
        * libgcc2.c (getpagesize): Do not define for UWIN.
        (mprotect): Likewise.
        * protoize.c (dirent.h): Conditionally include.
        (fputc): Prototype only if it's not a macro.

From-SVN: r25696
This commit is contained in:
Mumit Khan 1999-03-11 00:58:01 +00:00 committed by Jeff Law
parent 8c90d2af84
commit b27d2bd5fe
12 changed files with 478 additions and 214 deletions

View File

@ -1,3 +1,26 @@
Thu Mar 11 01:38:02 1999 Mumit Khan <khan@xraylith.wisc.edu>
* cppfiles.c (INO_T_EQ): Handle UWIN.
* c-common.c (decl_attributes): Flag unrecognized attribute
functions as warnings instead of as errors.
Support for i386-pc-uwin.
* i386/uwin.h: New file.
* i386/xm-uwin.h: New file.
* i386/t-uwin: New file.
* i386/uwin.asm: New file.
* configure.in (i[3456]86-*-uwin*): Define.
Add Workaround for vfork bug when hosted on uwin.
* configure: Regenerate.
* cccp.c (INO_T_EQ): Undefine. UWIN has inodes.
(absolute_filename): UWIN uses POSIX pathnames only.
* libgcc2.c (getpagesize): Do not define for UWIN.
(mprotect): Likewise.
* protoize.c (dirent.h): Conditionally include.
(fputc): Prototype only if it's not a macro.
Wed Mar 10 02:49:04 1999 Jason Merrill <jason@yorick.cygnus.com>
* configure.in: Remove init_priority stuff.

View File

@ -730,7 +730,7 @@ decl_attributes (node, attributes, prefix_attributes)
format_type = strftime_format_type;
else
{
error ("`%s' is an unrecognized format function type", p);
warning ("`%s' is an unrecognized format function type", p);
continue;
}
}

View File

@ -78,7 +78,8 @@ static int hack_vms_include_specification ();
#endif /* VMS */
/* Windows does not natively support inodes, and neither does MSDOS. */
#if (defined (_WIN32) && ! defined (__CYGWIN__)) || defined (__MSDOS__)
#if (defined (_WIN32) && ! defined (__CYGWIN__) && ! defined (_UWIN)) \
|| defined (__MSDOS__)
#define INO_T_EQ(a, b) 0
#endif
@ -4907,7 +4908,8 @@ static int
absolute_filename (filename)
char *filename;
{
#if defined (__MSDOS__) || (defined (_WIN32) && !defined (__CYGWIN__))
#if defined (__MSDOS__) \
|| (defined (_WIN32) && !defined (__CYGWIN__) && !defined (_UWIN))
if (ISALPHA (filename[0]) && filename[1] == ':') filename += 2;
#endif
#if defined (__CYGWIN__)

5
gcc/config/i386/t-uwin Normal file
View File

@ -0,0 +1,5 @@
#
# This is included *after* t-cygwin to override LIB1ASMSRC.
#
LIB1ASMSRC = i386/uwin.asm

32
gcc/config/i386/uwin.asm Normal file
View File

@ -0,0 +1,32 @@
/* stuff needed for libgcc1 on win32. */
#ifdef L_chkstk
.global __chkstk
.global __alloca
__chkstk:
__alloca:
pushl %ecx /* save temp */
movl %esp,%ecx /* get sp */
addl $0x8,%ecx /* and point to return addr */
probe: cmpl $0x1000,%eax /* > 4k ?*/
jb done
subl $0x1000,%ecx /* yes, move pointer down 4k*/
orl $0x0,(%ecx) /* probe there */
subl $0x1000,%eax /* decrement count */
jmp probe /* and do it again */
done: subl %eax,%ecx
orl $0x0,(%ecx) /* less that 4k, just peek here */
movl %esp,%eax
movl %ecx,%esp /* decrement stack */
movl (%eax),%ecx /* recover saved temp */
movl 4(%eax),%eax /* get return address */
jmp *%eax
#endif

93
gcc/config/i386/uwin.h Normal file
View File

@ -0,0 +1,93 @@
/* Operating system specific defines to be used when targeting GCC for
hosting on U/WIN (Windows32), using GNU tools and the Windows32 API
Library, as distinct from winnt.h, which is used to build GCC for use
with a windows style library and tool set and uses the Microsoft tools.
Copyright (C) 1999 Free Software Foundation, Inc.
Contributed by Mumit Khan <khan@xraylith.wisc.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. */
/* Most of this is the same as for Cygwin32, except for changing some
specs. */
#include "i386/cygwin.h"
#define STANDARD_INCLUDE_COMPONENT "UWIN"
#define SYSTEM_INCLUDE_DIR "/usr/gnu/include"
#undef CPP_PREDEFINES
#define CPP_PREDEFINES "-D__i386__ -D_WIN32 -D__WIN32__ \
-D_UWIN -DWINNT -D_X86_=1 -D__STDC__=1 \
-D__UWIN__ -D__MSVCRT__ \
-D_STD_INCLUDE_DIR=mingw32 \
-D__stdcall=__attribute__((__stdcall__)) \
_D_stdcall=__attribute__((__stdcall__)) \
-D__cdecl=__attribute__((__cdecl__)) \
-D__declspec(x)=__attribute__((x)) \
-Asystem(winnt) -Acpu(i386) -Amachine(i386)"
#undef CPP_SPEC
#define CPP_SPEC "-remap %(cpp_cpu) %{posix:-D_POSIX_SOURCE} \
-include /usr/include/astwin32.h \
-iprefix /usr/gnu/include -iwithprefix /mingw32"
/* For Windows applications, include more libraries, but always include
kernel32. */
#undef LIB_SPEC
#define LIB_SPEC \
"%{mwindows:-luser32 -lgdi32 -lcomdlg32} -lkernel32 -ladvapi32"
/* This is needed in g77spec.c for now. Will be removed in the future. */
#define WIN32_UWIN_TARGET 1
/* Include in the mingw32 libraries with libgcc */
#undef LIBGCC_SPEC
#define LIBGCC_SPEC "-lgnuwin -lposix -lgcc -last -lmoldname -lmsvcrt"
/* Specify a different entry point when linking a DLL */
#undef LINK_SPEC
#define LINK_SPEC \
"%{mwindows:--subsystem windows} %{mdll:--dll -e _DllMainCRTStartup@12}"
#undef STARTFILE_SPEC
#define STARTFILE_SPEC "%{mdll:dllcrt2%O%s} %{!mdll:crt2%O%s}"
/* These are PE BFD bug workarounds. Should go away eventually. */
#undef ASM_DECLARE_FUNCTION_NAME
#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
do \
{ \
if (i386_pe_dllexport_name_p (NAME)) \
{ \
drectve_section (); \
fprintf ((FILE), "\t.ascii \" -export:%s\"\n", \
I386_PE_STRIP_ENCODING (NAME)); \
function_section (DECL); \
} \
/* disable i386_pe_declare_function_type for UWIN */ \
if (0 && write_symbols != SDB_DEBUG) \
i386_pe_declare_function_type (FILE, NAME, TREE_PUBLIC (DECL)); \
ASM_OUTPUT_LABEL (FILE, NAME); \
} \
while (0)
#undef ASM_OUTPUT_EXTERNAL
#undef ASM_OUTPUT_EXTERNAL_LIBCALL
#undef ASM_FILE_END

39
gcc/config/i386/xm-uwin.h Normal file
View File

@ -0,0 +1,39 @@
/* Configuration for GNU C-compiler for hosting on Windows32.
using GNU tools and the Windows32 API Library.
Copyright (C) 1999 Free Software Foundation, Inc.
Contributed by Mumit Khan <khan@xraylith.wisc.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 ONLY_INT_FIELD
#define ONLY_INT_FIELDS 1
#endif
#ifndef USE_PROTOTYPES
#define USE_PROTOTYPES 1
#endif
/* U/WIN system calls only support '/' */
#undef DIR_SEPARATOR
#define DIR_SEPARATOR '/'
#undef EXECUTABLE_SUFFIX
#define EXECUTABLE_SUFFIX ".exe"
#undef PATH_SEPARATOR
#define PATH_SEPARATOR ':'

457
gcc/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -377,6 +377,15 @@ AC_CHECK_FUNCS(strtoul bsearch strerror putenv popen bcopy bzero bcmp \
GCC_FUNC_VFPRINTF_DOPRNT
GCC_FUNC_PRINTF_PTR
case "${host}" in
*-*-uwin*)
# Under some versions of uwin, vfork is notoriously buggy and the test
# can hang configure; on other versions, vfork exists just as a stub.
# FIXME: This should be removed once vfork in uwin's runtime is fixed.
ac_cv_func_vfork_works=no
;;
esac
AC_FUNC_VFORK
GCC_NEED_DECLARATIONS(malloc realloc calloc free bcopy bzero bcmp \
@ -1537,6 +1546,21 @@ changequote([,])dnl
;;
esac
;;
changequote(,)dnl
i[34567]86-*-uwin*)
changequote([,])dnl
tm_file=i386/uwin.h
xm_file="${xm_file} i386/xm-uwin.h"
xm_defines="USG NO_STAB_H NO_SYS_SIGLIST"
tmake_file="i386/t-cygwin i386/t-uwin"
extra_objs=winnt.o
xmake_file=i386/x-cygwin
fixincludes=Makefile.in
if test x$enable_threads = xyes; then
thread_file='win32'
fi
exeext=.exe
;;
changequote(,)dnl
i[34567]86-*-winnt3*)
changequote([,])dnl

View File

@ -54,7 +54,8 @@ static void hack_vms_include_specification PROTO ((char *));
VMS has non-numeric inodes. */
#ifdef VMS
#define INO_T_EQ(a, b) (!bcmp((char *) &(a), (char *) &(b), sizeof (a)))
#elif (defined _WIN32 && !defined CYGWIN) || defined __MSDOS__
#elif (defined _WIN32 && !defined CYGWIN && ! defined (_UWIN)) \
|| defined __MSDOS__
#define INO_T_EQ(a, b) 0
#else
#define INO_T_EQ(a, b) ((a) == (b))

View File

@ -2576,7 +2576,7 @@ __clear_cache (char *beg, char *end)
/* Jump to a trampoline, loading the static chain address. */
#if defined(WINNT) && ! defined(__CYGWIN__)
#if defined(WINNT) && ! defined(__CYGWIN__) && ! defined (_UWIN)
long getpagesize()
{
@ -2615,7 +2615,7 @@ mprotect (char *addr, int len, int prot)
return -1;
}
#endif
#endif /* WINNT && ! __CYGWIN__ && ! _UWIN */
#ifdef TRANSFER_FROM_TRAMPOLINE
TRANSFER_FROM_TRAMPOLINE

View File

@ -60,7 +60,7 @@ Boston, MA 02111-1307, USA. */
#include "system.h"
#include "intl.h"
#if ! defined (_WIN32) || defined (__CYGWIN__)
#if ! defined (_WIN32) || defined (__CYGWIN__) || defined (_UWIN)
#if defined(POSIX) || defined(CONCURRENT)
#include <dirent.h>
#else
@ -145,7 +145,9 @@ extern int puts ();
#ifndef fputs /* This may have been #defined by "system.h". */
extern int fputs ();
#endif
#ifndef fputc /* some systems define this as a macro. */
extern int fputc ();
#endif
extern int unlink ();
extern int access ();