win32 fixes

Mumit Khan khan@xraylith.wisc.EDU
Mon Feb 8 10:53:00 GMT 1999


Various minor fixes/changes that I've been using for 1.1.x binary release,
but never submitted for inclusion in the dev branch.

The patch to i386/cygwin.h warns if -fpic/-fPIC is specified, and then
ignores the flag; I'll send a separate patch for the testsuite to avoid 
false negatives.

Sun Feb  7 17:53:16 1999  Mumit Khan  <khan@xraylith.wisc.edu>

	* i386/cygwin.h (SUBTARGET_OVERRIDE_OPTIONS): New macro to ignore 
	fpic/fPIC for windows32 targets.
	* i386/xm-cygwin.h (GET_ENV_PATH_LIST): Replace '\\' in windows32
	paths with '/'.
	* i386/mingw32.h (CPP_SPEC): Define.
	(CPP_PREDEFINES): Add MINGW32 version id.
	* i386/crtdll.h (CPP_PREDEFINES): Likewise.

Index: gcc/config/i386/cygwin.h
===================================================================
RCS file: /mounts/sda7/src/gnu/CVSROOT/egcs-dev/gcc/config/i386/cygwin.h,v
retrieving revision 1.1.1.1
diff -u -3 -p -r1.1.1.1 cygwin.h
--- gcc/config/i386/cygwin.h	1999/02/07 23:35:20	1.1.1.1
+++ gcc/config/i386/cygwin.h	1999/02/08 18:09:17
@@ -2,7 +2,7 @@
    hosting on Windows NT 3.x, using a Unix style C library and tools,
    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) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
 
 This file is part of GNU CC.
 
@@ -234,6 +234,20 @@ switch_to_section (section, decl) 				\
     assemble_name (FILE, NAME);			\
     fprintf (FILE, "\n");			\
   } while (0)
+
+/* Don't allow flag_pic to propagate since gas may produce invalid code
+   otherwise. */
+
+#undef  SUBTARGET_OVERRIDE_OPTIONS
+#define SUBTARGET_OVERRIDE_OPTIONS					\
+do {									\
+  if (flag_pic)								\
+    {									\
+      warning ("-f%s ignored for target (all code is position independent)",\
+	       (flag_pic > 1) ? "PIC" : "pic");				\
+      flag_pic = 0;							\
+    }									\
+} while (0)								\
 
 /* Define this macro if references to a symbol must be treated
    differently depending on something about the variable or
Index: gcc/config/i386/xm-cygwin.h
===================================================================
RCS file: /mounts/sda7/src/gnu/CVSROOT/egcs-dev/gcc/config/i386/xm-cygwin.h,v
retrieving revision 1.1.1.1
diff -u -3 -p -r1.1.1.1 xm-cygwin.h
--- gcc/config/i386/xm-cygwin.h	1999/02/07 23:35:27	1.1.1.1
+++ gcc/config/i386/xm-cygwin.h	1999/02/08 18:09:49
@@ -1,6 +1,6 @@
 /* Configuration for GNU C-compiler for hosting on Windows NT.
    using a unix style C library.
-   Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
 
 This file is part of GNU CC.
 
@@ -47,9 +47,15 @@ do {									\
   if (_epath != NULL && *_epath != 0					\
       && cygwin32_posix_path_list_p (_epath))				\
     {									\
+      char *p;								\
       _win32epath = (char *) xmalloc					\
 	(cygwin32_posix_to_win32_path_list_buf_size (_epath));		\
       cygwin32_posix_to_win32_path_list (_epath, _win32epath);		\
+      for (p = _win32epath; p && *p; ++p)				\
+        {								\
+	  if (*p == '\\')						\
+	    *p = '/';							\
+	}								\
     }									\
   (VAR) = _win32epath;							\
 } while (0)
Index: gcc/config/i386/crtdll.h
===================================================================
RCS file: /mounts/sda7/src/gnu/CVSROOT/egcs-dev/gcc/config/i386/crtdll.h,v
retrieving revision 1.1.1.1
diff -u -3 -p -r1.1.1.1 crtdll.h
--- gcc/config/i386/crtdll.h	1999/02/07 23:35:20	1.1.1.1
+++ gcc/config/i386/crtdll.h	1999/02/08 18:09:25
@@ -3,7 +3,7 @@
    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.
    This variant uses CRTDLL.DLL insted of MSVCRTDLL.DLL.
-   Copyright (C) 1998 Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999 Free Software Foundation, Inc.
 
 This file is part of GNU CC.
 
@@ -24,7 +24,7 @@ Boston, MA 02111-1307, USA. */
 
 #undef CPP_PREDEFINES
 #define CPP_PREDEFINES "-Di386 -D_WIN32 -DWIN32 -D__WIN32__ \
-  -D__MINGW32__ -DWINNT  -D_X86_=1 -D__STDC__=1\
+  -D__MINGW32__=0.2 -DWINNT  -D_X86_=1 -D__STDC__=1\
   -D__stdcall=__attribute__((__stdcall__)) \
   -D_stdcall=__attribute__((__stdcall__)) \
   -D__cdecl=__attribute__((__cdecl__)) \
Index: gcc/config/i386/mingw32.h
===================================================================
RCS file: /mounts/sda7/src/gnu/CVSROOT/egcs-dev/gcc/config/i386/mingw32.h,v
retrieving revision 1.1.1.1
diff -u -3 -p -r1.1.1.1 mingw32.h
--- gcc/config/i386/mingw32.h	1999/02/07 23:35:21	1.1.1.1
+++ gcc/config/i386/mingw32.h	1999/02/08 18:09:30
@@ -2,7 +2,7 @@
    hosting on 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) 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
 
 This file is part of GNU CC.
 
@@ -31,7 +31,7 @@ Boston, MA 02111-1307, USA. */
    distinguish MSVC from CRTDLL runtime in mingw headers. */
 #undef CPP_PREDEFINES
 #define CPP_PREDEFINES "-Di386 -D_WIN32 -DWIN32 -D__WIN32__ \
-  -D__MINGW32__ -D__MSVCRT__ -DWINNT  -D_X86_=1 -D__STDC__=1\
+  -D__MINGW32__=0.2 -D__MSVCRT__ -DWINNT  -D_X86_=1 -D__STDC__=1\
   -D__stdcall=__attribute__((__stdcall__)) \
   -D_stdcall=__attribute__((__stdcall__)) \
   -D__cdecl=__attribute__((__cdecl__)) \
@@ -43,6 +43,9 @@ Boston, MA 02111-1307, USA. */
 #define STANDARD_INCLUDE_DIR "/usr/local/i386-mingw32/include"
 
 #define STANDARD_INCLUDE_COMPONENT "MINGW32"
+
+#undef CPP_SPEC
+#define CPP_SPEC "-remap %(cpp_cpu) %{posix:-D_POSIX_SOURCE}"
 
 /* For Windows applications, include more libraries, but always include
    kernel32.  */


More information about the Gcc-patches mailing list