This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

SCO OpenServer / UnixWare port update


All,

Attached is a fairly large patch to bring the SCO platforms
up to date. These patches were made against 4.0.3 HEAD of
a day or so ago. An almost identical patch would apply to
the mainline.

I have separated the various bits into their own sections.
If Mark is reading this list, since these patches are almost
exclusively SCO-specific (except for the testcase patches
which affect all x86 platforms currently getting errors with
-fPIC), can I make these changes on the mainline too? And
the 4.1 branch?

Note that there is one outstanding issue with regards to
vectorization stuff, but thats enough of a fringe case
that I would like to get the rest of this stuff in, and
then work on that last problem separately.

TIA.

Kean

PS I am not subscribed to this list so please address any
responses to me explicitly.
Top level changes:

2005-10-07  Kean Johnston  <jkj@sco.com>

	* config.guess: Add support for SCO OpenServer 6.
	* config.sub: Add -sco6 and -sco5v6 as a recognized host. sco5v6
	is the prefered way of differentiating OpenServer 6 from generic
	sysv5.
	* config.rpath: Update for SCO OpenServer and UnixWare.
	* configure.in: SCO OpenServer now supports GNU ld.
	Include the svr5 fragment for OpenServer 6. Dont try to build
	Java on SCO Platforms (yet).
	Ada and fortran dont work on SCO platforms. Exclude them.
	* libtool.m4: Update for SCO OpenServer and UnixWare.
	* ltcf-c.sh: Ditto.
	* ltcf-cxx.sh: Ditto.
	* ltcf-gcj: Ditto.
	* ltmain.sh: Ditto. Also add the ability, should it be required,
	to explicitly name the generated shared library via an optional
	4th argument to --version-info.
	* config/mmap.m4: New file. The stock autoconf tests for mmap
	are pesimistically strict. They test for mmap features that only
	a tiny percentage of applications use, but yet fail the presense
	of mmap completely if those features do not exist. This new test
	tests for basic mmap functionality, and sets HAVE_MMAP if it works.
	It checks for the more esoteric MAP_FIXED and sets HAVE_MMAP_FIXED
	if that works too.

Index: config.guess
===================================================================
RCS file: /cvs/gcc/gcc/config.guess,v
retrieving revision 1.67
diff -u -3 -p -u -r1.67 config.guess
--- config.guess	16 Nov 2004 00:57:00 -0000	1.67
+++ config.guess	13 Oct 2005 04:55:30 -0000
@@ -1024,7 +1024,7 @@ EOF
 		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
 	fi
 	exit 0 ;;
-    i*86:*:5:[78]*)
+    i*86:*:5:[678]*)
 	case `/bin/uname -X | grep "^Machine"` in
 	    *486*)	     UNAME_MACHINE=i486 ;;
 	    *Pentium)	     UNAME_MACHINE=i586 ;;
Index: config.rpath
===================================================================
RCS file: /cvs/gcc/gcc/config.rpath,v
retrieving revision 1.1
diff -u -3 -p -u -r1.1 config.rpath
--- config.rpath	4 Jul 2003 18:18:43 -0000	1.1
+++ config.rpath	13 Oct 2005 04:55:30 -0000
@@ -83,15 +83,13 @@ else
     osf3* | osf4* | osf5*)
       wl='-Wl,'
       ;;
-    sco3.2v5*)
-      ;;
     solaris*)
       wl='-Wl,'
       ;;
     sunos4*)
       wl='-Qoption ld '
       ;;
-    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+    sco3.2v5* | sco5v6*| sysv4 | sysv4.2uw2* | sysv4.3* | sysv5* | UnixWare* | OpenUNIX* | unixware7*)
       wl='-Wl,'
       ;;
     sysv4*MP*)
@@ -378,7 +376,9 @@ else
       fi
       hardcode_libdir_separator=:
       ;;
-    sco3.2v5*)
+    sco3.2v5* | sco5v6* | sysv5* | OpenUNIX* | UnixWare* | unixware7*)
+      hardcode_libdir_flag_spec='-R $libdir'
+      hardcode_libdir_separator=:
       ;;
     solaris*)
       hardcode_libdir_flag_spec='-R$libdir'
@@ -412,11 +412,6 @@ else
       hardcode_direct=yes
       hardcode_minus_L=no
       ;;
-    sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[78]* | unixware7*)
-      ;;
-    sysv5*)
-      hardcode_libdir_flag_spec=
-      ;;
     uts4*)
       hardcode_libdir_flag_spec='-L$libdir'
       ;;
@@ -500,13 +495,11 @@ case "$host_os" in
     ;;
   osf3* | osf4* | osf5*)
     ;;
-  sco3.2v5*)
-    ;;
   solaris*)
     ;;
   sunos4*)
     ;;
-  sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+  sco3.2v5* | sco5v6* | sysv4 | sysv4.2uw2* | sysv4.3* | sysv5* | OpenUNIX* | UnixWare* | unixware7*)
     ;;
   sysv4*MP*)
     ;;
Index: config.sub
===================================================================
RCS file: /cvs/gcc/gcc/config.sub,v
retrieving revision 1.82.8.1
diff -u -3 -p -u -r1.82.8.1 config.sub
--- config.sub	25 Apr 2005 10:36:56 -0000	1.82.8.1
+++ config.sub	13 Oct 2005 04:55:30 -0000
@@ -170,6 +170,10 @@ case $os in
 	-hiux*)
 		os=-hiuxwe2
 		;;
+	-sco6)
+		os=-sco5v6
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
 	-sco5)
 		os=-sco3.2v5
 		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
@@ -186,6 +190,10 @@ case $os in
 		# Don't forget version if it is 3.2v4 or newer.
 		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
 		;;
+	-sco5v6*)
+		# Don't forget version if it is 3.2v4 or newer.
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
 	-sco*)
 		os=-sco3.2v2
 		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/configure.in,v
retrieving revision 1.341.2.6
diff -u -3 -p -r1.341.2.6 configure.in
--- configure.in	13 Sep 2005 07:01:28 -0000	1.341.2.6
+++ configure.in	13 Oct 2005 21:06:59 -0000
@@ -622,9 +622,7 @@ case "${target}" in
     noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}"
     ;;
   i[[3456789]]86-*-sco3.2v5*)
-    # The linker does not yet know about weak symbols in COFF,
-    # and is not configured to handle mixed ELF and COFF.
-    noconfigdirs="$noconfigdirs ld target-libgloss ${libgcj}"
+    noconfigdirs="$noconfigdirs target-libgloss target-libada target-libgfortran ${libgcj}"
     ;;
   i[[3456789]]86-*-sco*)
     noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
@@ -635,6 +633,9 @@ case "${target}" in
   i[[3456789]]86-*-sysv4*)
     noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
     ;;
+  i[[3456789]]86-*-sysv5* | i[[3456789]]86-*-sco5v6*)
+    noconfigdirs="$noconfigdirs target-libgloss target-libada target-libgfortran ${libgcj}"
+    ;;
   i[[3456789]]86-*-beos*)
     noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
     ;;
@@ -896,6 +897,9 @@ case "${host}" in
     ;;
   i[[3456789]]86-*-sco3.2v5*)
     ;;
+  i[[3456789]]86-*-sco5v6*)
+    host_makefile_frag="config/mh-sysv5"
+    ;;
   i[[3456789]]86-*-sco*)
     # The native C compiler botches some simple uses of const.  Unfortunately,
     # it doesn't defined anything like "__sco__" for us to test for in ansidecl.h.
Index: libtool.m4
===================================================================
RCS file: /cvs/gcc/gcc/libtool.m4,v
retrieving revision 1.19
diff -u -3 -p -u -r1.19 libtool.m4
--- libtool.m4	29 Nov 2004 23:45:17 -0000	1.19
+++ libtool.m4	13 Oct 2005 04:55:31 -0000
@@ -703,20 +703,16 @@ osf3* | osf4* | osf5*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-sco3.2v5*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
 solaris*)
   lt_cv_deplibs_check_method=pass_all
   lt_cv_file_magic_test_file=/lib/libc.so
   ;;
 
-[sysv5uw[78]* | sysv4*uw2*)]
+sco3.2v5* | sco5v6* | sysv5* | svr5* | unixware7* | OpenUNIX* | UnixWare*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+sysv4 | sysv4.2uw2* | sysv4.3*)
   case $host_vendor in
   ncr)
     lt_cv_deplibs_check_method=pass_all
Index: ltcf-c.sh
===================================================================
RCS file: /cvs/gcc/gcc/ltcf-c.sh,v
retrieving revision 1.21.24.1
diff -u -3 -p -u -r1.21.24.1 ltcf-c.sh
--- ltcf-c.sh	14 May 2005 00:42:34 -0000	1.21.24.1
+++ ltcf-c.sh	13 Oct 2005 04:55:31 -0000
@@ -557,11 +557,25 @@ else
     hardcode_libdir_separator=:
     ;;
 
-  sco3.2v5*)
-    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+  sco3.2v5* | sco5v6* | sysv5* | svr5* | unixware7* | OpenUNIX* | UnixWare*)
+    no_undefined_flag='${wl}-z,defs'
+    if test "$with_gcc" = yes; then
+      archive_cmds='$CC -shared ${wl}-h,${SCOABSPATH:+${instrpath:-}${instrpath:+/}}$soname -o $lib $libobjs $deplibs $linker_flags'
+      archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,${SCOABSPATH:+${instrpath:-}${instrpath:+/}}$soname -o $lib $libobjs $deplibs $linker_flags'
+    else
+      archive_cmds='$CC -G ${wl}-h,${SCOABSPATH:+${instrpath:-}${instrpath:+/}}$soname -o $lib $libobjs $deplibs $linker_flags'
+      archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,${SCOABSPATH:+${instrpath:-}${instrpath:+/}}$soname -o $lib $libobjs $deplibs $linker_flags'
+    fi
+    hardcode_libdir_flag_spec='${wl}-R,$libdir'
+    hardcode_libdir_separator=':'
     hardcode_shlibpath_var=no
+    hardcode_direct=no
+    hardcode_minus_L=no
     runpath_var=LD_RUN_PATH
-    hardcode_runpath_var=yes
+    hardcode_runpath_var=no
+    link_all_deplibs=yes
+    export_dynamic_flag_spec='${wl}-Bexport'
+    hardcode_into_libs=yes
     ;;
 
   solaris*)
@@ -606,18 +620,6 @@ else
     export_dynamic_flag_spec='-Bexport'
     ;;
 
-  sysv5*)
-    no_undefined_flag=' -z text'
-    # $CC -shared without GNU ld will not create a library from C++
-    # object files and a static libstdc++, better avoid it by now
-    archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-    archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-		$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
-    hardcode_libdir_flag_spec=
-    hardcode_shlibpath_var=no
-    runpath_var='LD_RUN_PATH'
-    ;;
-
   uts4*)
     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
     hardcode_libdir_flag_spec='-L$libdir'
@@ -649,17 +651,6 @@ else
     runpath_var=LD_RUN_PATH
     ;;
 
-  sysv5uw7* | unixware7*)
-    no_undefined_flag='${wl}-z ${wl}text'
-    if test "$GCC" = yes; then
-      archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-    else
-      archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-    fi
-    runpath_var='LD_RUN_PATH'
-    hardcode_shlibpath_var=no
-    ;;
-
   *)
     ld_shlibs=no
     ;;
@@ -779,7 +770,7 @@ else
       ac_cv_prog_cc_wl='-Qoption ld '
       ;;
 
-    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5* | svr5* | sco5v6* | UnixWare* | OpenUNIX*)
       ac_cv_prog_cc_pic='-KPIC'
       ac_cv_prog_cc_static='-Bstatic'
       ac_cv_prog_cc_wl='-Wl,'
Index: ltcf-cxx.sh
===================================================================
RCS file: /cvs/gcc/gcc/ltcf-cxx.sh,v
retrieving revision 1.30.24.1
diff -u -3 -p -u -r1.30.24.1 ltcf-cxx.sh
--- ltcf-cxx.sh	14 May 2005 00:42:34 -0000	1.30.24.1
+++ ltcf-cxx.sh	13 Oct 2005 04:55:31 -0000
@@ -578,17 +578,23 @@ case $host_os in
     # FIXME: insert proper C++ library support
     ld_shlibs=no
     ;;
-  sco*)
-    case $cc_basename in
-      CC)
-        # FIXME: insert proper C++ library support
-        ld_shlibs=no
-        ;;
-      *)
-        # FIXME: insert proper C++ library support
-        ld_shlibs=no
-        ;;
-    esac
+  sco3.2v5* | sco5v6* | svr5* | sysv5* | unixware7* | UnixWare* | OpenUNIX*)
+    no_undefined_flag='${wl}-z,defs'
+    if test "$with_gcc" = yes; then
+      archive_cmds='$CXX -shared ${wl}-h,${SCOABSPATH:+${instrpath:-}${instrpath:+/}}$soname -o $lib $libobjs $deplibs $linker_flags'
+      archive_expsym_cmds='$CXX -shared ${wl}-Bexport:$export_symbols ${wl}-h,${SCOABSPATH:+${instrpath:-}${instrpath:+/}}$soname -o $lib $libobjs $deplibs $linker_flags'
+    else
+      archive_cmds='$CXX -G ${wl}-h,${SCOABSPATH:+${instrpath:-}${instrpath:+/}}$soname -o $lib $libobjs $deplibs $linker_flags'
+      archive_expsym_cmds='$CXX -G ${wl}-Bexport:$export_symbols ${wl}-h,${SCOABSPATH:+${instrpath:-}${instrpath:+/}}$soname -o $lib $libobjs $deplibs $linker_flags'
+    fi
+    hardcode_libdir_flag_spec='${wl}-R,$libdir'
+    hardcode_libdir_separator=':'
+    hardcode_shlibpath_var=no
+    hardcode_direct=yes
+    runpath_var=LD_RUN_PATH
+    hardcode_runpath_var=no
+    link_all_deplibs=yes
+    export_dynamic_flag_spec='${wl}-Bexport'
     ;;
   sunos4*)
     case $cc_basename in
@@ -701,10 +707,6 @@ case $host_os in
   tpf*)
     ld_shlibs=yes
     ;;
-  unixware*)
-    # FIXME: insert proper C++ library support
-    ld_shlibs=no
-    ;;
   vxworks*)
     # FIXME: insert proper C++ library support
     ld_shlibs=no
Index: ltcf-gcj.sh
===================================================================
RCS file: /cvs/gcc/gcc/ltcf-gcj.sh,v
retrieving revision 1.14.42.1
diff -u -3 -p -u -r1.14.42.1 ltcf-gcj.sh
--- ltcf-gcj.sh	14 May 2005 00:42:34 -0000	1.14.42.1
+++ ltcf-gcj.sh	13 Oct 2005 04:55:31 -0000
@@ -527,11 +527,23 @@ else
     hardcode_libdir_separator=:
     ;;
 
-  sco3.2v5*)
-    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+  sco3.2v5* | sco5v6* | svr5* | sysv5* | unixware7* | UnixWare* | OpenUNIX*)
+    no_undefined_flag='${wl}-z,defs'
+    if test "$with_gcc" = yes; then
+      archive_cmds='$CC -shared ${wl}-h,${SCOABSPATH:+${instrpath:-}${instrpath:+/}}$soname -o $lib $libobjs $deplibs $linker_flags'
+      archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,${SCOABSPATH:+${instrpath:-}${instrpath:+/}}$soname -o $lib $libobjs $deplibs $linker_flags'
+    else
+      archive_cmds='$CC -G ${wl}-h,${SCOABSPATH:+${instrpath:-}${instrpath:+/}}$soname -o $lib $libobjs $deplibs $linker_flags'
+      archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,${SCOABSPATH:+${instrpath:-}${instrpath:+/}}$soname -o $lib $libobjs $deplibs $linker_flags'
+    fi
+    hardcode_libdir_flag_spec='${wl}-R,$libdir'
+    hardcode_libdir_separator=':'
     hardcode_shlibpath_var=no
+    hardcode_direct=yes
     runpath_var=LD_RUN_PATH
-    hardcode_runpath_var=yes
+    hardcode_runpath_var=no
+    link_all_deplibs=yes
+    export_dynamic_flag_spec='${wl}-Bexport'
     ;;
 
   solaris*)
@@ -576,18 +588,6 @@ else
     export_dynamic_flag_spec='-Bexport'
     ;;
 
-  sysv5*)
-    no_undefined_flag=' -z text'
-    # $CC -shared without GNU ld will not create a library from C++
-    # object files and a static libstdc++, better avoid it by now
-    archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-    archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-		$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
-    hardcode_libdir_flag_spec=
-    hardcode_shlibpath_var=no
-    runpath_var='LD_RUN_PATH'
-    ;;
-
   uts4*)
     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
     hardcode_libdir_flag_spec='-L$libdir'
@@ -619,17 +619,6 @@ else
     runpath_var=LD_RUN_PATH
     ;;
 
-  sysv5uw7* | unixware7*)
-    no_undefined_flag='${wl}-z ${wl}text'
-    if test "$GCC" = yes; then
-      archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-    else
-      archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-    fi
-    runpath_var='LD_RUN_PATH'
-    hardcode_shlibpath_var=no
-    ;;
-
   *)
     ld_shlibs=no
     ;;
Index: ltmain.sh
===================================================================
RCS file: /cvs/gcc/gcc/ltmain.sh,v
retrieving revision 1.24.30.2
diff -u -3 -p -u -r1.24.30.2 ltmain.sh
--- ltmain.sh	14 May 2005 00:42:34 -0000	1.24.30.2
+++ ltmain.sh	13 Oct 2005 04:55:32 -0000
@@ -1090,7 +1090,8 @@ EOF
 	  if test "$prev" = rpath; then
 	    case "$rpath " in
 	    *" $arg "*) ;;
-	    *) rpath="$rpath $arg" ;;
+	    *) instrpath=$arg
+	       rpath="$rpath $arg" ;;
 	    esac
 	  else
 	    case "$xrpath " in
@@ -2153,6 +2154,9 @@ EOF
 	    immediate | unsupported)
 	      if test "$hardcode_direct" = no; then
 		add="$dir/$linklib"
+		case $host in
+		  *-*-sco3.2v5* | *-*-sysv5* | *-*-sco5v6*) add_dir="-L$dir" ;;
+		esac
 	      elif test "$hardcode_minus_L" = no; then
 		case $host in
 		*-*-sunos*) add_shlibpath="$dir" ;;
@@ -2550,12 +2554,18 @@ EOF
 	set dummy $vinfo 0 0 0
 	IFS="$save_ifs"
 
-	if test -n "$8"; then
+	if test -n "$9"; then
 	  $echo "$modename: too many parameters to \`-version-info'" 1>&2
 	  $echo "$help" 1>&2
 	  exit 1
 	fi
 
+	if test -n "$8"; then
+	  override_soname=$5
+	  soname_spec="$override_soname"
+	  library_names_spec="$override_soname $library_names_spec"
+	fi
+
 	current="$2"
 	revision="$3"
 	age="$4"
@@ -2803,6 +2813,12 @@ EOF
 	  *-*-netbsd*)
 	    # Don't link with libc until the a.out ld.so is fixed.
 	    ;;
+	  *-*-sco3.2v5*)
+	    # Causes problems with __ctype
+	    ;;
+	  *-*-sco5v6* | *-*-sysv4.2uw2* | *-*-sysv5* | *-*-svr5* | *-*-UnixWare* | *-*-OpenUNIX*)
+	    # cc / CC insert libc in correct order for threads to work
+	    ;;
 	  *)
 	    # Add libc to deplibs on all other systems if necessary.
 	    if test $build_libtool_need_lc = "yes"; then
Index: config/mmap.m4
===================================================================
RCS file: config/mmap.m4
diff -N config/mmap.m4
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ config/mmap.m4	13 Oct 2005 04:55:33 -0000
@@ -0,0 +1,224 @@
+dnl Copyright (C) 2000-2005 Free Software Foundation, Inc.
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2, or (at your option)
+dnl any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+dnl 02111-1307, USA.
+dnl
+dnl As a special exception, the Free Software Foundation gives unlimited
+dnl permission to copy, distribute and modify the configure scripts that
+dnl are the output of Autoconf.  You need not follow the terms of the GNU
+dnl General Public License when using or distributing such scripts, even
+dnl though portions of the text of Autoconf appear in them.  The GNU
+dnl General Public License (GPL) does govern all other use of the material
+dnl that constitutes the Autoconf program.
+dnl
+dnl Certain portions of the Autoconf source text are designed to be copied
+dnl (in certain cases, depending on the input) into the output of
+dnl Autoconf.  We call these the "data" portions.  The rest of the Autoconf
+dnl source text consists of comments plus executable code that decides which
+dnl of the data portions to output in any given case.  We call these
+dnl comments and executable code the "non-data" portions.  Autoconf never
+dnl copies any of the non-data portions into its output.
+dnl
+dnl This special exception to the GPL applies to versions of Autoconf
+dnl released by the Free Software Foundation.  When you make and
+dnl distribute a modified version of Autoconf, you may extend this special
+dnl exception to the GPL to apply to your modified version as well, *unless*
+dnl your modified version has the potential to copy into its output some
+dnl of the text that was the non-data portion of the version that you started
+dnl with.  (In other words, unless your change moves or copies text from
+dnl the non-data portions to the data portions.)  If your modification has
+dnl such potential, you must delete any notice of this special exception
+dnl to the GPL from your modified version.
+dnl
+
+dnl Modified test for mmap. This is based on the original autoconf mmap
+dnl test, but modified to be less restrictive. The original test would
+dnl only end up defining HAVE_MMAP if all of the permutations worked.
+dnl However, very few applications ever use MAP_FIXED, which is a commonly
+dnl mis-implemented feature. However, the rest of the mmap options often
+dnl work. This new test will define HAVE_MMAP if mmap in general works,
+dnl and define HAVE_MMAP_FIXED if using MAP_FIXED works too.
+dnl
+AC_DEFUN([GCC_FUNC_MMAP],
+[AC_CHECK_HEADERS(stdlib.h unistd.h)
+AC_CHECK_FUNCS(getpagesize)
+AC_MSG_CHECKING(for working mmap)
+AC_CACHE_VAL(ac_cv_func_mmap_multi,
+[AC_RUN_IFELSE([AC_LANG_SOURCE([AC_INCLUDES_DEFAULT]
+[[/* Thanks to Mike Haertel and Jim Avera for this test.
+   Here is a matrix of mmap possibilities:
+	mmap private not fixed
+	mmap private fixed at somewhere currently unmapped
+	mmap private fixed at somewhere already mapped
+	mmap shared not fixed
+	mmap shared fixed at somewhere currently unmapped
+	mmap shared fixed at somewhere already mapped
+   For private mappings, we should verify that changes cannot be read()
+   back from the file, nor mmap's back from the file at a different
+   address.  (There have been systems where private was not correctly
+   implemented like the infamous i386 svr4.0, and systems where the
+   VM page cache was not coherent with the file system buffer cache
+   like early versions of FreeBSD and possibly contemporary NetBSD.)
+   For shared mappings, we should conversely verify that changes get
+   propogated back to all the places they're supposed to be.
+
+   Grep wants private fixed already mapped.
+   The main things grep needs to know about mmap are:
+   * does it exist and is it safe to write into the mmap'd area
+   * how to use it (BSD variants)  */
+
+#include <fcntl.h>
+#include <sys/mman.h>
+#include <errno.h>
+
+#if !STDC_HEADERS && !HAVE_STDLIB_H
+char *malloc ();
+#endif
+
+/* This mess was copied from the GNU getpagesize.h.  */
+#if !HAVE_GETPAGESIZE
+/* Assume that all systems that can run configure have sys/param.h.  */
+# if !HAVE_SYS_PARAM_H
+#  define HAVE_SYS_PARAM_H 1
+# endif
+
+# ifdef _SC_PAGESIZE
+#  define getpagesize() sysconf(_SC_PAGESIZE)
+# else /* no _SC_PAGESIZE */
+#  if HAVE_SYS_PARAM_H
+#   include <sys/param.h>
+#   ifdef EXEC_PAGESIZE
+#    define getpagesize() EXEC_PAGESIZE
+#   else /* no EXEC_PAGESIZE */
+#    ifdef NBPG
+#     define getpagesize() NBPG * CLSIZE
+#     ifndef CLSIZE
+#      define CLSIZE 1
+#     endif /* no CLSIZE */
+#    else /* no NBPG */
+#     ifdef NBPC
+#      define getpagesize() NBPC
+#     else /* no NBPC */
+#      ifdef PAGESIZE
+#       define getpagesize() PAGESIZE
+#      endif /* PAGESIZE */
+#     endif /* no NBPC */
+#    endif /* no NBPG */
+#   endif /* no EXEC_PAGESIZE */
+#  else /* no HAVE_SYS_PARAM_H */
+#   define getpagesize() 8192	/* punt totally */
+#  endif /* no HAVE_SYS_PARAM_H */
+# endif /* no _SC_PAGESIZE */
+
+#endif /* no HAVE_GETPAGESIZE */
+
+int
+main ()
+{
+  char *data, *data2, *data3, *data4;
+  char tout[8];
+  int i, pagesize;
+  int fd, ret = 0;
+
+  pagesize = getpagesize ();
+
+  /* First, make a file with some known garbage in it. */
+  data = (char *) malloc (pagesize);
+  if (!data)
+    exit (1);
+  for (i = 0; i < pagesize; ++i)
+    *(data + i) = rand ();
+  umask (0);
+  fd = creat ("conftest.mmap", 0600);
+  if (fd < 0)
+    exit (1);
+  if (write (fd, data, pagesize) != pagesize)
+    exit (1);
+  close (fd);
+
+  /* Next, try to mmap the file at a fixed address which already has
+     something else allocated at it.  If we can, also make sure that
+     we see the same garbage.  */
+  fd = open ("conftest.mmap", O_RDWR);
+  if (fd < 0)
+    exit (1);
+  data2 = (char *) malloc (2 * pagesize);
+  if (!data2)
+    exit (1);
+  data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
+  data4 = mmap (data2, pagesize, PROT_READ | PROT_WRITE,
+                     MAP_PRIVATE | MAP_FIXED, fd, 0L);
+  if (errno != 0 && errno == ENOMEM) {
+      errno = 0;
+      data4 = mmap (data, pagesize, PROT_READ | PROT_WRITE,
+	  MAP_PRIVATE, fd, 0L);
+      if (errno != 0)
+	  exit (1);
+      ret = 2;
+  } else if (data4 != data2)
+    exit (1);
+  for (i = 0; i < pagesize; ++i)
+    if (*(data + i) != *(data4 + i))
+      exit (1);
+
+  /* Finally, make sure that changes to the mapped area do not
+     percolate back to the file as seen by read().  (This is a bug on
+     some variants of i386 svr4.0.)  */
+  for (i = 0; i < pagesize; ++i)
+    *(data4 + i) = *(data4 + i) + 1;
+  data3 = (char *) malloc (pagesize);
+  if (!data3)
+    exit (1);
+  if (read (fd, data3, pagesize) != pagesize)
+    exit (1);
+  for (i = 0; i < pagesize; ++i)
+    if (*(data + i) != *(data3 + i))
+      exit (1);
+  close (fd);
+  fd=creat("conftestmp", 0600);
+  if (fd < 0)
+      exit (1);
+  tout[0] = '0' + ret;
+  tout[1] = '\n';
+  write (fd, tout, 2);
+  close (fd);
+  exit (0);
+}]])],
+               [ac_cv_func_mmap_multi=`cat conftestmp`],
+               [ac_cv_func_mmap_multi=1],
+               [ac_cv_func_mmap_multi=1])])
+if test $ac_cv_func_mmap_multi = 0; then
+  ac_cv_func_mmap_fixed_mapped=yes
+  ac_cv_func_mmap=yes
+  AC_MSG_RESULT([yes, with MAP_FIXED])
+elif test $ac_cv_func_mmap_multi = 1; then
+  ac_cv_func_mmap_fixed_mapped=no
+  ac_cv_func_mmap=no
+  AC_MSG_RESULT(no)
+else
+  ac_cv_func_mmap_fixed_mapped=no
+  ac_cv_func_mmap=yes
+  AC_MSG_RESULT([yes, without MAP_FIXED])
+fi
+if test $ac_cv_func_mmap_fixed_mapped = yes; then
+  AC_DEFINE(HAVE_MMAP_FIXED, 1,
+            [Define if `mmap' supports fixed, mapped files])
+fi
+if test $ac_cv_func_mmap = yes; then
+  AC_DEFINE(HAVE_MMAP, 1,
+            [Define if your system supports the `mmap' system call])
+fi
+rm -f conftest.mmap conftestmp
+])# GCC_FUNC_MMAP


Boehm-GC changes:

2005-10-07  Kean Johnston  <jkj@sco.com>

	* configure.host: Use mmap on SVR5-based kernels.
	* dyn_load.c: Add support for OpenServer 6 and UnixWare.
	* mach_dep.c: Ditto.
	* os_dep.c: Ditto.
	* include/private/gcconfig.h: Ditto.
	Refine the test for OpenServer 5.
	Use common code for OSR5, OSR6 and UnixWare for DATASTART, DATAEND
	and STACKBOTTOM.
	* solaris_pthreads.c: Ditto. UnixWare and OpenServer 6 have an
	almost identical threads implementation to Solaris.

Index: boehm-gc/configure.host
===================================================================
RCS file: /cvs/gcc/gcc/boehm-gc/configure.host,v
retrieving revision 1.8
diff -u -3 -p -u -r1.8 configure.host
--- boehm-gc/configure.host	16 Feb 2005 04:10:41 -0000	1.8
+++ boehm-gc/configure.host	13 Oct 2005 04:55:32 -0000
@@ -44,6 +44,9 @@ case "${host}" in
   *-linux*)
     gc_use_mmap=yes
     ;;
+  *-sysv5* | *-sco5v6*)
+    gc_use_mmap=yes
+    ;;
 esac
 
 case "${target_optspace}:${host}" in
Index: boehm-gc/dyn_load.c
===================================================================
RCS file: /cvs/gcc/gcc/boehm-gc/dyn_load.c,v
retrieving revision 1.23.6.1
diff -u -3 -p -u -r1.23.6.1 dyn_load.c
--- boehm-gc/dyn_load.c	26 Feb 2005 15:42:11 -0000	1.23.6.1
+++ boehm-gc/dyn_load.c	13 Oct 2005 04:55:32 -0000
@@ -58,7 +58,7 @@
     !defined(RS6000) && !defined(SCO_ELF) && !defined(DGUX) && \
     !(defined(FREEBSD) && defined(__ELF__)) && \
     !(defined(NETBSD) && defined(__ELF__)) && !defined(HURD) && \
-    !defined(DARWIN)
+    !defined(DARWIN) && !defined(SCO6) && !defined(UNIXWARE)
  --> We only know how to find data segments of dynamic libraries for the
  --> above.  Additional SVR4 variants might not be too
  --> hard to add.
@@ -87,7 +87,8 @@
 
 #if defined(LINUX) && defined(__ELF__) || defined(SCO_ELF) || \
     (defined(FREEBSD) && defined(__ELF__)) || defined(DGUX) || \
-    (defined(NETBSD) && defined(__ELF__)) || defined(HURD)
+    (defined(NETBSD) && defined(__ELF__)) || defined(HURD) || \
+    defined(SCO6) || defined(UNIXWARE)
 #   include <stddef.h>
 #   include <elf.h>
 #   include <link.h>
@@ -279,7 +280,8 @@ void GC_register_dynamic_libraries()
 
 #if defined(LINUX) && defined(__ELF__) || defined(SCO_ELF) || \
     (defined(FREEBSD) && defined(__ELF__)) || defined(DGUX) || \
-    (defined(NETBSD) && defined(__ELF__)) || defined(HURD)
+    (defined(NETBSD) && defined(__ELF__)) || defined(HURD) || \
+    defined(SCO6) || defined(UNIXWARE)
 
 
 #ifdef USE_PROC_FOR_LIBRARIES
Index: boehm-gc/mach_dep.c
===================================================================
RCS file: /cvs/gcc/gcc/boehm-gc/mach_dep.c,v
retrieving revision 1.17
diff -u -3 -p -u -r1.17 mach_dep.c
--- boehm-gc/mach_dep.c	9 Feb 2005 21:33:02 -0000	1.17
+++ boehm-gc/mach_dep.c	13 Oct 2005 04:55:33 -0000
@@ -214,6 +214,7 @@ void GC_push_regs()
 #       if defined(I386) &&!defined(OS2) &&!defined(SVR4) \
 	&& (defined(__MINGW32__) || !defined(MSWIN32)) \
 	&& !defined(SCO) && !defined(SCO_ELF) \
+	&& !defined(SCO6) && !defined(UNIXWARE) \
  	&& !(defined(LINUX) && defined(__ELF__)) \
 	&& !(defined(FREEBSD) && defined(__ELF__)) \
 	&& !(defined(NETBSD) && defined(__ELF__)) \
@@ -295,7 +296,8 @@ void GC_push_regs()
 #	  define HAVE_PUSH_REGS
 #       endif
 
-#       if defined(I386) && (defined(SVR4) || defined(SCO) || defined(SCO_ELF))
+#       if defined(I386) && (defined(SVR4) || defined(SCO) || \
+	  defined(SCO_ELF) || defined(SCO6) || defined(UNIXWARE))
 	/* I386 code, SVR4 variant, generic code does not appear to work */
 	  asm("pushl %eax");  asm("call GC_push_one"); asm("addl $4,%esp");
 	  asm("pushl %ebx");  asm("call GC_push_one"); asm("addl $4,%esp");
Index: boehm-gc/os_dep.c
===================================================================
RCS file: /cvs/gcc/gcc/boehm-gc/os_dep.c,v
retrieving revision 1.30.34.1
diff -u -3 -p -u -r1.30.34.1 os_dep.c
--- boehm-gc/os_dep.c	22 Apr 2005 18:11:30 -0000	1.30.34.1
+++ boehm-gc/os_dep.c	13 Oct 2005 04:55:33 -0000
@@ -76,6 +76,7 @@
 # endif
 
 # if (defined(SVR4) || defined(AUX) || defined(DGUX) \
+      || defined(SCO_ELF) || defined(SCO6) || defined(UNIXWARE) \
       || (defined(LINUX) && defined(SPARC))) && !defined(PCR)
 #   define NEED_FIND_LIMIT
 # endif
@@ -1354,6 +1355,7 @@ void GC_register_data_segments()
 # else /* !OS2 && !Windows */
 
 # if (defined(SVR4) || defined(AUX) || defined(DGUX) \
+      || defined(SCO_ELF) || defined(SCO6) || defined(UNIXWARE) \
       || (defined(LINUX) && defined(SPARC))) && !defined(PCR)
 ptr_t GC_SysVGetDataStart(max_page_size, etext_addr)
 int max_page_size;
Index: boehm-gc/solaris_pthreads.c
===================================================================
RCS file: /cvs/gcc/gcc/boehm-gc/solaris_pthreads.c,v
retrieving revision 1.11
diff -u -3 -p -u -r1.11 solaris_pthreads.c
--- boehm-gc/solaris_pthreads.c	16 Aug 2004 16:32:26 -0000	1.11
+++ boehm-gc/solaris_pthreads.c	13 Oct 2005 04:55:33 -0000
@@ -20,6 +20,9 @@
 
 # if defined(GC_SOLARIS_PTHREADS)
 # include <pthread.h>
+# if defined(__UNIXWARE__) || defined(__OPENSERVER__)
+#  include <synch.h>
+# endif
 # include <thread.h>
 # include <signal.h>
 # include <fcntl.h>
Index: boehm-gc/include/private/gcconfig.h
===================================================================
RCS file: /cvs/gcc/gcc/boehm-gc/include/private/gcconfig.h,v
retrieving revision 1.39.18.5
diff -u -3 -p -u -r1.39.18.5 gcconfig.h
--- boehm-gc/include/private/gcconfig.h	6 Sep 2005 14:21:25 -0000	1.39.18.5
+++ boehm-gc/include/private/gcconfig.h	13 Oct 2005 04:55:33 -0000
@@ -180,7 +180,8 @@
 #   define SPARC
 #   define mach_type_known
 # endif
-# if defined(_M_XENIX) && defined(_M_SYSV) && defined(_M_I386)
+# if (defined(_M_XENIX) && defined(_M_SYSV) && defined(_M_I386) \
+	&& ((_SCO_DS - 0) <= 1))
 	/* The above test may need refinement	*/
 #   define I386
 #   if defined(_SCO_ELF)
@@ -190,6 +191,15 @@
 #   endif
 #   define mach_type_known
 # endif
+# if defined(__USLC__) || defined(__UNIXWARE__) || ((_SCO_DS - 0) >= 2)
+#   define I386
+#   if defined(__OPENSERVER__)
+#     define SCO6
+#   else
+#     define UNIXWARE
+#   endif
+#   define mach_type_known
+# endif
 # if defined(_AUX_SOURCE)
 #   define M68K
 #   define SYSV
@@ -1016,14 +1026,22 @@
 				 +((word)etext & 0xfff))
 #	define STACKBOTTOM ((ptr_t) 0x7ffffffc)
 #   endif
-#   ifdef SCO_ELF
-#       define OS_TYPE "SCO_ELF"
-        extern int etext[];
-#       define DATASTART ((ptr_t)(etext))
-#       define STACKBOTTOM ((ptr_t) 0x08048000)
+#   if defined(SCO_ELF) || defined(SCO6) || defined(UNIXWARE)
+#       if defined(UNIXWARE)
+#         define OS_TYPE "UNIXWARE"
+#       elif defined(SCO6)
+#         define OS_TYPE "SCO6"
+#       else
+#         define OS_TYPE "SCO_ELF"
+#       endif
+	extern int _etext[], _end[];
+	extern char ** _environ;
+#	define DATAEND ((ptr_t)_end)
+#       define DATASTART ((ptr_t)(_etext))
+#       define STACKBOTTOM ((ptr_t) _environ)
 #       define DYNAMIC_LOADING
 #	define ELF_CLASS ELFCLASS32
-#   endif
+#   endif /* SCO_ELF || SCO6 || UNIXWARE */
 #   ifdef DGUX
 #	define OS_TYPE "DGUX"
 	extern int _etext, _end;
@@ -1954,7 +1972,8 @@
 # if defined(SVR4) || defined(LINUX) || defined(IRIX5) || defined(HPUX) \
 	    || defined(OPENBSD) || defined(NETBSD) || defined(FREEBSD) \
 	    || defined(DGUX) || defined(BSD) || defined(SUNOS4) \
-	    || defined(_AIX) || defined(DARWIN) || defined(OSF1)
+	    || defined(_AIX) || defined(DARWIN) || defined(OSF1) \
+	    || defined(SCO_ELF) || defined(SCO6) || defined(UNIXWARE)
 #   define UNIX_LIKE   /* Basic Unix-like system calls work.	*/
 # endif
 
@@ -2041,7 +2060,9 @@
 # if defined(GC_LINUX_THREADS) && !defined(LINUX)
 	--> inconsistent configuration
 # endif
-# if defined(GC_SOLARIS_THREADS) && !defined(SUNOS5)
+# if defined(GC_SOLARIS_THREADS) && !defined(SUNOS5) && \
+	!defined(__UNIXWARE__) && (!defined(__OPENSERVER__) || \
+	  (_SCO_DS - 0 < 2))
 	--> inconsistent configuration
 # endif
 # if defined(GC_HPUX_THREADS) && !defined(HPUX)


fixincludes changes:

2005-10-07  Kean Johnston  <jkj@sco.com>

	* inclhack.def (sco_abs_etc, sco_cfront, sco_eftsafe,
	sco_eftsafe2, sco_math2, sco_pthread, sco_string, sco_stdc,
	sco_synch, sco_unistd_exit, sco_volatile, sco_wchar,
	sco_wrap_stadarg_h, sco_wrap_stdlib_h, sco_eftsafe3): New fixes.
	(sco_math): Add missing ansi/math.h to file list, and mach entries
	for OpenServer 5, 6 and UnixWare 7. Convert all isinf(), isnan()
	etc macros to use __builtin_isinf() etc.
	(sco_regset): Simplify test case.
	(sco_static_func): Remove.
	(solaris_mutex_init_1): Exclude *-*-sysv5*.
	(stdio_va_list): Recognize _VA_LIST as well.
	(stdio_va_list_clients): Ditto. Also recognize __VA_LIST__.
	(strict_ansi_not): Exclude on SCO platforms as they need to handle
	__STDC__ slightly differently.
	(strict_ansi_not_ctd): Ditto.
	(svr4_ftw): Bypass on SVR5.
	* tests/base/ctype.h: Update to accomodate new tests above.
	* tests/base/math.h: Ditto.
	* tests/base/pthread.h: Ditto.
	* tests/base/stdlib.h: Ditto.
	* tests/base/testing.h: Ditto.
	* tests/base/unistd.h: Ditto.
	* tests/base/wchar.h: Ditto.
	* tests/base/sys/regset.h: Ditto.
	* tests/base/sys/stat.h: Ditto.
	* tests/base/sys/types.h: Ditto.
	* tests/base/dirent.h: Ditto. New file.
	* tests/base/pfmt.h: Ditto. New file.
	* tests/base/synch.h: Ditto. New file.
	* tests/base/ansi/string.h: Ditto. New file.
	* tests/base/ansi/wchar.h: Ditto. New file.
	* tests/base/sys/mkdev.h: Ditto. New file.

Index: fixincludes/inclhack.def
===================================================================
RCS file: /cvs/gcc/gcc/fixincludes/inclhack.def,v
retrieving revision 1.16.14.6
diff -u -3 -p -u -r1.16.14.6 inclhack.def
--- fixincludes/inclhack.def	15 Sep 2005 19:11:45 -0000	1.16.14.6
+++ fixincludes/inclhack.def	13 Oct 2005 04:55:34 -0000
@@ -2488,6 +2488,262 @@ fix = {
     test_text = 'extern int rename(const char *old, const char *new);';
 };
 
+/*
+ * On UnixWare and OpenServer 6, stdlib.h has C++ declarations of
+ * abs and div that conflict with libstdc++.
+ * Note that this fix must come before the cfront fix below.
+ */
+fix = {
+    hackname  = sco_abs_etc;
+    files     = stdlib.h;
+    mach      = "i?86-*-sysv5*";
+    mach      = "i?86-*-sco5v6*";
+    bypass    = "__GNUC__";
+    bypass    = "__GNUG__";
+
+    sed       = "/inline long .*abs/d";
+    sed       = "/inline .*ldiv_t div/d";
+    sed	      =
+      "/^#if[ 	]*!defined(__cplusplus)[	 ]*||[ 	]*defined(_CFRONT_3_0)/{\n"
+      "  h\n"
+      "  N\n"
+      "  /extern[ 	]*void[	 ]*abort/{\n"
+      "    :loop1\n"
+      "    h\n"
+      "    N\n"
+      "    /#endif/!b loop1\n"
+      "    g\n"
+      "    D\n"
+      "  }\n"
+      "  /extern[ 	]*void[	 ]*\\*bsearch/{\n"
+      "    :loop2\n"
+      "    h\n"
+      "    N\n"
+      "    /#endif/!b loop2\n"
+      "    g\n"
+      "    D\n"
+      "  }\n"
+      "  h\n"
+      "  g\n"
+      "}";
+
+    test_text =
+  "extern \"C\+\+\" {\n"
+  "inline long abs(long __1) blah blah;\n"
+  "inline lldiv_t div(long long __1) blah;\n";
+};
+
+/*
+ * On OpenServer 6 and UnixWare, many header files have conditional
+ * guards on _CFRONT_3_0, which if not defined, attempts to include
+ * the namespace std header file. This causes considerable problems.
+ * So, we change the conditional to also exclude g++.
+ */
+fix = {
+    hackname  = sco_cfront;
+    files     = "ctype.h";
+    files     = "inttypes.h";
+    files     = "locale.h";
+    files     = "math.h";
+    files     = "search.h";
+    files     = "setjmp.h";
+    files     = "signal.h";
+    files     = "stdio.h";
+    files     = "stdlib.h";
+    files     = "string.h";
+    files     = "time.h";
+    files     = "unistd.h";
+    files     = "wchar.h";
+    files     = "wctype.h";
+    mach      = *-sco3.2v5*;
+    mach      = *-sco5v6*;
+    mach      = *-unixware7*;
+    mach      = *-UnixWare7*;
+    mach      = *-sysv5*;
+    mach      = *-svr5*;
+    select    = '#ifndef _CFRONT_3_0';
+    sed       = "s/#ifndef _CFRONT_3_0/"
+	       "#if !defined(_CFRONT_3_0) \\&\\& !defined(__GNUC__)/";
+
+    test_text =
+    "#ifndef _CFRONT_3_0\n"
+    "#include <ctype> /* for namespace std */\n"
+    "#endif\n";
+};
+
+/*
+ * On OpenServer 6 and UnixWare, many of the header files have support
+ * for "Expanded Fundamental Types" (EFTs). The theory is, if you know
+ * your code is clean and does not use any of the mapped function names
+ * in any way but as function calls, you can define _EFTSAFE, and then
+ * various macros will call the real, versioned library function with
+ * some special first ar, which is the version of the call. If you do
+ * not define _EFTSAFE, then the headers use static functions to do the
+ * same thing. Both mechanisms are messy. Consider the declaration for
+ * "shutdown" in sys/socket.h.  If you define _EFTSAFE, then you end up
+ * with a macro, and thus you can use the name "shutdown" as a C++
+ * member function, for example, becuause the macro gets expanded when
+ * the header is processed. If you do not define _EFTSAFE, you end up
+ * with static functions defined in the header file.
+ * This fix will try to adjust this as much as possible. There are some
+ * cases that slip through, most notable in ftw.h, so perhaps one day
+ * I will write a special purpose fix for that header. But this fix
+ * will arrange things such that it makes no difference if you define
+ * _EFTSAFE or not, and you always get an inlined function that calls
+ * the versioned function, plus you get corect function declarations for
+ * each of the offending functions.
+ * Order is very important in this fix. There are some bits of the sed
+ * scripts that need to run before others. This is mostly to support a
+ * few special cases in sys/socket.h. Be very careful when changing this
+ * fix please. Better yet, mail me (jkj@sco.com) before you do.
+ */
+fix = {
+    hackname = sco_eftsafe;
+    files    = dirent.h;
+    files    = netdb.h;
+    files    = netdir.h;
+    files    = resolv.h;
+    files    = signal.h;
+    files    = wchar.h;
+    files    = ftw.h;
+    files    = stdlib.h;
+    files    = sys/socket.h;
+    files    = sys/stat.h;
+    files    = sys/utsname.h;
+    files    = sys/bitmap.h;
+    files    = sys/tty.h;
+    files    = sys/ttydev.h;
+    files    = sys/v86.h;
+    files    = sys/xti.h;
+    mach     = *-sco3.2v5*;
+    mach     = *-sco5v6*;
+    mach     = *-unixware7*;
+    mach     = *-UnixWare7*;
+    mach     = *-sysv5*;
+    mach     = *-svr5*;
+    bypass   = "static __inline__";
+
+    sed      =
+      "/__NETLIB_LIBSOCKET_ALL/ s@:.*);@);@\n"
+      "/__NETLIB_LIBSOCKET_ALL/ s@__NETLIB_LIBSOCKET_ALL_VERSIONED__() ? @@\n"
+      "/#define getsockopt _getsockopt/d\n"
+      "s/^static int _getsockopt/extern __inline__ __attribute ((__always_inline__)) int getsockopt/\n"
+      "/#define listen _listen/d\n"
+      "s/^static int _listen/extern __inline__ __attribute ((__always_inline__)) int listen/\n"
+      "/#define recv _recv/d\n"
+      "s/^static ssize_t _recv/extern __inline__ __attribute ((__always_inline__)) ssize_t recv/\n"
+      "/#define send _send/d\n"
+      "s/^static ssize_t _send/extern __inline__ __attribute ((__always_inline__)) ssize_t send/\n"
+      "/#define setsockopt _setsockopt/d\n"
+      "s/^static int _setsockopt/extern __inline__ __attribute ((__always_inline__)) int setsockopt/\n"
+      "/#define shutdown _shutdown/d\n"
+      "s/^static int _shutdown/extern __inline__ __attribute ((__always_inline__)) int shutdown/\n"
+      "/#define socket _socket/d\n"
+      "s/^static int _socket/extern __inline__ __attribute ((__always_inline__)) int socket/\n"
+      "/#define socketpair _socketpair/d\n"
+      "s/^static int _socketpair/extern __inline__ __attribute ((__always_inline__)) int socketpair/\n"
+      "s/_EFTSAFE/__FIXINC_NOTEFTSAFE/g\n";
+
+    sed      = "/^static /N; s/^static \\(.*\\)\\((.*)\\)/"
+               "extern __inline__ __attribute ((__always_inline__)) \\1 \\2/";
+
+    test_text =
+      "#ifdef _EFTSAFE\n"
+      "#define getsockopt(blah, bleh) _xgetsockopt(__NETLIB_VERSION__,1,2)\n"
+      "#else /* !_EFTSAFE */\n"
+      "#pragma weak _xgetsockopt\n"
+      "#pragma weak getsockopt\n"
+      "extern int getsockopt(int, int, int, void *, socklen_t *);\n"
+      "static int _getsockopt(int __a1, int __a2, int __a3, void *__a4, socklen_t *__a5)\n"
+      "{\n"
+      "  return (__NETLIB_LIBSOCKET_ALL_VERSIONED__() ? _xgetsockopt(__NETLIB_VERSION__, __a1, __a2, __a3, __a4, __a5) : getsockopt(__a1, __a2, __a3, __a4, __a5));\n"
+      "}\n"
+      "#define getsockopt _getsockopt\n";
+};
+
+/* Special case for sys/mkdev.h */
+fix = {
+    hackname = sco_eftsafe2;
+    files    = sys/mkdev.h;
+    mach     = *-sco5v6*;
+    mach     = *-unixware7*;
+    mach     = *-UnixWare7*;
+    mach     = *-sysv5*;
+    mach     = *-svr5*;
+    bypass   = "static __inline__";
+
+    sed      =
+      "/ifdef _EFTSAFE/,/ONBITSMAJOR/ c\\\n"
+      "extern __inline__ __attribute ((__always_inline__))\\\n"
+      "dev_t makedev(major_t maj, minor_t mn)\\\n"
+      "{\\\n"
+      "#if !defined(_STYPES)\\\n"
+      "\tint ver = NEWDEV;\\\n"
+      "#else\\\n"
+      "\tint ver = OLDDEV;\\\n"
+      "#endif\\\n"
+      "\treturn __makedev (ver, maj, mn);\\\n"
+      "}\\\n"
+      "\\\n"
+      "extern __inline__ __attribute ((__always_inline__))\\\n"
+      "major_t major(dev_t dev)\\\n"
+      "{\\\n"
+      "#if !defined(_STYPES)\\\n"
+      "\tint ver = NEWDEV;\\\n"
+      "#else\\\n"
+      "\tint ver = OLDDEV;\\\n"
+      "#endif\\\n"
+      "\treturn __major (ver, dev);\\\n"
+      "}\\\n"
+      "\\\n"
+      "extern __inline__ __attribute ((__always_inline__))\\\n"
+      "minor_t minor(dev_t dev)\\\n"
+      "{\\\n"
+      "#if !defined(_STYPES)\\\n"
+      "\tint ver = NEWDEV;\\\n"
+      "#else\\\n"
+      "\tint ver = OLDDEV;\\\n"
+      "#endif\\\n"
+      "\treturn __minor (ver, dev);\\\n"
+      "}";
+
+    test_text =
+      "#ifdef _EFTSAFE\n"
+      "/* blah */\n"
+      "#endif /* defined _EFTSAFE */\n"
+      "#define ONBITSMAJOR\t7";
+};
+
+/* Special case for sys/sockio.h. C++ cant inline variadic functions. */
+fix = {
+    hackname = sco_eftsafe3;
+    files    = sys/sockio.h;
+    mach     = *-sco5v6*;
+    mach     = *-unixware7*;
+    mach     = *-UnixWare7*;
+    mach     = *-sysv5*;
+    mach     = *-svr5*;
+    bypass   = "static __inline__";
+
+    sed      =
+      "/#define __IOCTL_VERSIONED__/ a\\\n"
+      "#ifndef __cplusplus\n"
+      "/#endif.*__IOCTL_VERSIONED__/ i\\\n"
+      "#endif\n";
+
+    sed      = "/^static /N; s/^static \\(.*\\)\\((.*)\\)/"
+               "extern __inline__ __attribute ((__always_inline__)) \\1 \\2/";
+
+    test_text =
+      "#ifndef __IOCTL_VERSIONED__\n"
+      "#define __IOCTL_VERSIONED__\n"
+      "extern int _xioctl(int, int, int, void *);\n"
+      "static int ioctl(int __a1, int __a2, ...)\n"
+      "{\n"
+      "  blah(); blah();\n"
+      "}\n"
+      "#endif /* !__IOCTL_VERSIONED__ */\n";
+};
 
 /*
  *  On OpenServer and on UnixWare 7, <math.h> uses the native compiler
@@ -2497,14 +2753,20 @@ fix = {
 fix = {
     hackname = sco_math;
     files    = math.h;
-    files    = ansi/math.h;
     files    = posix/math.h;
+    files    = ansi/math.h;
     files    = xpg4/math.h;
     files    = xpg4v2/math.h;
     files    = xpg4plus/math.h;
     files    = ods_30_compat/math.h;
     files    = oldstyle/math.h;
-    select   = "inline double abs";
+    mach     = *-sco3.2v5*;
+    mach     = *-sco5v6*;
+    mach     = *-unixware7*;
+    mach     = *-UnixWare7*;
+    mach     = *-sysv5*;
+    mach     = *-svr5*;
+    bypass   = "__GNUC__";
     bypass   = "__GNUG__";
     sed      = "/#define.*__fp_class(a) \\\\/i\\\n"
 	       "#ifndef __GNUC__\n";
@@ -2518,12 +2780,13 @@ fix = {
 "      __fpclassifyf(a),__fpclassify(a)))\\\n"
 "#endif";
 
-    sed      = "/extern \"C\\+\\+\"/N;"
+    sed      = "/extern \"C\+\+\"/N;"
 	       "/inline double abs/i\\\n"
                "#ifndef __GNUC__\n";
     sed      = "/inline long double trunc/N;"
-	       "/inline long double trunc.*}.*extern \"C\\+\\+\"/a\\\n"
-	       "#endif /* ! __GNUC__ */";
+	       "/inline long double trunc.*}.*extern \"C\+\+\"/a\\\n"
+	       "#endif /* ! __GNUC__ */\n";
+    sed      = "s/^#define is\\(.*\\)(x, y).*/#define is\\1(x, y) __builtin_is\\1((x),(y))/";
 
     test_text =
     "#define __fp_class(a) \\\\\n"
@@ -2531,71 +2794,188 @@ fix = {
 
 };
 
+/*
+ * On OpenServer 6 and UnixWare, math.h has definitions for NAN and
+ * INFINITY that cause problems for GCC. Replace them with the builtin
+ * functions.
+ */
+fix = {
+    hackname = sco_math_2;
+    files    = math.h;
+    mach     = *-sco5v6*;
+    mach     = *-unixware7*;
+    mach     = *-UnixWare7*;
+    mach     = *-sysv5*;
+    mach     = *-svr5*;
+    bypass   = "__GNUC__";
+    bypass   = "__GNUG__";
+
+    sed      =
+      "/#define __LDU/,/#define INFINITY/c\\\n"
+      "#undef NAN\\\n"
+      "#define NAN\t\t(__builtin_nanf(\"\"))\\\n"
+      "#undef HUGE_VAL\\\n"
+      "#define HUGE_VAL\t(__builtin_huge_val())\\\n"
+      "#undef HUGE_VALF\\\n"
+      "#define HUGE_VALF\t(__builtin_huge_valf())\\\n"
+      "#undef HUGE_VALL\\\n"
+      "#define HUGE_VALL\t(__builtin_huge_vall())\\\n"
+      "#undef INFINITY\\\n"
+      "#define INFINITY\t(__builtin_inff())";
+
+    test_text =
+      "#ifndef __cplusplus\n"
+      "#define __LDU	union{long double __x; unsigned char __c[sizeof(long double)];}\n"
+      "#define __INF	(+(const __LDU){.__c={[7]=0x80,0xff,0x7f}}.__x)\n"
+      "#define NAN		((float)+(const __LDU){.__c={[8]=0xff,0xff}}.__x)\n"
+      "#undef HUGE_VAL\n"
+      "#define HUGE_VAL	((double)__INF)\n"
+      "#define HUGE_VALF	((float)__INF)\n"
+      "#define HUGE_VALL	__INF\n"
+      "#define INFINITY	HUGE_VALF\n"
+      "#endif /*__cplusplus*/\n";
+};
+
+/*
+ * On SCO OpenServer 6 and UnixWare, pthread.h has poor initialization
+ * macros. Lets fix them shall we?
+ */
+fix = {
+    hackname  = sco_pthread;
+    files     = pthread.h;
+    mach      = "*-*-sco3.2v5*";
+    mach      = "*-*-sco5v6*";
+    mach      = "*-*-sysv5*";
+    select    = "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0";
+    sed       = "s@#define PTHREAD_MUTEX_INITIALIZER.*0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.*@"
+	"#define PTHREAD_MUTEX_INITIALIZER\t{{{0,0},{0,0},0,{0,0},{0,0}},0,0,0,{0,0,0}}@";
+
+    sed       = "s@#define PTHREAD_COND_INITIALIZER.*0,0,0,0,0,0,0.*@"
+	"#define PTHREAD_COND_INITIALIZER\t{{{0},{0,0},0,{0,0}},{0,0}}@";
+
+    sed       = "s@#define PTHREAD_ONCE_INIT.*@"
+	"#define PTHREAD_ONCE_INIT\t{0,0,{{0,0},{0,0},0,{0,0},{0,0}},{{0},{0,0},0,{0,0}}}@";
+
+    test_text =
+     "#define PTHREAD_MUTEX_INITIALIZER	{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}\n"
+     "#define PTHREAD_COND_INITIALIZER	{0,0,0,0,0,0,0,0}\n"
+     "#define PTHREAD_ONCE_INIT		{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}\n";
+};
 
 /*
- *  On SCO OpenServer prior to 5.0.7UP1, <sys/regset.h> and <ieeefp.h>
+ *  On SCO OpenServer prior to 5.0.7MP1, <sys/regset.h> and <ieeefp.h>
  *  have a clash on struct _fpstate and struct fpstate.
  */
 fix = {
-    hackname = sco_regset;
-    files    = sys/regset.h;
-    mach     = "*-*-sco3.2v5*";
-    select   = "(struct[ \t]+.*)fpstate";
+    hackname  = sco_regset;
+    files     = sys/regset.h;
+    mach      = "*-*-sco3.2v5*";
+    select    = "(struct[ \t]+.*)fpstate";
     c_fix     = format;
     c_fix_arg = "%1rsfpstate";
 
     test_text =
-    "union u_fps {\n"
-    "    struct\tfpstate\n"
-    "    {\n"
-    "       int whatever;\n"
-    "    }\n"
-    "};\n"
-    "union _u_fps {\n"
-    "    struct _fpstate\n"
-    "    {\n"
-    "       int whatever;\n"
-    "    }\n"
-    "};\n";
+    "union u_fps { struct\tfpstate { int whatever; } };\n"
+    "union _u_fps { struct _fpstate { int whatever; } };\n";
 };
 
 
 /*
- *  The static functions lstat() and fchmod() in <sys/stat.h>
- *  cause G++ grief since they're not wrapped in "if __cplusplus".
- *
- *  On SCO OpenServer 5.0.0 through (at least) 5.0.5 <sys/stat.h> contains
- *  tiny static wrappers that aren't C++ safe.
+ * The string.h header file on SCO OpenServer has some inline C++ functions
+ * that confuse and upset libstdc++ horribly. Protect them from being defined
+ * when using GCC. UnixWare has the same problem.
  */
 fix = {
-    hackname = sco_static_func;
-    files    = sys/stat.h;
-    mach     = "i?86-*-sco3.2*";
-    select   = "^static int";
+    hackname = sco_string;
+    files    = ansi/string.h;
+    files    = posix/string.h;
+    files    = xpg4/string.h;
+    files    = xpg4v2/string.h;
+    files    = xpg4plus/string.h;
+    files    = ods_30_compat/string.h;
+    files    = oldstyle/string.h;
+    files    = string.h;
+    mach      = "*-*-sco3.2v5*";
+    mach      = "*-*-sco5v6*";
+    mach      = "*-*-sysv5*";
+    select   = "inline char";
+    sed      = "/extern \"C\+\+\"/N;"
+               "/inline void.*memchr/i\\\n"
+	       "#ifndef __GNUC__\n";
+    sed      = "/return.*strstr/N;"
+               "/return.*strstr.*}/a\\\n"
+	       "#endif /* ! __GNUC__ */";
+
+    test_text =
+  "extern \"C\+\+\" {\n"
+  "inline void *memchr(void *__1, int __2, size_t __3)\n"
+  "	{ return (void *)memchr((const void *)__1, __2, __3); }\n"
+  "inline char *strstr(char *__1, const char *__2)\n"
+  "	{ return (char *)strstr((const char *)__1, __2); }\n"
+  "}\n";
+};
 
-    sed      = "/^static int/i\\\n"
-               "#if __cplusplus\\\n"
-               "extern \"C\" {\\\n"
-               "#endif /* __cplusplus */";
-
-    sed      = "/^}$/a\\\n"
-               "#if __cplusplus\\\n"
-               " }\\\n"
-               "#endif /* __cplusplus */";
+
+/*
+ * On OpenServer 6 and UnixWare, the header files carefully protect the
+ * strict ANSI namespace. libstdc++ does not, so many tests fail becuase
+ * functions are missing when you compile with -ansi. We thus avoid the
+ * __STDC__ tests below, and eliminate those guards completely here.
+ */
+fix = {
+    hackname  = sco_stdc;
+    mach      = "*-*-sco3.2v5*";
+    mach      = "*-*-sco5v6*";
+    mach      = "*-*-sysv5*";
+    select    = "__STDC__ - 0";
+
+    sed       = "s/__STDC__ - 0 == 0/1/";
 
     test_text =
-    "#ifdef __STDC__\n"
-    "static int\tstat(const char *__f, struct stat *__p) {\n"
-    "\treturn __stat32(__f, __p);\n"
-    "}\n\n#  else /* !__STDC__ THIS FAILS ON BSD SYSTEMS */\n"
-
-    "static int\tstat(__f, __p)\n"
-    "\tchar *__f;\n"
-    "\tstruct stat *__p;\n"
-    "{\n"
-    "\treturn __stat32(__f, __p);\n"
-    "}\n"
-    "#endif";
+      "#if __STDC__ - 0 == 0 || defined(grumble)";
+};
+
+/*
+ * On SCO OpenServer 6 and UnixWare, synch.h has poor initialization
+ * macros, which affect thread initialization for UI-threads mode.
+ */
+fix = {
+    hackname  = sco_synch;
+    files     = synch.h;
+    mach      = "*-*-sco3.2v5*";
+    mach      = "*-*-sco5v6*";
+    mach      = "*-*-sysv5*";
+    select    = "USYNC_THREAD, \\{0,0},0,0\\}";
+    sed       = "/^#define DEFAULTMUTEX/s@0,0}$@{0,0}}@";
+    sed       = "/^#define SHAREDMUTEX/s@0,0}$@{0,0}}@";
+
+    test_text =
+    "#define DEFAULTMUTEX    {{0,0},{0,0},USYNC_THREAD, {0,0},0,0}\n"
+    "#define SHAREDMUTEX     {{0,0},{0,0},USYNC_PROCESS,{0,0},0,0}\n";
+};
+
+/*
+ * UnixWare and OpenServer 6 have a namespace declaration of exit in
+ * unistd.h that trips up libstdc++. Foil it.
+ */
+fix = {
+    hackname  = sco_unistd_exit;
+    files     = unistd.h;
+    mach      = "i?86-*-sysv5*";
+    mach      = "i?86-*-sco5v6*";
+    bypass    = "__GNUC__";
+    bypass    = "__GNUG__";
+
+    sed       = "/defined(__cplusplus)/N;"
+		"/namespace std.*exit/ "
+		"s@(_CFRONT_3_0)@(_CFRONT_3_0) \\&\\& !defined(__GNUC__)@";
+
+    test_text =
+    "#if defined(__cplusplus) && !defined(_CFRONT_3_0)\n"
+    "namespace std { extern \"C\+\+\" void exit(int); } using std::exit;\n"
+    "#else\n"
+    "extern void	exit(int);\n"
+    "#endif\n";
 };
 
 
@@ -2616,6 +2996,108 @@ fix = {
 };
 
 /*
+ * The OpenServer 6 / UnixWare sys/types.h uses volatile structures for
+ * many of the threads related structures. This is causing the current
+ * GCC a conniption fit. For right now, the path of least resistance
+ * is to fix that header file. However, this fix may disappear when or
+ * if the compiler changes its view of what "volatile" really means.
+ */
+fix = {
+    hackname  = sco_volatile;
+    files     = sys/types.h;
+    files     = synch.h;
+    files     = aio.h;
+    mach      = "*-*-sco3.2v5*";
+    mach      = "*-*-sco5v6*";
+    mach      = "*-*-sysv5*";
+    select    = "typedef volatile struct";
+    sed       = "s@typedef volatile struct@typedef struct@g";
+    test_text =
+      "typedef volatile struct foo foo_t;";
+};
+
+/*
+ * The wchar.h header file on SCO OpenServer has some inline C++ functions
+ * that confuse and upset libstdc++ horribly. Protect them from being defined
+ * when using GCC. UnixWare has the same problem.
+ */
+fix = {
+    hackname = sco_wchar;
+    files    = ansi/wchar.h;
+    files    = posix/wchar.h;
+    files    = xpg4/wchar.h;
+    files    = xpg4v2/wchar.h;
+    files    = xpg4plus/wchar.h;
+    files    = ods_30_compat/wchar.h;
+    files    = oldstyle/wchar.h;
+    files    = wchar.h;
+    mach      = "*-*-sco3.2v5*";
+    mach      = "*-*-sco5v6*";
+    mach      = "*-*-sysv5*";
+    select   = "inline wchar_t";
+    sed      = "/extern \"C\+\+\"/N;"
+               "/inline wchar_t.*wcschr/i\\\n"
+	       "#ifndef __GNUC__\n";
+    sed      = "/return.*wmemchr/N;"
+               "/return.*wmemchr.*}/a\\\n"
+	       "#endif /* ! __GNUC__ */";
+
+    test_text =
+  "extern \"C\+\+\" {\n"
+  "inline wchar_t *wcschr(wchar_t *__1, wchar_t __2)\n"
+  "	{ return (wchar_t *)wcschr((const wchar_t *)__1, __2); }\n"
+  "inline wchar_t *wmemchr(wchar_t *__1, wchar_t __2, size_t __3)\n"
+  "	{ return (wchar_t *)wmemchr((const wchar_t *)__1, __2, __3); }\n"
+  "}\n";
+};
+
+/*
+ *  Arrange for pfmt.h, wchar.h to use stdarg.h to define __gnuc_va_list.
+ */
+fix = {
+    hackname = sco_wrap_stdarg_h;
+    files    = pfmt.h;
+    files    = wchar.h;
+    bypass   = "include.*stdarg\.h";
+    mach     = "*-*-sysv5*";
+    mach     = "*-*-sco5v6*";
+
+    c_fix     = wrap;
+
+    c_fix_arg = "#define __need___va_list\n#include <stdarg.h>\n";
+
+    test_text = "";
+};
+
+/*
+ *  Arrange for stdlib.h to be wrapped inside an extra #ifndef ...#endif.
+ *  This is to work around a weakness in fix-header that checks for
+ *  a "well wrapped" files. The SCO headers are indeed "well wrapped",
+ *  but the wrapping appears inside another conditional, which confuses
+ *  fix-header. So we wrap the whole file with out own wrapper so that
+ *  fix-header does not insert its stuff after the terminating #endif.
+ *  Stringly speaking, this should not be necessary, but at least one
+ *  test case does a #include in the middle of a function, and that
+ *  include pulls in stdlib, and fix-headers extern "C" stuff at the
+ *  end winds up in the middle of, say, main. I fixed the test case too,
+ *  but this will at least allow things to work in user programs that
+ *  may to the same misguided thing.
+ */
+fix = {
+    hackname = sco_wrap_stdlib_h;
+    files    = stdlib.h;
+    mach     = "*-*-sco3.2v5*";
+
+    c_fix     = wrap;
+
+    c_fix_arg = "#ifndef __stdlib_h_fixhdr_wrap\n"
+	"#define __stdlib_h_fixhdr_wrap\n";
+
+    c_fix_arg = "#endif /* __stdlib_h_fixhdr_wrap */\n";
+    test_text = "";
+};
+
+/*
  * Sun Solaris 10 defines several C99 math macros in terms of
  * builtins specific to the Studio compiler, in particular not
  * compatible with the GNU compiler.
@@ -2796,6 +3278,8 @@ fix = {
 fix = {
     hackname = solaris_mutex_init_1;
     select = '@\(#\)pthread.h' "[ \t]+1.1[0-9][ \t]+9[567]/[0-9/]+ SMI";
+    mach   = '*-*-sysv5*';
+    not_machine = true;
     files = pthread.h;
     sed   = "/define[ \t]*PTHREAD_MUTEX_INI/s/{0, 0,/{{{0}, 0}, {{{0}}},/\n"
             "/define[ \t]*PTHREAD_COND_INI/s/{0,/{{{0},0},/";
@@ -2983,6 +3467,7 @@ fix = {
     sed = "s@[ \t]va_list\\([ \t)]\\)@ __gnuc_va_list\\1@\n"
 	  "s@(va_list)&@(__gnuc_va_list)\\&@\n"
           "s@ _VA_LIST_));@ __gnuc_va_list));@\n"
+          "s@ _VA_LIST);@ __gnuc_va_list);@\n"
           "s@ __VA_LIST__));@ __gnuc_va_list));@\n"
           "s@ va_list@ __not_va_list__@\n"
           "s@\\*va_list@*__not_va_list__@\n"
@@ -3034,6 +3519,8 @@ fix = {
 	  "s@(va_list)&@(__gnuc_va_list)\\&@\n"
           "s@ _VA_LIST_));@ __gnuc_va_list));@\n"
           "s@ __VA_LIST__));@ __gnuc_va_list));@\n"
+          "s@ __VA_LIST__);@ __gnuc_va_list);@\n"
+          "s@ _VA_LIST);@ __gnuc_va_list);@\n"
           "s@ va_list@ __not_va_list__@\n"
           "s@\\*va_list@*__not_va_list__@\n"
           "s@ __va_list)@ __gnuc_va_list)@\n"
@@ -3050,6 +3537,14 @@ fix = {
 
 
 /*
+ * These test on __STDC__ -0 == 0. Its a commedy of errors. autoconf
+ * checks to see if the functions are present, libstdc++ uses them
+ * if they are without checking __STRICT_ANSI__. So on SYSV5 we bypass
+ * all of these hacks and in fact remove all __STDC__ - 0 checks from
+ * the headers.
+ */
+ 
+/*
  *  "!__STDC__" or "__STDC__==0" or "__STDC__!=1" or "__STDC__-0==0"
  *  is "!defined( __STRICT_ANSI__ )"
  */
@@ -3065,6 +3560,7 @@ fix = {
     /* GNU gmp.h uses "__STDC__ != 1" only if __SCO_VERSION__, which
        is not defined by GCC, so it is safe.  */
     bypass = '__SCO_VERSION__.*__STDC__ != 1';
+    bypass = '_CFRONT_3_0';
     c_test   = stdc_0_in_system_headers;
 
     c_fix     = format;
@@ -3099,6 +3595,7 @@ fix = {
                "([ \t(]*!*[ \t]*defined\\([a-zA-Z_0-9]+\\)[ \t]*[|&][|&])*"
                "[ \t(]*)"
                "(__STDC__[ \t]*(|-[ \t]*0[ \t]*)==[ \t]*0)";
+    bypass   = '_CFRONT_3_0';
     c_test   = stdc_0_in_system_headers;
 
     c_fix     = format;
@@ -3369,6 +3866,7 @@ fix = {
     hackname = svr4_ftw;
     files    = ftw.h;
     select   = '^extern int ftw\(const';
+    bypass   = '_XFTWVER64';
 
     sed = '/^extern int ftw(const/i' "\\\n"
             "#if !defined(_STYPES)\\\n"
Index: fixincludes/tests/base/ctype.h
===================================================================
RCS file: /cvs/gcc/gcc/fixincludes/tests/base/ctype.h,v
retrieving revision 1.1
diff -u -3 -p -u -r1.1 ctype.h
--- fixincludes/tests/base/ctype.h	31 Aug 2004 09:26:07 -0000	1.1
+++ fixincludes/tests/base/ctype.h	13 Oct 2005 04:55:34 -0000
@@ -63,3 +63,11 @@ extern int __toupper();
 # define isalpha(__c) (__SB_masks ? (int)__SB_masks[__c] & _IS
 
 #endif  /* HPUX_CTYPE_MACROS_CHECK */
+
+
+#if defined( SCO_CFRONT_CHECK )
+#if !defined(_CFRONT_3_0) && !defined(__GNUC__)
+#include <ctype> /* for namespace std */
+#endif
+
+#endif  /* SCO_CFRONT_CHECK */
Index: fixincludes/tests/base/dirent.h
===================================================================
RCS file: fixincludes/tests/base/dirent.h
diff -N fixincludes/tests/base/dirent.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ fixincludes/tests/base/dirent.h	13 Oct 2005 04:55:34 -0000
@@ -0,0 +1,24 @@
+/*  DO NOT EDIT THIS FILE.
+
+    It has been auto-edited by fixincludes from:
+
+	"fixinc/tests/inc/dirent.h"
+
+    This had to be done to correct non-standard usages in the
+    original, manufacturer supplied header file.  */
+
+
+
+#if defined( SCO__FIXINC_NOTEFTSAFE_CHECK )
+#ifdef __FIXINC_NOTEFTSAFE
+#define getsockopt(blah, bleh) _xgetsockopt(__NETLIB_VERSION__,1,2)
+#else /* !__FIXINC_NOTEFTSAFE */
+#pragma weak _xgetsockopt
+#pragma weak getsockopt
+extern int getsockopt(int, int, int, void *, socklen_t *);
+extern __inline__ __attribute ((__always_inline__)) int getsockopt(int __a1, int __a2, int __a3, void *__a4, socklen_t *__a5)
+{
+  return (_xgetsockopt(__NETLIB_VERSION__, __a1, __a2, __a3, __a4, __a5) );
+}
+
+#endif  /* SCO__FIXINC_NOTEFTSAFE_CHECK */
Index: fixincludes/tests/base/math.h
===================================================================
RCS file: /cvs/gcc/gcc/fixincludes/tests/base/math.h,v
retrieving revision 1.2.18.1
diff -u -3 -p -u -r1.2.18.1 math.h
--- fixincludes/tests/base/math.h	19 Aug 2005 14:50:26 -0000	1.2.18.1
+++ fixincludes/tests/base/math.h	13 Oct 2005 04:55:34 -0000
@@ -44,10 +44,8 @@ extern int matherr();
 
 #if defined( HPUX11_FABSF_CHECK )
 #ifdef _PA_RISC
-#ifndef __cplusplus
 #  define fabsf(x) ((float)fabs((double)(float)(x)))
 #endif
-#endif
 #endif  /* HPUX11_FABSF_CHECK */
 
 
@@ -81,17 +79,42 @@ extern int class();
 
 
 #if defined( SCO_MATH_CHECK )
+#ifndef __GNUC__
 #define __fp_class(a) \
  __builtin_generic(a,"ld:__fplcassifyl;f:__fpclassifyf;:__fpclassify")
+#else
+#define __fp_class(a) \
+  __builtin_choose_expr(__builtin_types_compatible_p(typeof(a),long double),\
+   __fpclassifyl(a), \
+    __builtin_choose_expr(__builtin_types_compatible_p(typeof(a), float), \
+      __fpclassifyf(a),__fpclassify(a)))
+#endif
 
 #endif  /* SCO_MATH_CHECK */
 
 
+#if defined( SCO_MATH_2_CHECK )
+#ifndef __cplusplus
+#undef NAN
+#define NAN		(__builtin_nanf(""))
+#undef HUGE_VAL
+#define HUGE_VAL	(__builtin_huge_val())
+#undef HUGE_VALF
+#define HUGE_VALF	(__builtin_huge_valf())
+#undef HUGE_VALL
+#define HUGE_VALL	(__builtin_huge_vall())
+#undef INFINITY
+#define INFINITY	(__builtin_inff())
+#endif /*__cplusplus*/
+
+#endif  /* SCO_MATH_2_CHECK */
+
+
 #if defined( STRICT_ANSI_NOT_CTD_CHECK )
 #if 1 && \
-&& defined(mumbling) |& ( !defined(__STRICT_ANSI__)) \
+&& defined(mumbling) |& (1) \
 (  !defined(__STRICT_ANSI__) && !defined(_XOPEN_SOURCE) \
-||  !defined(__STRICT_ANSI__) ) /* not std C */
+|| 1 ) /* not std C */
 int foo;
 #endif
 #endif  /* STRICT_ANSI_NOT_CTD_CHECK */
Index: fixincludes/tests/base/pfmt.h
===================================================================
RCS file: fixincludes/tests/base/pfmt.h
diff -N fixincludes/tests/base/pfmt.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ fixincludes/tests/base/pfmt.h	13 Oct 2005 04:55:34 -0000
@@ -0,0 +1,21 @@
+/*  DO NOT EDIT THIS FILE.
+
+    It has been auto-edited by fixincludes from:
+
+	"fixinc/tests/inc/pfmt.h"
+
+    This had to be done to correct non-standard usages in the
+    original, manufacturer supplied header file.  */
+
+#ifndef FIXINC_WRAP_PFMT_H_SCO_WRAP_STDARG_H
+#define FIXINC_WRAP_PFMT_H_SCO_WRAP_STDARG_H 1
+
+#define __need___va_list
+#include <stdarg.h>
+
+
+#if defined( SCO_WRAP_STDARG_H_CHECK )
+
+#endif  /* SCO_WRAP_STDARG_H_CHECK */
+
+#endif  /* FIXINC_WRAP_PFMT_H_SCO_WRAP_STDARG_H */
Index: fixincludes/tests/base/pthread.h
===================================================================
RCS file: /cvs/gcc/gcc/fixincludes/tests/base/pthread.h,v
retrieving revision 1.3.16.1
diff -u -3 -p -u -r1.3.16.1 pthread.h
--- fixincludes/tests/base/pthread.h	21 Mar 2005 16:17:54 -0000	1.3.16.1
+++ fixincludes/tests/base/pthread.h	13 Oct 2005 04:55:34 -0000
@@ -66,6 +66,14 @@ extern int __sigsetjmp (struct __jmp_buf
 #endif  /* PTHREAD_INCOMPLETE_STRUCT_ARGUMENT_CHECK */
 
 
+#if defined( SCO_PTHREAD_CHECK )
+#define PTHREAD_MUTEX_INITIALIZER	{{{0,0},{0,0},0,{0,0},{0,0}},0,0,0,{0,0,0}}
+#define PTHREAD_COND_INITIALIZER	{{{0},{{{0},0},0},0,{0,0}},{0,0}}
+#define PTHREAD_ONCE_INIT	{0,0,{{0,0},{0,0},0,{0,0},{0,0}},{{0},{0,0},0,{0,0}}}
+
+#endif  /* SCO_PTHREAD_CHECK */
+
+
 #if defined( SOLARIS_MUTEX_INIT_1_CHECK )
 #ident "@(#)pthread.h  1.16    97/05/05 SMI"
 #if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)
Index: fixincludes/tests/base/stdlib.h
===================================================================
RCS file: /cvs/gcc/gcc/fixincludes/tests/base/stdlib.h,v
retrieving revision 1.3
diff -u -3 -p -u -r1.3 stdlib.h
--- fixincludes/tests/base/stdlib.h	15 Sep 2004 22:12:58 -0000	1.3
+++ fixincludes/tests/base/stdlib.h	13 Oct 2005 04:55:34 -0000
@@ -7,6 +7,11 @@
     This had to be done to correct non-standard usages in the
     original, manufacturer supplied header file.  */
 
+#ifndef FIXINC_WRAP_STDLIB_H_SCO_WRAP_STDLIB_H
+#define FIXINC_WRAP_STDLIB_H_SCO_WRAP_STDLIB_H 1
+
+#ifndef __stdlib_h_fixhdr_wrap
+#define __stdlib_h_fixhdr_wrap
 
 
 #if defined( HPUX11_ABS_CHECK )
@@ -33,6 +38,17 @@ extern int putenv				_AP((char *));
 #endif  /* LYNXOS_MISSING_PUTENV_CHECK */
 
 
+#if defined( SCO_ABS_ETC_CHECK )
+extern "C++" {
+
+#endif  /* SCO_ABS_ETC_CHECK */
+
+
+#if defined( SCO_WRAP_STDLIB_H_CHECK )
+
+#endif  /* SCO_WRAP_STDLIB_H_CHECK */
+
+
 #if defined( SVR4_GETCWD_CHECK )
 extern char* getcwd(char *, size_t);
 #endif  /* SVR4_GETCWD_CHECK */
@@ -70,3 +86,6 @@ void	unsetenv();
 int	putenv();
 
 #endif  /* ULTRIX_STDLIB_CHECK */
+#endif /* __stdlib_h_fixhdr_wrap */
+
+#endif  /* FIXINC_WRAP_STDLIB_H_SCO_WRAP_STDLIB_H */
Index: fixincludes/tests/base/synch.h
===================================================================
RCS file: fixincludes/tests/base/synch.h
diff -N fixincludes/tests/base/synch.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ fixincludes/tests/base/synch.h	13 Oct 2005 04:55:34 -0000
@@ -0,0 +1,16 @@
+/*  DO NOT EDIT THIS FILE.
+
+    It has been auto-edited by fixincludes from:
+
+	"fixinc/tests/inc/synch.h"
+
+    This had to be done to correct non-standard usages in the
+    original, manufacturer supplied header file.  */
+
+
+
+#if defined( SCO_SYNCH_CHECK )
+#define DEFAULTMUTEX    {{0,0},{0,0},USYNC_THREAD, {0,0},{0,0}}
+#define SHAREDMUTEX     {{0,0},{0,0},USYNC_PROCESS,{0,0},{0,0}}
+
+#endif  /* SCO_SYNCH_CHECK */
Index: fixincludes/tests/base/testing.h
===================================================================
RCS file: /cvs/gcc/gcc/fixincludes/tests/base/testing.h,v
retrieving revision 1.2
diff -u -3 -p -u -r1.2 testing.h
--- fixincludes/tests/base/testing.h	13 Nov 2004 20:41:00 -0000	1.2
+++ fixincludes/tests/base/testing.h	13 Oct 2005 04:55:34 -0000
@@ -93,11 +93,16 @@ extern __ptr_t memcpy __P ((__ptr_t __de
 #endif  /* MACHINE_NAME_CHECK */
 
 
+#if defined( SCO_STDC_CHECK )
+#if 1 || defined(grumble)
+#endif  /* SCO_STDC_CHECK */
+
+
 #if defined( STRICT_ANSI_NOT_CHECK )
 #if  !defined(__STRICT_ANSI__) 
 #if  !defined(__STRICT_ANSI__)
 #if  !defined(__STRICT_ANSI__)
-#if  !defined(__STRICT_ANSI__)/* not std C */
+#if 1/* not std C */
 int foo;
 
 #end-end-end-end-if :-)
Index: fixincludes/tests/base/unistd.h
===================================================================
RCS file: /cvs/gcc/gcc/fixincludes/tests/base/unistd.h,v
retrieving revision 1.1
diff -u -3 -p -u -r1.1 unistd.h
--- fixincludes/tests/base/unistd.h	31 Aug 2004 09:26:07 -0000	1.1
+++ fixincludes/tests/base/unistd.h	13 Oct 2005 04:55:34 -0000
@@ -14,6 +14,16 @@ extern void *sbrk(ptrdiff_t increment);
 #endif  /* ALPHA_SBRK_CHECK */
 
 
+#if defined( SCO_UNISTD_EXIT_CHECK )
+#if defined(__cplusplus) && !defined(_CFRONT_3_0) && !defined(__GNUC__)
+namespace std { extern "C++" void exit(int); } using std::exit;
+#else
+extern void	exit(int);
+#endif
+
+#endif  /* SCO_UNISTD_EXIT_CHECK */
+
+
 #if defined( SOLARIS_UNISTD_CHECK )
 #ident "@(#)unistd.h   1.33    95/08/28 SMI"
 extern int getpagesize();
Index: fixincludes/tests/base/wchar.h
===================================================================
RCS file: /cvs/gcc/gcc/fixincludes/tests/base/wchar.h,v
retrieving revision 1.1
diff -u -3 -p -u -r1.1 wchar.h
--- fixincludes/tests/base/wchar.h	31 Aug 2004 09:26:07 -0000	1.1
+++ fixincludes/tests/base/wchar.h	13 Oct 2005 04:55:34 -0000
@@ -7,9 +7,16 @@
     This had to be done to correct non-standard usages in the
     original, manufacturer supplied header file.  */
 
+#ifndef FIXINC_WRAP_WCHAR_H_SCO_WRAP_STDARG_H
+#define FIXINC_WRAP_WCHAR_H_SCO_WRAP_STDARG_H 1
+
+#define __need___va_list
+#include <stdarg.h>
 
 
 #if defined( ALPHA_WCHAR_CHECK )
 extern wchar_t *wcstok __((wchar_t *, const wchar_t *, wchar_t **)) __asm__("wcstok_r");
 extern size_t   wcsftime __((wchar_t *, size_t, const wchar_t *, const struct tm *)) __asm__("__wcsftime_isoc");
 #endif  /* ALPHA_WCHAR_CHECK */
+
+#endif  /* FIXINC_WRAP_WCHAR_H_SCO_WRAP_STDARG_H */
Index: fixincludes/tests/base/ansi/string.h
===================================================================
RCS file: fixincludes/tests/base/ansi/string.h
diff -N fixincludes/tests/base/ansi/string.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ fixincludes/tests/base/ansi/string.h	13 Oct 2005 04:55:34 -0000
@@ -0,0 +1,22 @@
+/*  DO NOT EDIT THIS FILE.
+
+    It has been auto-edited by fixincludes from:
+
+	"fixinc/tests/inc/ansi/string.h"
+
+    This had to be done to correct non-standard usages in the
+    original, manufacturer supplied header file.  */
+
+
+
+#if defined( SCO_STRING_CHECK )
+#ifndef __GNUC__
+extern "C++" {
+inline void *memchr(void *__1, int __2, size_t __3)
+	{ return (void *)memchr((const void *)__1, __2, __3); }
+inline char *strstr(char *__1, const char *__2)
+	{ return (char *)strstr((const char *)__1, __2); }
+}
+#endif /* ! __GNUC__ */
+
+#endif  /* SCO_STRING_CHECK */
Index: fixincludes/tests/base/ansi/wchar.h
===================================================================
RCS file: fixincludes/tests/base/ansi/wchar.h
diff -N fixincludes/tests/base/ansi/wchar.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ fixincludes/tests/base/ansi/wchar.h	13 Oct 2005 04:55:34 -0000
@@ -0,0 +1,22 @@
+/*  DO NOT EDIT THIS FILE.
+
+    It has been auto-edited by fixincludes from:
+
+	"fixinc/tests/inc/ansi/wchar.h"
+
+    This had to be done to correct non-standard usages in the
+    original, manufacturer supplied header file.  */
+
+
+
+#if defined( SCO_WCHAR_CHECK )
+#ifndef __GNUC__
+extern "C++" {
+inline wchar_t *wcschr(wchar_t *__1, wchar_t __2)
+	{ return (wchar_t *)wcschr((const wchar_t *)__1, __2); }
+inline wchar_t *wmemchr(wchar_t *__1, wchar_t __2, size_t __3)
+	{ return (wchar_t *)wmemchr((const wchar_t *)__1, __2, __3); }
+}
+#endif /* ! __GNUC__ */
+
+#endif  /* SCO_WCHAR_CHECK */
Index: fixincludes/tests/base/sys/mkdev.h
===================================================================
RCS file: fixincludes/tests/base/sys/mkdev.h
diff -N fixincludes/tests/base/sys/mkdev.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ fixincludes/tests/base/sys/mkdev.h	13 Oct 2005 04:55:34 -0000
@@ -0,0 +1,45 @@
+/*  DO NOT EDIT THIS FILE.
+
+    It has been auto-edited by fixincludes from:
+
+	"fixinc/tests/inc/sys/mkdev.h"
+
+    This had to be done to correct non-standard usages in the
+    original, manufacturer supplied header file.  */
+
+
+
+#if defined( SCO_EFTSAFE2_CHECK )
+extern __inline__ __attribute ((__always_inline__))
+dev_t makedev(major_t maj, minor_t mn)
+{
+#if !defined(_STYPES)
+	int ver = NEWDEV;
+#else
+	int ver = OLDDEV;
+#endif
+	return __makedev (ver, maj, mn);
+}
+
+extern __inline__ __attribute ((__always_inline__))
+major_t major(dev_t dev)
+{
+#if !defined(_STYPES)
+	int ver = NEWDEV;
+#else
+	int ver = OLDDEV;
+#endif
+	return __major (ver, dev);
+}
+
+extern __inline__ __attribute ((__always_inline__))
+minor_t minor(dev_t dev)
+{
+#if !defined(_STYPES)
+	int ver = NEWDEV;
+#else
+	int ver = OLDDEV;
+#endif
+	return __minor (ver, dev);
+}
+#endif  /* SCO_EFTSAFE2_CHECK */
Index: fixincludes/tests/base/sys/regset.h
===================================================================
RCS file: /cvs/gcc/gcc/fixincludes/tests/base/sys/regset.h,v
retrieving revision 1.1
diff -u -3 -p -u -r1.1 regset.h
--- fixincludes/tests/base/sys/regset.h	31 Aug 2004 09:26:15 -0000	1.1
+++ fixincludes/tests/base/sys/regset.h	13 Oct 2005 04:55:34 -0000
@@ -10,17 +10,7 @@
 
 
 #if defined( SCO_REGSET_CHECK )
-union u_fps {
-    struct	rsfpstate
-    {
-       int whatever;
-    }
-};
-union _u_fps {
-    struct _rsfpstate
-    {
-       int whatever;
-    }
-};
+union u_fps { struct	rsfpstate { int whatever; } };
+union _u_fps { struct _rsfpstate { int whatever; } };
 
 #endif  /* SCO_REGSET_CHECK */
Index: fixincludes/tests/base/sys/sockio.h
===================================================================
RCS file: fixincludes/tests/base/sys/sockio.h
diff -N fixincludes/tests/base/sys/sockio.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ fixincludes/tests/base/sys/sockio.h	13 Oct 2005 04:55:34 -0000
@@ -0,0 +1,24 @@
+/*  DO NOT EDIT THIS FILE.
+
+    It has been auto-edited by fixincludes from:
+
+	"fixinc/tests/inc/sys/sockio.h"
+
+    This had to be done to correct non-standard usages in the
+    original, manufacturer supplied header file.  */
+
+
+
+#if defined( SCO_EFTSAFE3_CHECK )
+#ifndef __IOCTL_VERSIONED__
+#define __IOCTL_VERSIONED__
+#ifndef __cplusplus
+extern int _xioctl(int, int, int, void *);
+extern __inline__ __attribute ((__always_inline__)) int ioctl (int __a1, int __a2, ...)
+{
+  blah(); blah();
+}
+#endif
+#endif /* !__IOCTL_VERSIONED__ */
+
+#endif  /* SCO_EFTSAFE3_CHECK */
Index: fixincludes/tests/base/sys/stat.h
===================================================================
RCS file: /cvs/gcc/gcc/fixincludes/tests/base/sys/stat.h,v
retrieving revision 1.1
diff -u -3 -p -u -r1.1 stat.h
--- fixincludes/tests/base/sys/stat.h	31 Aug 2004 09:26:15 -0000	1.1
+++ fixincludes/tests/base/sys/stat.h	13 Oct 2005 04:55:34 -0000
@@ -19,35 +19,6 @@ extern int fchmod(int, mode_t);
 #endif  /* RS6000_FCHMOD_CHECK */
 
 
-#if defined( SCO_STATIC_FUNC_CHECK )
-#ifdef __STDC__
-#if __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-static int	stat(const char *__f, struct stat *__p) {
-	return __stat32(__f, __p);
-}
-#if __cplusplus
- }
-#endif /* __cplusplus */
-
-#  else /* !__STDC__ THIS FAILS ON BSD SYSTEMS */
-#if __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-static int	stat(__f, __p)
-	char *__f;
-	struct stat *__p;
-{
-	return __stat32(__f, __p);
-}
-#if __cplusplus
- }
-#endif /* __cplusplus */
-#endif
-#endif  /* SCO_STATIC_FUNC_CHECK */
-
-
 #if defined( ULTRIX_STAT_CHECK )
 @(#)stat.h      6.1     (ULTRIX)
 #define S_IFPORT S_IFIFO
Index: fixincludes/tests/base/sys/types.h
===================================================================
RCS file: /cvs/gcc/gcc/fixincludes/tests/base/sys/types.h,v
retrieving revision 1.1
diff -u -3 -p -u -r1.1 types.h
--- fixincludes/tests/base/sys/types.h	31 Aug 2004 09:26:15 -0000	1.1
+++ fixincludes/tests/base/sys/types.h	13 Oct 2005 04:55:34 -0000
@@ -28,3 +28,8 @@ typedef __WCHAR_TYPE__ wchar_t;
 
 #endif /* ushort_t */
 #endif  /* GNU_TYPES_CHECK */
+
+
+#if defined( SCO_VOLATILE_CHECK )
+typedef struct foo foo_t;
+#endif  /* SCO_VOLATILE_CHECK */


GCC changes:

2005-10-07  Kean Johnston  <jkj@sco.com>

	* config.host: Use host-sco.o on SCO platforms.
	* config.build: Small comment correction (helps with grep).
	* config.gcc: Use new usegld.h file for SCO platforms where this
	matters.
	Corrected a comment typo and added support for SCO OpenServer 6,
	using *-*-sco5v6* as the target selector.
	Include usegas.h and usegld.h for *-*-sysv5*.
	Make SCO platforms use dbxelf.h and elfos.h.
	* config.in: HAVE_AS_IX86_CMOV_ATT_SYNTAX: Added.
	* configure.ac: SCO platforms support hidden attribute with their
	native linker.
	Check for USL/ATT cmov syntax as well as Sun syntax. Defines
	HAVE_AS_IX86_CMOV_ATT_SYNTAX if thats what the assembler supports.
	* coverage.c (create_coverage): Use a label prefixed with __gcov
	instead of a simple ASM_GENERATE_INTERNAL_LABEL which creates only
	local labels, which a pedantic assembler will not create a symbol
	for.
	* fix-header.c (files_to_ignore): Dont include X11 if host defines
	and ignore list, and make it such that the host list does not need
	to be terminated with a comma.
	* gcov-io.h: Do not include auto-host.h here ...
	* libgcov.c: include it here.
	* gthr-solaris.h: "Solaris" threads are really UI threads, which
	any System V 4.2MP or later system will support, so allow UnixWare
	and OpenServer 6 to work too.
	* gthr.h: Add support for UnixWare "pure" UI threads.
	* target-def.h (TARGET_PROMOTE_FUNCTION_ARGS,
	TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES):
	Protect against redefinition if target header defines them.
	* tlink.c: Define MAXPATHLEN to a reasonable value if the OS does
	not define it in any header files.
	* unwind-dw2.c (_Unwind_GetCFA): Correct return value cast.
	* config/usegld.h: New file. Defines USE_GNU_LD if targets need to
	know that.
	* config/i386/i386.c: Check the value of SUPPORTS_ONE_ONLY, not
	simply its presense in case targets #define SUPPORTS_ONE_ONLY 0.
	* config/i386/unix.h: Use tabs around .globl for consistency with
	the rest of the directives.
	* config/i386/sco5.h(TARGET_PROMOTE_FUNCTION_RETURN): define.
	(SUPPORTS_ONE_ONLY): Define.
	(TARGET_C99_FUNCTIONS): Define.
	(ASM_QUAD): Dont define unless we're using GAS.
	(FIXPROTO_IGNORE_LIST): Define to exclude curses.h "fix".
	(CTORS_SECTION_ASM_OP, DTORS_SECTION_ASM_OP): Only define if we're
	not using the GNU ld.
	(TARGET_ASM_FILE_START_FILE_DIRECTIVE): Remove.
	(DWARF2_DEBUGGING_INFO): Remove.
	(PREFERRED_DEBUGGING_TYPE): Remove.
	(MD_EXEC_PREFIX): Set if either GAS or GNU ld are being used.
	(DEFAULT_LINKER): Allow use of GNU ld.
	(DEFAULT_ASSEMBLER): Allow use of GNU as.
	(TARGET_OS_CPP_BUILTINS): Add 'osr5', 'OpenServer' and
	'OpenServer5' as assertions.
	(LINK_SPEC): Adjust correctly if we are using GNU ld.
	(LIB_SPEC): Ditto.
	(SUBTARGET_SWITCHES, SUBTARGET_OVERRIDE_OPTIONS): Produce error
	message if user attempts to use -mcoff which has been deprecated
	for years.
	(DBX_DEBUGGING_INFO): Remove. Pick it up from dbxelf.h.
	(TARGET_SUBTARGET_DEFAULT): Remove. Pick it up from unix.h.
	* config/i386/sco6.h: New file for SCO OpenServer 6 support.
	* config/i386/scogcc.map: New file for SCO link editor map
	language to deal with .gnu.linkonce sections.
	* config/i386/sysv5.h: Complete rewrite.
	* config/i386/t-sco5 (MULTILIB_EXCEPTIONS): Added.
	* config/i386/t-sysv5: Multilib on -fPIC and -pthread, and ensure
	that crt{begin,end}.o are compiled in PIC mode to prevent startup
	errors from the RTLD.
	Install the new scogcc.map file for the native link editor.
	* config/i386/host-sco.c: New file. Provided host target hook
	for mmap support.
	* config/i386/x-sco: New file. Rule to build host-sco.o.
	* doc/install.texi (ix86-x-sco32v5): Updated to recommend only
	using gas and gld, and fixed various patch names.
	(ix86-x-sysv5-6): New section for SCO OpenServer 6.

Index: gcc/config.build
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config.build,v
retrieving revision 1.3
diff -u -3 -p -u -r1.3 config.build
--- gcc/config.build	1 Oct 2003 23:51:09 -0000	1.3
+++ gcc/config.build	13 Oct 2005 04:55:34 -0000
@@ -86,7 +86,7 @@ case $build in
     build_exeext=.exe
     ;;
   i[34567]86-*-sco3.2v5*) 
-    # 80386 running SCO Open Server 5
+    # 80386 running SCO OpenServer 5
     build_install_headers_dir=install-headers-cpio
     ;;
   i[34567]86-sequent-ptx4* | i[34567]86-sequent-sysv4* )
Index: gcc/config.gcc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config.gcc,v
retrieving revision 1.516.2.12
diff -u -3 -p -u -r1.516.2.12 config.gcc
--- gcc/config.gcc	9 Aug 2005 10:57:04 -0000	1.516.2.12
+++ gcc/config.gcc	13 Oct 2005 04:55:35 -0000
@@ -1065,16 +1065,41 @@ i[34567]86-*-rtems*)
 	extra_parts="crtbegin.o crtend.o crti.o crtn.o"
 	tmake_file="i386/t-rtems-i386 i386/t-crtstuff t-rtems"
 	;;
-i[34567]86-*-sco3.2v5*)	# 80386 running SCO Open Server 5
+i[34567]86-*-sco3.2v5*)		# 80386 running SCO OpenServer 5
+	xm_defines=POSIX
+	install_headers_dir=install-headers-cpio
 	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h i386/sco5.h"
 	if test x$gas = xyes
 	then
 		tm_file="usegas.h ${tm_file}"
 	fi
+	if test x$gnu_ld = xyes
+	then
+		tm_file="usegld.h ${tm_file}"
+	fi
 	tmake_file=i386/t-sco5
 	extra_parts="crtbegin.o crtend.o"
 	use_fixproto=yes
 	;;
+i[34567]86-*-sco5v6* | i[34567]86-*-sysv5*6.*)	# 80386 running SCO OpenServer 6
+	xm_defines=POSIX
+	install_headers_dir=install-headers-cpio
+	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h i386/sysv5.h i386/sco6.h"
+	if test x$gas = xyes
+	then
+		tm_file="usegas.h ${tm_file}"
+	fi
+	if test x$gnu_ld = xyes
+	then
+		tm_file="usegld.h ${tm_file}"
+	fi
+	tmake_file=i386/t-sysv5
+	extra_parts="crtbegin.o crtend.o scogcc.map"
+	if test x$enable_threads = xyes; then
+		thread_file='posix'
+	fi
+	use_fixproto=yes
+	;;
 i[34567]86-*-solaris2*)
 	xm_defines="SMALL_ARG_MAX"
 	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h i386/sysv4.h sol2.h"
@@ -1130,18 +1155,26 @@ i[34567]86-*-solaris2*)
 	esac
 	;;
 i[34567]86-*-sysv5*)           # Intel x86 on System V Release 5
-       tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h i386/sysv4.h i386/sysv5.h"
-       if test x$stabs = xyes
-       then
-               tm_file="${tm_file} dbx.h"
-       fi
-       tmake_file="i386/t-crtpic t-svr4"
-       extra_parts="crtbegin.o crtend.o"
-       if test x$enable_threads = xyes; then
-	       thread_file='posix'
-       fi
+	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h i386/sysv5.h"
+	if test x$stabs = xyes
+	then
+		tm_file="${tm_file} dbx.h"
+	fi
+	if test x$gas = xyes
+	then
+		tm_file="usegas.h ${tm_file}"
+	fi
+	if test x$gnu_ld = xyes
+	then
+		tm_file="usegld.h ${tm_file}"
+	fi
+	tmake_file="i386/t-sysv5"
+	extra_parts="crtbegin.o crtend.o scogcc.map"
+	if test x$enable_threads = xyes; then
+		thread_file='posix'
+	fi
 	use_fixproto=yes
-       ;;
+	;;
 i[34567]86-*-sysv4*)		# Intel 80386's running system V.4
 	xm_defines="SMALL_ARG_MAX"
 	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h i386/sysv4.h i386/sysv4-cpp.h"
Index: gcc/config.host
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config.host,v
retrieving revision 2.12.10.1
diff -u -3 -p -u -r2.12.10.1 config.host
--- gcc/config.host	7 Mar 2005 22:46:12 -0000	2.12.10.1
+++ gcc/config.host	13 Oct 2005 04:55:35 -0000
@@ -126,6 +126,10 @@ case ${host} in
   i[34567]86-sequent-ptx4*)
     host_xm_defines="SMALL_ARG_MAX"
     ;;
+  i[34567]86-*-sco3.2v5* | i[34567]86-*-sco5v6* | i[34567]86-*-sysv5*)
+    out_host_hook_obj=host-sco.o
+    host_xmake_file=i386/x-sco
+    ;;
   i[34567]86-*-solaris2*)
     host_xm_defines="SMALL_ARG_MAX"
     out_host_hook_obj=host-solaris.o
Index: gcc/config.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config.in,v
retrieving revision 1.202.10.2
diff -u -3 -p -u -r1.202.10.2 config.in
--- gcc/config.in	1 Jun 2005 08:14:18 -0000	1.202.10.2
+++ gcc/config.in	13 Oct 2005 04:55:35 -0000
@@ -98,6 +98,9 @@
 /* Define if your assembler supports the --gstabs option. */
 #undef HAVE_AS_GSTABS_DEBUG_FLAG
 
+/* Define if your assembler supports the ATT syntax for cmov. */
+#undef HAVE_AS_IX86_CMOV_ATT_SYNTAX
+
 /* Define if your assembler supports the Sun syntax for cmov. */
 #undef HAVE_AS_IX86_CMOV_SUN_SYNTAX
 
Index: gcc/configure.ac
===================================================================
RCS file: /cvs/gcc/gcc/gcc/configure.ac,v
retrieving revision 2.94.8.5
diff -u -3 -p -u -r2.94.8.5 configure.ac
--- gcc/configure.ac	24 Aug 2005 02:24:11 -0000	2.94.8.5
+++ gcc/configure.ac	13 Oct 2005 04:55:36 -0000
@@ -2120,6 +2120,9 @@ changequote([,])dnl
       hppa64*-*-hpux* | ia64*-*-hpux*)
 	gcc_cv_ld_hidden=yes
 	;;
+      *-*-sco3.2v5* | *-*-sco5v6* | *-*-sysv5* | *-*-UnixWare7* | *-*-OpenUNIX*)
+	gcc_cv_ld_hidden=yes
+	;;
       *)
 	gcc_cv_ld_hidden=no
 	;;
@@ -2547,6 +2550,12 @@ elif test x$gcc_cv_ld != x; then
 	  && $gcc_cv_ld --help 2>/dev/null | grep -- -Bdynamic > /dev/null; then
 		gcc_cv_ld_static_dynamic=yes
 	fi
+
+	case "$target" in
+	  *-*-sco3.2v5* | *-*-sco5v6* | *-*-sysv5*)
+	    gcc_cv_ld_static_dynamic=yes
+	    ;;
+	esac
 fi
 if test x"$gcc_cv_ld_static_dynamic" = xyes; then
 	AC_DEFINE(HAVE_LD_STATIC_DYNAMIC, 1,
@@ -2713,12 +2722,18 @@ foo:	nop
       [AC_DEFINE(HAVE_GAS_FILDS_FISTS, 1,
         [Define if your assembler uses the new HImode fild and fist notation.])])
 
-    gcc_GAS_CHECK_FEATURE([cmov syntax],
+    gcc_GAS_CHECK_FEATURE([Sun cmov syntax],
       gcc_cv_as_ix86_cmov_sun_syntax,,,
       [cmovl.l %edx, %eax],,
       [AC_DEFINE(HAVE_AS_IX86_CMOV_SUN_SYNTAX, 1,
         [Define if your assembler supports the Sun syntax for cmov.])])
 
+    gcc_GAS_CHECK_FEATURE([ATT cmov syntax],
+      gcc_cv_as_ix86_cmov_att_syntax,,,
+      [cmovll %edx, %eax],,
+      [AC_DEFINE(HAVE_AS_IX86_CMOV_ATT_SYNTAX, 1,
+        [Define if your assembler supports the ATT syntax for cmov.])])
+
     # This one is used unconditionally by i386.[ch]; it is to be defined
     # to 1 if the feature is present, 0 otherwise.
     gcc_GAS_CHECK_FEATURE([GOTOFF in data],
Index: gcc/coverage.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/coverage.c,v
retrieving revision 1.47
diff -u -3 -p -u -r1.47 coverage.c
--- gcc/coverage.c	15 Sep 2004 20:47:39 -0000	1.47
+++ gcc/coverage.c	13 Oct 2005 04:55:36 -0000
@@ -911,7 +911,10 @@ create_coverage (void)
 
   gcov_info = build_decl (VAR_DECL, NULL_TREE, TREE_TYPE (t));
   TREE_STATIC (gcov_info) = 1;
-  ASM_GENERATE_INTERNAL_LABEL (name_buf, "LPBX", 0);
+  strcpy (name_buf, "*__gcov");
+  ASM_GENERATE_INTERNAL_LABEL (&name_buf[7], "LPBX", 0);
+  if (name_buf[7] == '*')
+    name_buf[7] = '_';
   DECL_NAME (gcov_info) = get_identifier (name_buf);
   DECL_INITIAL (gcov_info) = t;
 
Index: gcc/fix-header.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fix-header.c,v
retrieving revision 1.114
diff -u -3 -p -u -r1.114 fix-header.c
--- gcc/fix-header.c	16 Sep 2004 06:49:56 -0000	1.114
+++ gcc/fix-header.c	13 Oct 2005 04:55:36 -0000
@@ -120,9 +120,8 @@ int missing_extern_C_count = 0;
    earlier in fixproto, but this is simpler and easier to customize.) */
 
 static const char *const files_to_ignore[] = {
-  "X11/",
   FIXPROTO_IGNORE_LIST
-  0
+  ,0
 };
 #endif
 
Index: gcc/gcov-io.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gcov-io.h,v
retrieving revision 1.52.34.1
diff -u -3 -p -u -r1.52.34.1 gcov-io.h
--- gcc/gcov-io.h	2 May 2005 18:04:42 -0000	1.52.34.1
+++ gcc/gcov-io.h	13 Oct 2005 04:55:36 -0000
@@ -236,8 +236,6 @@ typedef HOST_WIDEST_INT gcov_type;
    is not also used in a DSO.  */
 #if IN_LIBGCOV
 
-#include "auto-host.h"   /* for HAVE_GAS_HIDDEN */
-
 #define gcov_var __gcov_var
 #define gcov_open __gcov_open
 #define gcov_close __gcov_close
Index: gcc/gthr-solaris.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gthr-solaris.h,v
retrieving revision 1.20
diff -u -3 -p -u -r1.20 gthr-solaris.h
--- gcc/gthr-solaris.h	23 Nov 2004 14:40:23 -0000	1.20
+++ gcc/gthr-solaris.h	13 Oct 2005 04:55:36 -0000
@@ -31,11 +31,15 @@ Software Foundation, 59 Temple Place - S
 
 /* Solaris threads as found in Solaris 2.[456].
    Actually these are Unix International (UI) threads, but I don't
-   know if anyone else implements these.  */
+   know if anyone else implements these.
+   Actually, UnixWare and OpenServer 6 both do. */
 
 #define __GTHREADS 1
 
 #include <thread.h>
+#if defined(__UNIXWARE__) || defined(__OPENSERVER__) || defined(__USLC__)
+#include <synch.h>
+#endif
 #include <errno.h>
 
 typedef thread_key_t __gthread_key_t;
Index: gcc/gthr.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gthr.h,v
retrieving revision 1.20
diff -u -3 -p -u -r1.20 gthr.h
--- gcc/gthr.h	30 Nov 2004 08:15:39 -0000	1.20
+++ gcc/gthr.h	13 Oct 2005 04:55:36 -0000
@@ -90,6 +90,7 @@ Software Foundation, 59 Temple Place - S
      POSIX/Unix95 threads with -D_PTHREADS95
      DCE threads with -D_DCE_THREADS
      Solaris/UI threads with -D_SOLARIS_THREADS
+     UnixWare/UI threads with -D_UI_THREADS
 */
 
 /* Check first for thread specific defines.  */
@@ -103,6 +104,8 @@ Software Foundation, 59 Temple Place - S
 #include "gthr-dce.h"
 #elif _SOLARIS_THREADS
 #include "gthr-solaris.h"
+#elif _UI_THREADS
+#include "gthr-solaris.h"
 
 /* Include GTHREAD_FILE if one is defined.  */
 #elif defined(HAVE_GTHR_DEFAULT)
Index: gcc/libgcov.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/libgcov.c,v
retrieving revision 1.26
diff -u -3 -p -u -r1.26 libgcov.c
--- gcc/libgcov.c	29 Jul 2004 08:58:59 -0000	1.26
+++ gcc/libgcov.c	13 Oct 2005 04:55:36 -0000
@@ -33,6 +33,10 @@ Software Foundation, 59 Temple Place - S
    compiled for the target, and hence definitions concerning only the host
    do not apply.  */
 
+/* We include auto-host.h here to get HAVE_GAS_HIDDEN.  This is
+   supposedly valid even though this is a "target" file.  */
+#include "auto-host.h"
+
 #include "tconfig.h"
 #include "tsystem.h"
 #include "coretypes.h"
Index: gcc/target-def.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/target-def.h,v
retrieving revision 1.112
diff -u -3 -p -u -r1.112 target-def.h
--- gcc/target-def.h	30 Dec 2004 03:07:37 -0000	1.112
+++ gcc/target-def.h	13 Oct 2005 04:55:37 -0000
@@ -377,9 +377,17 @@ Foundation, 59 Temple Place - Suite 330,
 
 #define TARGET_DWARF_HANDLE_FRAME_UNSPEC 0
 
+#ifndef TARGET_PROMOTE_FUNCTION_ARGS
 #define TARGET_PROMOTE_FUNCTION_ARGS hook_bool_tree_false
+#endif
+
+#ifndef TARGET_PROMOTE_FUNCTION_RETURN
 #define TARGET_PROMOTE_FUNCTION_RETURN hook_bool_tree_false
+#endif
+
+#ifndef TARGET_PROMOTE_PROTOTYPES 
 #define TARGET_PROMOTE_PROTOTYPES hook_bool_tree_false
+#endif
 
 #define TARGET_STRUCT_VALUE_RTX hook_rtx_tree_int_null
 #define TARGET_RETURN_IN_MEMORY default_return_in_memory
Index: gcc/tlink.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tlink.c,v
retrieving revision 1.59
diff -u -3 -p -u -r1.59 tlink.c
--- gcc/tlink.c	9 Nov 2004 10:12:19 -0000	1.59
+++ gcc/tlink.c	13 Oct 2005 04:55:37 -0000
@@ -32,6 +32,10 @@ Software Foundation, 59 Temple Place - S
 #include "demangle.h"
 #include "collect2.h"
 
+#ifndef MAXPATHLEN
+# define MAXPATHLEN 1024
+#endif
+
 #define MAX_ITERATIONS 17
 
 /* Defined in the automatically-generated underscore.c.  */
Index: gcc/unwind-dw2.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/unwind-dw2.c,v
retrieving revision 1.51
diff -u -3 -p -u -r1.51 unwind-dw2.c
--- gcc/unwind-dw2.c	27 Jan 2005 07:26:49 -0000	1.51
+++ gcc/unwind-dw2.c	13 Oct 2005 04:55:37 -0000
@@ -157,7 +157,7 @@ _Unwind_GetPtr (struct _Unwind_Context *
 _Unwind_Word
 _Unwind_GetCFA (struct _Unwind_Context *context)
 {
-  return (_Unwind_Ptr) context->cfa;
+  return (_Unwind_Word) context->cfa;
 }
 
 /* Overwrite the saved value for register REG in CONTEXT with VAL.  */
Index: gcc/config/usegld.h
===================================================================
RCS file: gcc/config/usegld.h
diff -N gcc/config/usegld.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gcc/config/usegld.h	13 Oct 2005 04:55:37 -0000
@@ -0,0 +1,21 @@
+/* Copyright (C) 2005 Free Software Foundation, Inc.
+
+   This file is part of GCC.
+
+   GCC 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.
+
+   GCC 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 GCC; see the file COPYING.  If not, write to
+   the Free Software Foundation, 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+/* Just set a single flag we can test for it inside other files.  */
+#define USE_GNU_LD 1
Index: gcc/config/i386/host-sco.c
===================================================================
RCS file: gcc/config/i386/host-sco.c
diff -N gcc/config/i386/host-sco.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gcc/config/i386/host-sco.c	13 Oct 2005 04:55:37 -0000
@@ -0,0 +1,159 @@
+/* SCO host-specific hook definitions.
+   Copyright (C) 2004-2005 Free Software Foundation, Inc.
+
+   This file is part of GCC.
+
+   GCC 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.
+
+   GCC 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 GCC; see the file COPYING.  If not, write to the
+   Free Software Foundation, 59 Temple Place - Suite 330, Boston,
+   MA 02111-1307, USA.  */
+
+/* Based on host-solaris.c */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include <sys/mman.h>
+#include "hosthooks.h"
+#include "hosthooks-def.h"
+
+
+#undef HOST_HOOKS_GT_PCH_USE_ADDRESS
+#define HOST_HOOKS_GT_PCH_USE_ADDRESS sco_gt_pch_use_address
+#undef HOST_HOOKS_GT_PCH_GET_ADDRESS
+#define HOST_HOOKS_GT_PCH_GET_ADDRESS sco_gt_pch_get_address
+
+/* Map SIZE bytes of FD+OFFSET at BASE.  Return 1 if we succeeded at 
+   mapping the data at BASE, -1 if we couldn't.  */
+
+static int
+sco_gt_pch_use_address (void *base, size_t size, int fd, size_t offset)
+{
+  void *addr;
+
+  /* We're called with size == 0 if we're not planning to load a PCH
+     file at all.  This allows the hook to free any static space that
+     we might have allocated at link time.  */
+  if (size == 0)
+    return -1;
+
+  addr = mmap (base, size, PROT_READ | PROT_WRITE, MAP_PRIVATE,
+	       fd, offset);
+
+#if defined(__UNIXWARE__) || \
+	(__OPENSERVER__ - 0 >= 600) || \
+	(defined(__USLC__) && !defined(_SCO_DS)) || \
+	(_SCO_DS - 0 >= 2)
+  /* SCO isn't good about honoring the mmap START parameter
+     without MAP_FIXED set.  Before we give up, search the desired
+     address space with mincore to see if the space is really free.  */
+  if (addr != base)
+    {
+      size_t page_size = getpagesize();
+      char one_byte;
+      size_t i;
+
+      if (addr != (void *) MAP_FAILED)
+	munmap (addr, size);
+
+      errno = 0;
+      for (i = 0; i < size; i += page_size)
+	if (mincore ((char *)base + i, page_size, (void *)&one_byte) == -1
+	    && errno == ENOMEM)
+	  continue; /* The page is not mapped.  */
+	else
+	  break;
+
+      if (i >= size)
+	addr = mmap (base, size, 
+		     PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED,
+		     fd, offset);
+    }
+#else
+  /*
+   * This is the code path for OpenServer 5, which doesn't have mincore.
+   * If we didn't get the address we want, and we didnt get an error,
+   * unmap it and try with MAP_FIXED.
+   */
+  if (addr != base)
+    {
+      if (addr != (void *) MAP_FAILED)
+	munmap (addr, size);
+      addr = mmap (base, size, PROT_READ | PROT_WRITE, MAP_PRIVATE,
+	fd, offset);
+    }
+#endif
+
+  return addr == base ? 1 : -1;
+}
+
+#define SCO_MAPBASE	0x40000000	/* Half-way down the address space */
+#define SCO_GAPSIZE	0x4000000	/* 64MB */
+
+#ifndef HAVE_MMAP_ANON
+static void *
+sco_anonmap (size_t size)
+{
+  void *addr;
+  int fd = open ("/dev/zero", O_RDONLY);
+
+  if (-1 == fd)
+    internal_error ("open /dev/zero: %m");
+
+  addr = mmap (0, size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
+  close (fd);
+  return addr;
+}
+#endif
+
+static void *
+sco_gt_pch_get_address (size_t size, int fd)
+{
+  void *addr, *tmpbuf;
+
+  addr = mmap ((void *)SCO_MAPBASE, size, PROT_READ | PROT_WRITE,
+	       MAP_PRIVATE, fd, 0);
+
+  /* If we failed the map, that means there's *no* free space.  */
+  if (addr == (void *) MAP_FAILED)
+    return NULL;
+  /* Unmap the area before returning.  */
+  munmap (addr, size);
+
+  /* If we got the exact area we requested, then that's great.  */
+  if (addr == (void *) SCO_MAPBASE)
+    return addr;
+
+  /*
+   * If we didnt get the exact address we requested, we allocate (on the
+   * heap) a large buffer, which we immediately free, and then try the
+   * map again, using the address that mmap returns.
+   */
+
+#ifndef HAVE_MMAP_ANON
+  tmpbuf = sco_anonmap (SCO_GAPSIZE);
+#else
+  tmpbuf = mmap (0, SCO_GAPSIZE, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+#endif
+  addr = mmap (0, size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
+  if (tmpbuf != (void *) MAP_FAILED)
+    munmap (tmpbuf, SCO_GAPSIZE);
+  if (addr == (void *) MAP_FAILED)
+    return NULL;
+  munmap (addr, size);
+
+  return addr;
+}
+
+
+const struct host_hooks host_hooks = HOST_HOOKS_INITIALIZER;
Index: gcc/config/i386/i386.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.c,v
retrieving revision 1.795.6.12
diff -u -3 -p -u -r1.795.6.12 i386.c
--- gcc/config/i386/i386.c	7 Oct 2005 05:32:35 -0000	1.795.6.12
+++ gcc/config/i386/i386.c	13 Oct 2005 04:55:38 -0000
@@ -3885,7 +3885,7 @@ ix86_setup_frame_addresses (void)
   cfun->machine->accesses_prev_frame = 1;
 }
 
-#if defined(HAVE_GAS_HIDDEN) && defined(SUPPORTS_ONE_ONLY)
+#if defined(HAVE_GAS_HIDDEN) && (SUPPORTS_ONE_ONLY - 0)
 # define USE_HIDDEN_LINKONCE 1
 #else
 # define USE_HIDDEN_LINKONCE 0
Index: gcc/config/i386/sco5.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/sco5.h,v
retrieving revision 1.85
diff -u -3 -p -u -r1.85 sco5.h
--- gcc/config/i386/sco5.h	17 Oct 2004 18:09:39 -0000	1.85
+++ gcc/config/i386/sco5.h	13 Oct 2005 04:55:39 -0000
@@ -1,5 +1,5 @@
 /* Definitions for Intel 386 running SCO Unix System V 3.2 Version 5.
-   Copyright (C) 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004
+   Copyright (C) 1992, 1995, 1996, 1997, 1998, 1999, 2000-2005
    Free Software Foundation, Inc.
    Contributed by Kean Johnston (jkj@sco.com)
 
@@ -23,14 +23,24 @@ Boston, MA 02111-1307, USA.  */
 #undef TARGET_VERSION
 #define TARGET_VERSION fprintf (stderr, " (i386, SCO OpenServer 5 Syntax)");
 
+#undef TARGET_PROMOTE_FUNCTION_RETURN
+#define TARGET_PROMOTE_FUNCTION_RETURN hook_bool_tree_true
+
+#undef SUPPORTS_ONE_ONLY
+#define SUPPORTS_ONE_ONLY	1
+
+#define TARGET_C99_FUNCTIONS	1
+
+#if !defined(USE_GNU_AS)
 #undef ASM_QUAD
+#endif
 
-#undef GLOBAL_ASM_OP
-#define GLOBAL_ASM_OP			"\t.globl\t"
+#define FIXPROTO_IGNORE_LIST	"curses.h"
 
 #undef BSS_SECTION_ASM_OP
 #define BSS_SECTION_ASM_OP		"\t.section\t.bss, \"aw\", @nobits"
   
+#if !defined(USE_GNU_LD)
 /*
  * NOTE: We really do want CTORS_SECTION_ASM_OP and DTORS_SECTION_ASM_OP.
  * Here's the reason why. If we dont define them, and we dont define them
@@ -41,10 +51,12 @@ Boston, MA 02111-1307, USA.  */
  * define these, many C++ ctors and dtors dont get run, because they never
  * wind up in the ctors/dtors arrays.
  */
+#undef CTORS_SECTION_ASM_OP
 #define CTORS_SECTION_ASM_OP		"\t.section\t.ctors, \"aw\""
+#undef DTORS_SECTION_ASM_OP
 #define DTORS_SECTION_ASM_OP		"\t.section\t.dtors, \"aw\""
+#endif /* !defined(USE_GNU_LD) */
 
-#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
 #undef X86_FILE_START_VERSION_DIRECTIVE
 #define X86_FILE_START_VERSION_DIRECTIVE true
 
@@ -59,12 +71,6 @@ Boston, MA 02111-1307, USA.  */
 #undef DBX_REGISTER_NUMBER
 #define DBX_REGISTER_NUMBER(n)	svr4_dbx_register_map[n]
 
-#define DWARF2_DEBUGGING_INFO		1
-#define DBX_DEBUGGING_INFO		1
-
-#undef PREFERRED_DEBUGGING_TYPE
-#define PREFERRED_DEBUGGING_TYPE	DWARF2_DEBUG
-
 #undef DWARF2_UNWIND_INFO
 #define DWARF2_UNWIND_INFO		1
 
@@ -85,9 +91,6 @@ Boston, MA 02111-1307, USA.  */
   && strcmp (STR, "Tdata") && strcmp (STR, "Ttext")			\
   && strcmp (STR, "Tbss"))
 
-#undef TARGET_SUBTARGET_DEFAULT
-#define TARGET_SUBTARGET_DEFAULT (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS)
-
 /*
  * Define sizes and types
  */
@@ -156,15 +159,26 @@ Boston, MA 02111-1307, USA.  */
 #define MD_STARTFILE_PREFIX	"/usr/gnu/lib/"
 #define MD_STARTFILE_PREFIX_1	"/usr/ccs/lib/"
 
-#if USE_GAS
+#if (USE_GAS - 0) || (USE_GLD - 0)
 # define MD_EXEC_PREFIX		"/usr/gnu/bin/"
 #else
 # define MD_EXEC_PREFIX		"/usr/ccs/bin/elf/"
 #endif
 
-/* Always use the system linker, please.  */
 #ifndef DEFAULT_LINKER
-# define DEFAULT_LINKER		"/usr/ccs/bin/elf/ld"
+# ifdef USE_GNU_LD
+#  define DEFAULT_LINKER	"/usr/gnu/bin/gld"
+# else
+#  define DEFAULT_LINKER	"/usr/ccs/bin/elf/ld"
+# endif
+#endif
+
+#ifndef DEFAULT_ASSEMBLER
+# ifdef USE_GAS
+#  define DEFAULT_ASSEMBLER	"/usr/gnu/bin/gas"
+# else
+#  define DEFAULT_ASSEMBLER	"/usr/ccs/bin/elf/as"
+# endif
 #endif
 
 /* Set up assembler flags for PIC and ELF compilations */
@@ -219,6 +233,9 @@ Boston, MA 02111-1307, USA.  */
 	builtin_define ("_M_XENIX");				\
 	builtin_define ("_M_UNIX");				\
 	builtin_assert ("system=svr3");				\
+	builtin_assert ("system=osr5");				\
+	builtin_assert ("system=OpenServer");			\
+	builtin_assert ("system=OpenServer5");			\
 	if (flag_iso)						\
 	  cpp_define (pfile, "_STRICT_ANSI");			\
 	if (flag_pic)						\
@@ -256,38 +273,70 @@ Boston, MA 02111-1307, USA.  */
      %{!Xt:-D_SCO_C_DIALECT=1}}}}"
 
 #undef LINK_SPEC
-#define LINK_SPEC \
- "%{!shared:%{!symbolic:%{!G:-E%{Xa:a}%{!Xa:%{Xc:c}%{!Xc:%{Xk:k}%{!Xk:%{Xt:t}%{!Xt:a}}}},%{ansi:ansi}%{!ansi:%{posix:posix}%{!posix:%{Xpg4:xpg4}%{!Xpg4:%{Xpg4plus:XPG4PLUS}%{!Xpg4plus:%{Xods30:ods30}%{!Xods30:XPG4PLUS}}}}},ELF}}} \
+#ifdef USE_GNU_LD
+#define LINK_SPEC "-m elf_i386_sco %{!r:\
+  %{Wl,*:%*} %{YP,*} %{G:%{!shared:-shared}} \
+  %{shared:-shared %{rpath*} %{h*} \
+   %{static:%e-shared and -static are mutually exclusive} \
+   %{Bstatic:%e-shared and -Bstatic are mutually exclusive} \
+   %{dn:%e-shared and -dn are mutually exclusive}} \
+  %{!shared:%{!static:%{!Bstatic: \
+   %{rdynamic:-export-dynamic} \
+   %{symbolic:-Bsymbolic} %{Bsymbolic:-Bsymbolic}}}} \
+  %{static:-static} %{Bstatic:-static} \
+  %{z*} %{R*}}"
+#else
+# define LINK_SPEC \
+ "%{!r:%{!shared:%{!symbolic:%{!G:-E%{Xa:a}%{!Xa:%{Xc:c}%{!Xc:%{Xk:k}%{!Xk:%{Xt:t}%{!Xt:a}}}},%{ansi:ansi}%{!ansi:%{posix:posix}%{!posix:%{Xpg4:xpg4}%{!Xpg4:%{Xpg4plus:XPG4PLUS}%{!Xpg4plus:%{Xods30:ods30}%{!Xods30:XPG4PLUS}}}}},ELF}}} \
   %{Wl,*:%*} %{YP,*} %{YL,*} %{YU,*} \
   %{!YP,*:%{p:-YP,/usr/ccs/libp:/lib/libp:/usr/lib/libp:/usr/ccs/lib:/lib:/usr/lib} \
    %{!p:-YP,/usr/ccs/lib:/lib:/usr/lib}} \
   %{h*} %{static:-dn -Bstatic %{G:%e-G and -static are mutually exclusive}} \
   %{shared:%{!G:-G}} %{G:%{!shared:-G}} %{shared:%{G:-G}} \
   %{shared:-dy %{symbolic:-Bsymbolic -G} %{z*}} %{R*} %{Y*} \
-  %{Qn:} %{!Qy:-Qn} -z alt_resolve"
+  %{Qn:} %{!Qy:-Qn} -z alt_resolve}"
+#endif
 
 /* Library spec. If we are not building a shared library, provide the
    standard libraries, as per the SCO compiler.  */
 
 #undef LIB_SPEC
-#define LIB_SPEC \
+#ifdef USE_GNU_LD
+# define LIB_SPEC \
+ "%{shared:%{!G:pic/libgcc.a%s}} \
+  %{G:%{!shared:pic/libgcc.a%s}} \
+  %{shared:%{G:pic/libgcc.a%s}} --as-needed \
+  %{p:%{!pp:-lelfprof -lelf}} %{pp:%{!p:-lelfprof -lelf}} \
+  %{!shared:%{!symbolic:%{!G:-lcrypt -lgen -lc}}}"
+#else
+# define LIB_SPEC \
  "%{shared:%{!G:pic/libgcc.a%s}} \
   %{G:%{!shared:pic/libgcc.a%s}} \
   %{shared:%{G:pic/libgcc.a%s}} \
   %{p:%{!pp:-lelfprof -lelf}} %{pp:%{!p:-lelfprof -lelf}} \
   %{!shared:%{!symbolic:%{!G:-lcrypt -lgen -lc}}}"
+#endif
 
 #undef LIBGCC_SPEC
 #define LIBGCC_SPEC \
  "%{!shared:%{!G:-lgcc}}"
 
 /* Here for legacy support only so we still accept -melf flag */
-#define MASK_COFF     		010000000000	/* Mask for COFF generation */
+#define MASK_COFF     		0x40000000	/* Mask for COFF generation */
 #define TARGET_ELF              (1)
 
 #undef SUBTARGET_SWITCHES
-#define SUBTARGET_SWITCHES 					\
-	{ "elf", -MASK_COFF, N_("Generate ELF output")  },
+#define SUBTARGET_SWITCHES \
+  { "elf", -MASK_COFF, N_("Generate ELF output")  }, \
+  { "coff", MASK_COFF, N_("Generate COFF output (no longer supported)") },
+
+#undef  SUBTARGET_OVERRIDE_OPTIONS
+#define SUBTARGET_OVERRIDE_OPTIONS \
+do { \
+  if (target_flags & MASK_COFF) { \
+    error ("-mcoff is no longer supported"); \
+  } \
+} while (0)
 
 /* Handle special EH pointer encodings.  Absolute, pc-relative, and
    indirect are handled automatically.  */
Index: gcc/config/i386/sco6.h
===================================================================
RCS file: gcc/config/i386/sco6.h
diff -N gcc/config/i386/sco6.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gcc/config/i386/sco6.h	13 Oct 2005 04:55:39 -0000
@@ -0,0 +1,49 @@
+/* Definitions for Intel 386 running SCO OpenServer Release 6
+   Copyright (C) 2005 Free Software Foundation, Inc.
+   Contributed by Kean Johnston (jkj@sco.com)
+
+This file is part of GCC.
+
+GCC 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.
+
+GCC 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 GCC; see the file COPYING.  If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+/*
+ * Note: Since OpenServer 6 is so similar to UnixWare 7, all this file needs
+ * to do is over-ride those bits of "sysv5.h" that are OSR6 specific.
+ */
+
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS()				\
+  do								\
+    {								\
+	builtin_define ("_SCO_DS=2");				\
+	builtin_define ("_SCO_DS_LL");				\
+	builtin_define ("_SCO_ELF");				\
+	builtin_define ("__UNIXWARE__");			\
+	builtin_define ("__OPENSERVER__=600");			\
+	builtin_assert ("system=svr5");				\
+	builtin_assert ("system=sysv5");			\
+	builtin_assert ("system=osr6");				\
+	builtin_assert ("system=OpenServer");			\
+	builtin_assert ("system=OpenServer6");			\
+	builtin_assert ("model=ilp32");				\
+	if (flag_pic)						\
+	  {							\
+	    builtin_define ("__PIC__");				\
+	    builtin_define ("__pic__");				\
+	  }							\
+    }								\
+  while (0)
+
Index: gcc/config/i386/scogcc.map
===================================================================
RCS file: gcc/config/i386/scogcc.map
diff -N gcc/config/i386/scogcc.map
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gcc/config/i386/scogcc.map	13 Oct 2005 04:55:39 -0000
@@ -0,0 +1,36 @@
+%link_once .gnu.linkonce.*;
+%rename .gnu.linkonce.b.*	= .bss;
+%rename .gnu.linkonce.sb.*	= .sbss;
+%rename .gnu.linkonce.sb2.*	= .sbss2;
+%rename .gnu.linkonce.d.*	= .data;
+%rename .gnu.linkonce.s.*	= .sdata;
+%rename .gnu.linkonce.s2.*	= .sdata2;
+%rename .gnu.linkonce.r.*	= .rodata;
+%rename .gnu.linkonce.t.*	= .text;
+%rename .gnu.linkonce.td.*	= .tdata;
+%rename .gnu.linkonce.tb.*	= .tbss;
+%rename .gnu.linkonce.wi.*	= .debug_info;
+%rename .rel.gnu.linkonce.b.*	= .rel.bss;
+%rename .rel.gnu.linkonce.sb.*	= .rel.sbss;
+%rename .rel.gnu.linkonce.sb2.*	= .rel.sbss2;
+%rename .rel.gnu.linkonce.d.*	= .rel.data;
+%rename .rel.gnu.linkonce.s.*	= .rel.sdata;
+%rename .rel.gnu.linkonce.s2.*	= .rel.sdata2;
+%rename .rel.gnu.linkonce.r.*	= .rel.rodata;
+%rename .rel.gnu.linkonce.t.*	= .rel.text;
+%rename .rel.gnu.linkonce.td.*	= .rel.tdata;
+%rename .rel.gnu.linkonce.tb.*	= .rel.tbss;
+%rename .rel.gnu.linkonce.wi.*	= .rel.debug_info;
+%rename .rela.gnu.linkonce.b.*	= .rela.bss;
+%rename .rela.gnu.linkonce.sb.*	= .rela.sbss;
+%rename .rela.gnu.linkonce.sb2.* = .rela.sbss2;
+%rename .rela.gnu.linkonce.d.*	= .rela.data;
+%rename .rela.gnu.linkonce.s.*	= .rela.sdata;
+%rename .rela.gnu.linkonce.s2.*	= .rela.sdata2;
+%rename .rela.gnu.linkonce.r.*	= .rela.rodata;
+%rename .rela.gnu.linkonce.t.*	= .rela.text;
+%rename .rela.gnu.linkonce.td.*	= .rela.tdata;
+%rename .rela.gnu.linkonce.tb.*	= .rela.tbss;
+%rename .rela.gnu.linkonce.wi.*	= .rela.debug_info;
+%rename .data.*			= .data;
+%rename .text.*			= .text;
Index: gcc/config/i386/sysv5.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/sysv5.h,v
retrieving revision 1.7
diff -u -3 -p -u -r1.7 sysv5.h
--- gcc/config/i386/sysv5.h	26 Sep 2003 04:07:46 -0000	1.7
+++ gcc/config/i386/sysv5.h	13 Oct 2005 04:55:39 -0000
@@ -1,6 +1,6 @@
 /* Definitions for Intel 386 running System V Release 5 (i.e. UnixWare 7)
-   Copyright (C) 1999 Free Software Foundation, Inc.
-   Contributed by Robert Lipe (robertlipe@usa.net)
+   Copyright (C) 2005 Free Software Foundation, Inc.
+   Contributed by Kean Johnston (jkj@sco.com)
 
 This file is part of GCC.
 
@@ -19,16 +19,306 @@ along with GCC; see the file COPYING.  I
 the Free Software Foundation, 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
+#undef TARGET_VERSION
+#define TARGET_VERSION fprintf (stderr, " (i386 System V Release 5)");
 
-/* Dwarf2 is supported by native debuggers  */
+/*
+ * libc has all the stuff we need. Its the headers that pose a problem.
+ * fixincludes tries to sort all of that out.
+ */
+#define TARGET_C99_FUNCTIONS	1
 
-#undef PREFERRED_DEBUGGING_TYPE
-#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
+#undef SUPPORTS_ONE_ONLY
+#define SUPPORTS_ONE_ONLY	1
 
-/* Add -lcrt for Dwarf2 abbreviation table */
-#undef  LIB_SPEC
-#define LIB_SPEC "%{pthread:-lthread} %{pthreadT:-lthreadT} \
-	%{!shared:%{!symbolic:-lc -lcrt}}"
+#if !defined(USE_GNU_AS)
+#undef ASM_QUAD
+#undef DBX_DEBUGGING_INFO
+#endif
+
+#undef BSS_SECTION_ASM_OP
+#define BSS_SECTION_ASM_OP		"\t.section\t.bss, \"aw\", @nobits"
+  
+#if !defined(USE_GNU_LD)
+/*
+ * NOTE: We really do want CTORS_SECTION_ASM_OP and DTORS_SECTION_ASM_OP.
+ * Here's the reason why. If we dont define them, and we dont define them
+ * to always emit to the same section, the default is to emit to "named"
+ * ctors and dtors sections. This would be great if we could use GNU ld,
+ * but we can't. The native linker could possibly be trained to coalesce
+ * named ctors sections, but that hasn't been done either. So if we don't
+ * define these, many C++ ctors and dtors dont get run, because they never
+ * wind up in the ctors/dtors arrays.
+ */
+#undef CTORS_SECTION_ASM_OP
+#define CTORS_SECTION_ASM_OP		"\t.section\t.ctors, \"aw\""
+#undef DTORS_SECTION_ASM_OP
+#define DTORS_SECTION_ASM_OP		"\t.section\t.dtors, \"aw\""
+#endif /* !defined(USE_GNU_LD) */
+
+#undef X86_FILE_START_VERSION_DIRECTIVE
+#define X86_FILE_START_VERSION_DIRECTIVE true
+
+/* A C statement (sans semicolon) to output to the stdio stream
+   FILE the assembler definition of uninitialized global DECL named
+   NAME whose size is SIZE bytes and alignment is ALIGN bytes.
+   Try to use asm_output_aligned_bss to implement this macro.  */
+
+#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
+  asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
+
+#undef DBX_REGISTER_NUMBER
+#define DBX_REGISTER_NUMBER(n)	svr4_dbx_register_map[n]
+
+#undef DWARF2_UNWIND_INFO
+#define DWARF2_UNWIND_INFO		1
+
+#undef NO_IMPLICIT_EXTERN_C
+#define NO_IMPLICIT_EXTERN_C		1
+
+#undef SWITCH_TAKES_ARG
+#define SWITCH_TAKES_ARG(CHAR) 						\
+  (DEFAULT_SWITCH_TAKES_ARG(CHAR)					\
+   || (CHAR) == 'h' 							\
+   || (CHAR) == 'R' 							\
+   || (CHAR) == 'Y' 							\
+   || (CHAR) == 'z')
+
+#undef WORD_SWITCH_TAKES_ARG
+#define WORD_SWITCH_TAKES_ARG(STR)					\
+ (DEFAULT_WORD_SWITCH_TAKES_ARG (STR)					\
+  && strcmp (STR, "Tdata") && strcmp (STR, "Ttext")			\
+  && strcmp (STR, "Tbss"))
+
+/*
+ * Define sizes and types
+ */
+#undef SIZE_TYPE
+#undef PTRDIFF_TYPE
+#undef WCHAR_TYPE
+#undef WCHAR_TYPE_SIZE
+#undef WINT_TYPE
+#define SIZE_TYPE		"unsigned int"
+#define PTRDIFF_TYPE		"int"
+#define WCHAR_TYPE		"long int"
+#define WCHAR_TYPE_SIZE		BITS_PER_WORD
+#define WINT_TYPE		"long int"
+
+#undef MD_STARTFILE_PREFIX
+#define MD_STARTFILE_PREFIX	"/usr/gnu/lib/"
+#undef MD_STARTFILE_PREFIX_1
+#define MD_STARTFILE_PREFIX_1	"/usr/ccs/lib/"
+
+#undef MD_EXEC_PREFIX
+#if USE_GAS
+# define MD_EXEC_PREFIX		"/usr/gnu/bin/"
+#else
+# define MD_EXEC_PREFIX		"/usr/ccs/bin/"
+#endif
+
+#ifndef DEFAULT_LINKER
+# ifdef USE_GNU_LD
+#  define DEFAULT_LINKER	"/usr/gnu/bin/gld"
+# else
+#  define DEFAULT_LINKER	"/usr/ccs/bin/ld"
+# endif
+#endif
+
+#ifndef DEFAULT_ASSEMBLER
+# ifdef USE_GAS
+#  define DEFAULT_ASSEMBLER	"/usr/gnu/bin/gas"
+# else
+#  define DEFAULT_ASSEMBLER	"/usr/ccs/bin/as"
+# endif
+#endif
+
+/* Set up assembler flags for PIC and ELF compilations */
+#undef ASM_SPEC
+
+#if USE_GAS
+  /* Leave ASM_SPEC undefined so we pick up the master copy from gcc.c  */
+#else
+#define ASM_SPEC "%{Ym,*} %{Yd,*} %{Wa,*:%*} %{!Qy:-Qn}"
+#endif
+
+/*
+ * Use crti.o for shared objects, crt1.o for normal executables. Make sure
+ * to recognize both -G and -shared as a valid way of introducing shared
+ * library generation. This is important for backwards compatibility.
+ *
+ * For profiling support, we immitate what the native compiler does, thus:
+ * -p (normal prof support)
+ *    Use mcrt1.o instead of crt1.o
+ *    Add -lprof
+ *    Change paths to look in /usr/ccs/lib/libp and /usr/lib/libp first
+ *    Add -I /usr/ccs/lib/libp/libc.so.1 (sets interpreter)
+ * -pl (line profiling, the equivalent of the native -ql flag for lprof)
+ *    Use pcrt1.o instead of crt1.o
+ *    Add -lprof
+ * -pf (flow profiling, for fprof)
+ *    Add -lfprof
+ *
+ * Support the same -X flags as the native compiler, thus:
+ * -Xa - use values-Xa.o
+ * -Xb - use values-Xa.o
+ * -Xc - use values-Xc.o
+ * -Xt - use values-Xt.o
+ *
+ * Support pthreads as the native compiler, thus:
+ * -pthread (POSIX threads semantics)
+ *   add -lthread before -lc
+ *   add values-pthread.o after values-X[act].o
+ * -pthreadT (POSIX threads semantics)
+ *   add -lthreadT before -lc
+ *   add values-pthread.o after values-X[act].o
+ */
+
+#undef STARTFILE_SPEC
+#define STARTFILE_SPEC \
+ "%{!shared:\
+   %{!symbolic:\
+    %{!G:\
+     %{p:mcrt1.o%s}%{pl:pcrt1.o%s}%{!p:%{!pl:crt1.o%s}}}}}\
+  crti.o%s\
+  %{ansi:values-Xc.o%s}\
+   %{!ansi:%{traditional:values-Xt.o%s}\
+    %{!traditional:%{Xa:values-Xa.o%s}\
+     %{!Xa:%{Xb:values-Xa.o%s}\
+      %{!Xb:%{Xc:values-Xc.o%s}\
+       %{!Xc:%{Xt:values-Xt.o%s}\
+        %{!Xt:values-Xa.o%s}}}}}}\
+  %{pthread:values-pthread.o%s}%{pthreadT:values-pthread.o%s}\
+  crtbegin.o%s"
+
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC "crtend.o%s crtn.o%s"
+
+#define TARGET_OS_CPP_BUILTINS()				\
+  do								\
+    {								\
+	builtin_define ("__UNIXWARE__");			\
+	builtin_assert ("system=svr5");				\
+	builtin_assert ("system=sysv5");			\
+	builtin_assert ("system=UnixWare");			\
+	builtin_assert ("system=UnixWare7");			\
+	builtin_assert ("model=ilp32");				\
+	if (flag_pic)						\
+	  {							\
+	    builtin_define ("__PIC__");				\
+	    builtin_define ("__pic__");				\
+	  }							\
+    }								\
+  while (0)
 
 #undef CPP_SPEC
-#define CPP_SPEC "%{pthread:-D_REENTRANT} %{pthreadT:-D_REENTRANT}"
+#define CPP_SPEC \
+  "-isystem /usr/gnu/include\
+ %{pthread:%{pthreadT:%e-pthread and -pthreadT are mutually exclusive}}\
+ %{pthread:-D_REENTRANT -D_THREAD_SAFE -D_PTHREADS95}\
+ %{pthreadT:-D_REENTRANT -D_THREAD_SAFE -D_PTHREADS95}"
+
+#undef LINK_SPEC
+#ifdef USE_GNU_LD
+#define LINK_SPEC "-m elf_i386_sysv5 %{!r:\
+  %{Wl,*:%*} %{YP,*} %{G:%{!shared:-shared}}\
+  %{shared:-shared %{rpath*} %{h*}\
+   %{static:%e-shared and -static are mutually exclusive}\
+   %{Bstatic:%e-shared and -Bstatic are mutually exclusive}\
+   %{dn:%e-shared and -dn are mutually exclusive}}\
+  %{pg:%e-pg not supported on this platform}\
+  %{p:%{pf:%e-p and -pf are mutually exclusive}}\
+  %{p:%{pl:%e-p and -pl are mutually exclusive}}\
+  %{pf:%{pl:%e-pf and -pl are mutually exclusive}}\
+  %{!shared:%{!static:%{!Bstatic:\
+   %{rdynamic:-export-dynamic}\
+   %{symbolic:-Bsymbolic} %{Bsymbolic:-Bsymbolic}}}}\
+  %{static:-static} %{Bstatic:-static}\
+  %{z*} %{R*}}"
+#else
+# define LINK_SPEC \
+ "%{pg:%e-pg not supported on this platform}\
+  %{p:%{pf:%e-p and -pf are mutually exclusive}}\
+  %{p:%{pl:%e-p and -pl are mutually exclusive}}\
+  %{pf:%{pl:%e-pf and -pl are mutually exclusive}}\
+  %{!r:%{Wl,*:%*} %{YP,*} %{YL,*} %{YU,*}\
+   %{!YP,*:%{p:-YP,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib}\
+  %{!p:-YP,/usr/ccs/lib:/usr/lib}}\
+  %{h*} %{static:-dn -Bstatic %{G:%e-G and -static are mutually exclusive}\
+   %{shared:%e-shared and -static are mutually exclusive}}\
+  %{shared:%{!G:-G -dy}} %{G:%{!shared:-G -dy}} %{shared:%{G:-G -dy}}\
+  %{symbolic:-Bsymbolic -G} %{z*} %{R*} %{Y*}\
+  %{Qn:} %{!Qy:-Qn} -z alt_resolve} -M scogcc.map%s"
+#endif
+
+/* Library spec. If we are not building a shared library, provide the
+   standard libraries, as per the system compiler.  */
+
+#undef LIB_SPEC
+#ifdef USE_GNU_LD
+# define LIB_SPEC \
+ "%{pthread:%{pthreadT:%e-pthread and -pthreadT are mutually exclusive}}\
+  %{shared:%{!G:pic/%{pthread:pthread/}%{pthreadT:pthread/}libgcc.a%s}}\
+  %{G:%{!shared:pic/%{pthread:pthread/}%{pthreadT:pthread/}libgcc.a%s}}\
+  %{shared:%{G:pic/%{pthread:pthread/}%{pthreadT:pthread/}libgcc.a%s}}\
+  --as-needed\
+  %{p:-lprof} %{pl:-lprof} %{pf:-lfprof}\
+  %{pthread:-lthread} %{pthreadT:-lthreadT}\
+  %{!shared:%{!symbolic:%{!G:-lc -lcrt\
+   %{p:-I /usr/ccs/lib/libp/libc.so.1}}}}"
+#else
+# define LIB_SPEC \
+ "%{pthread:%{pthreadT:%e-pthread and -pthreadT are mutually exclusive}}\
+  %{shared:%{!G:pic/%{pthread:pthread/}%{pthreadT:pthread/}libgcc.a%s}}\
+  %{shared:%{!G:pic/%{lpthread:pthread/}%{lpthreadT:pthread/}libgcc.a%s}}\
+  %{G:%{!shared:pic/%{pthread:pthread/}%{pthreadT:pthread/}libgcc.a%s}}\
+  %{G:%{!shared:pic/%{lpthread:pthread/}%{lpthreadT:pthread/}libgcc.a%s}}\
+  %{shared:%{G:pic/%{pthread:pthread/}%{pthreadT:pthread/}libgcc.a%s}}\
+  %{shared:%{G:pic/%{lpthread:pthread/}%{lpthreadT:pthread/}libgcc.a%s}}\
+  %{p:-lprof} %{pl:-lprof} %{pf:-lfprof}\
+  %{pthread:-lthread} %{pthreadT:-lthreadT}\
+  %{lpthread:-lthread} %{lpthreadT:-lthreadT}\
+  %{!shared:%{!symbolic:%{!G:-lc -lcrt\
+   %{p:-I /usr/ccs/lib/libp/libc.so.1}}}}"
+#endif
+
+#undef LIBGCC_SPEC
+#define LIBGCC_SPEC \
+ "%{!shared:%{!G:-lgcc}}"
+
+#undef THREAD_MODEL_SPEC
+#define THREAD_MODEL_SPEC \
+  "%{!pthread:%{!pthreadT:single}%{pthreadT:posix}}%{pthread:posix}"
+
+/* Handle special EH pointer encodings.  Absolute, pc-relative, and
+   indirect are handled automatically.  */
+#define ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX(FILE, ENCODING, SIZE, ADDR, DONE) \
+  do {									\
+    if ((SIZE) == 4 && ((ENCODING) & 0x70) == DW_EH_PE_datarel)		\
+      {									\
+        fputs (ASM_LONG, FILE);						\
+        assemble_name (FILE, XSTR (ADDR, 0));				\
+	fputs (((ENCODING) & DW_EH_PE_indirect ? "@GOT" : "@GOTOFF"), FILE); \
+        goto DONE;							\
+      }									\
+  } while (0)
+
+/* Used by crtstuff.c to initialize the base of data-relative relocations.
+   These are GOT relative on x86, so return the pic register.  */
+#ifdef __PIC__
+#define CRT_GET_RFIB_DATA(BASE)			\
+  {						\
+    register void *ebx_ __asm__("ebx");		\
+    BASE = ebx_;				\
+  }
+#else
+#define CRT_GET_RFIB_DATA(BASE)						\
+  __asm__ ("call\t.LPR%=\n"						\
+	   ".LPR%=:\n\t"						\
+	   "popl\t%0\n\t"						\
+	   /* Due to a GAS bug, this cannot use EAX.  That encodes	\
+	      smaller than the traditional EBX, which results in the	\
+	      offset being off by one.  */				\
+	   "addl\t$_GLOBAL_OFFSET_TABLE_+[.-.LPR%=],%0"			\
+	   : "=d"(BASE))
+#endif
+
Index: gcc/config/i386/t-sco5
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/t-sco5,v
retrieving revision 1.7
diff -u -3 -p -u -r1.7 t-sco5
--- gcc/config/i386/t-sco5	19 Apr 2003 21:23:19 -0000	1.7
+++ gcc/config/i386/t-sco5	13 Oct 2005 04:55:39 -0000
@@ -5,6 +5,7 @@ CRTSTUFF_T_CFLAGS   = -fPIC -fno-omit-fr
 
 MULTILIB_OPTIONS    = fPIC
 MULTILIB_DIRNAMES   = pic
+MULTILIB_EXCEPTIONS =
 MULTILIB_MATCHES    = fPIC=fpic
 MULTILIB_EXTRA_OPTS =
 
Index: gcc/config/i386/t-sysv5
===================================================================
RCS file: gcc/config/i386/t-sysv5
diff -N gcc/config/i386/t-sysv5
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gcc/config/i386/t-sysv5	13 Oct 2005 04:55:39 -0000
@@ -0,0 +1,21 @@
+# We multilib libgcc for -fPIC, to get real PIC code in it.
+# NOTE: We must use -fPIC on crt{begi,end}.o else we get an RTLD error
+# "cant set protections on segment of length blah at 0x8048000".
+CRTSTUFF_T_CFLAGS   = -fPIC -fno-omit-frame-pointer
+
+MULTILIB_OPTIONS    = fPIC pthread
+MULTILIB_DIRNAMES   = pic pthread
+MULTILIB_EXCEPTIONS =
+MULTILIB_MATCHES    = fPIC=fpic
+MULTILIB_EXTRA_OPTS =
+
+LIBGCC=stmp-multilib
+INSTALL_LIBGCC=install-multilib
+
+#
+# We need to copy in a special link editor map to deal with the linkonce
+# cruft.
+#
+scogcc.map: $(srcdir)/config/i386/scogcc.map
+	-rm -f $@
+	-cp -f $(srcdir)/config/i386/scogcc.map $@
Index: gcc/config/i386/unix.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/unix.h,v
retrieving revision 1.26
diff -u -3 -p -u -r1.26 unix.h
--- gcc/config/i386/unix.h	26 Sep 2003 20:46:47 -0000	1.26
+++ gcc/config/i386/unix.h	13 Oct 2005 04:55:39 -0000
@@ -57,7 +57,7 @@ Boston, MA 02111-1307, USA.  */
 #define BSS_SECTION_ASM_OP "\t.bss"
 
 /* Globalizing directive for a label.  */
-#define GLOBAL_ASM_OP ".globl "
+#define GLOBAL_ASM_OP "\t.globl\t"
 
 /* By default, target has a 80387, uses IEEE compatible arithmetic,
    and returns float values in the 387.  */
Index: gcc/config/i386/x-sco
===================================================================
RCS file: gcc/config/i386/x-sco
diff -N gcc/config/i386/x-sco
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gcc/config/i386/x-sco	13 Oct 2005 04:55:39 -0000
@@ -0,0 +1,4 @@
+host-sco.o : $(srcdir)/config/i386/host-sco.c $(CONFIG_H) $(SYSTEM_H) \
+  coretypes.h hosthooks.h hosthooks-def.h toplev.h diagnostic.h $(HOOKS_H)
+	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
+		$(srcdir)/config/i386/host-sco.c
Index: gcc/doc/install.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/install.texi,v
retrieving revision 1.336.2.20
diff -u -3 -p -u -r1.336.2.20 install.texi
--- gcc/doc/install.texi	4 Aug 2005 09:54:58 -0000	1.336.2.20
+++ gcc/doc/install.texi	13 Oct 2005 04:55:39 -0000
@@ -825,7 +825,7 @@ and want to choose one that is not found
 Same as @uref{#with-gnu-as,,@option{--with-gnu-as}}
 but for the linker.
 
-@item --with-ld=@var{pathname}
+@item @anchor{with-ld}--with-ld=@var{pathname}
 Same as @uref{#with-as,,@option{--with-as}}
 but for the linker.
 
@@ -2093,8 +2093,13 @@ Motorola 68HC11/68HC12---@uref{http://ww
 Development Tools for the Motorola 68HC11/68HC12}.
 
 @item
-@uref{http://www.sco.com/skunkware/devtools/index.html#gcc,,SCO
-OpenServer/Unixware}.
+@uref{ftp://ftp.sco.com/pub/openserver5/opensrc,,SCO OpenServer 5}.
+
+@item
+@uref{ftp://ftp.sco.com/pub/openserver6/600/opensrc,,SCO OpenServer 6}.
+
+@item
+@uref{ftp://ftp.sco.com/pub/unixware7/714/opensrc,,SCO UnixWare 7}.
 
 @item
 Solaris 2 (SPARC, Intel)---@uref{http://www.sunfreeware.com/,,Sunfreeware}.
@@ -2205,6 +2210,10 @@ GNU Compiler Collection on your machine.
 @item
 @uref{#ix86-x-sco32v5,,i?86-*-sco3.2v5*}
 @item
+@uref{#ix86-x-sysv5-6,,i?86-*-sysv5*6.0*}
+@item
+@uref{#ix86-x-sysv5,,i?86-*-sysv5}
+@item
 @uref{#ix86-x-solaris210,,i?86-*-solaris2.10}
 @item
 @uref{#ix86-x-udk,,i?86-*-udk}
@@ -2906,9 +2915,9 @@ may use either the UDK debugger or GDB t
 version of GCC@.
 
 GCC is now only supported on releases 5.0.4 and later, and requires that
-you install Support Level Supplement OSS646B or later, and Support Level
+you install Support Level Supplement OSS646C or later, and Support Level
 Supplement OSS631C or later.  If you are using release 5.0.7 of
-OpenServer, you must have at least the first maintenance pack installed
+OpenServer, you must have at least maintenance pack 3 installed
 (this includes the relevant portions of OSS646).  OSS646, also known as
 the ``Execution Environment Update'', provides updated link editors and
 assemblers, as well as updated standard C and math libraries.  The C
@@ -2922,17 +2931,191 @@ visit
 for the latest versions of these (and other potentially useful)
 supplements.
 
-Although there is support for using the native assembler, it is
-recommended that you configure GCC to use the GNU assembler.  You do
-this by using the flags
-@uref{./configure.html#with-gnu-as,,@option{--with-gnu-as}}.  You should
-use a modern version of GNU binutils.  Version 2.13.2.1 was used for all
-testing.  In general, only the @option{--with-gnu-as} option is tested.
-A modern bintuils (as well as a plethora of other development related
-GNU utilities) can be found in Support Level Supplement OSS658A, the
-``GNU Development Tools'' package.  See the SCO web and ftp sites for details.
-That package also contains the currently ``officially supported'' version of
-GCC, version 2.95.3.  It is useful for bootstrapping this version.
+There is only nominal support for using the native ELF assembler and
+link editor. Using them is highly discouraged. All testing and
+development is done using the GNU assembler and link editor. You will
+need a patched version of a modern GNU binutils (2.16.91.0.3 or later).
+Hopefully the required patches for SCO support will be accepted in time
+for the next release of binutils.
+
+To use the GNU assembler and link editor, you must configure GCC using
+the @uref{./configure.html#with-gnu-as,,@option{--with-gnu-as}} and
+@uref{./configure.html#with-gnu-ld,,@option{--with-gnu-ld}} options.
+If you intend creating a distribution package, you should also provide
+explicit paths to the assembler and link editor using the
+@uref{./configure.html#with-as,,@option{--with-as=@dots{}}} and
+@uref{./configure.html#with-ld,,@option{--with-ld=@dots{}}} options:
+
+@smallexample
+./configure --enable-multilib --with-gnu-as --with-gnu-ld \
+    --with-as=/usr/local/bin/gas --with-ld=/usr/local/bin/gld
+@end smallexample
+
+Suitable working versions of the GNU assembler and link editor, as well
+as a number of other useful development tools, can be found in
+Support Level Supplement OSS658, the ``GNU Development Tools'' supplement.
+See the SCO web and ftp sites for details.  This supplement also contains
+the latest ``officially'' supported version of the GNU Compiler Collection,
+2.95.3.  That version is useful for bootstrapping more modern versions
+of GCC.  It includes GNU make, which is required to build on this target.
+
+The standard system shell is severely limited, and will choke on some of
+the configure scripts. You should make sure you have the Extended Shells
+package installed, and use the GNU Bourne Again Shell (bash) for running
+the configure scripts:
+
+@smallexample
+SHELL=/usr/bin/bash CONFIG_SHELL=/usr/bin/bash ./configure ...
+SHELL=/usr/bin/bash CONFIG_SHELL=/usr/bin/bash gmake bootstrap
+@end smallexample
+
+You should also make sure you either use the GNU version of nm, or
+the @option{-p} option of the standard nm before running configure:
+
+@smallexample
+NM=gnm ./configure ...
+NM='nm -p' ./configure ...
+@end smallexample
+
+This target depends heavily on multilib support. It creates special
+libraries for both normal an PIC code.  Therefore, you should use the
+@option{--enable-multilib} option when configuring for this target.
+
+It is strongly recommended that you do not use shared libraries,
+and instead use the @option{--disable-shared} option when configuring
+GCC.  The libraries that GCC installs are relatively small, and the
+fractional savings in space are not worth the packaging difficulties
+that using shared libraries causes.  By default, both PIC and non-PIC
+versions of the libraries are created, so you can still use the GCC
+libraries when creating shared libraries of your own.
+
+If you want to run the testsuites (and it is highly recommended that you
+do), then in order to test all of the permutations of the libraries you
+need to pass extra arguments to DejaGNU.  For a full set of tests use:
+
+@smallexample
+gmake check RUNTESTFLAGS="--target_board 'unix@{-fPIC,@}'"
+@end smallexample
+
+The trailing comma is important. Do not omit it.
+
+@html
+<hr />
+@end html
+@heading @anchor{ix86-x-sysv5-6}i?86-*-sysv5*6.0*
+Use this for the SCO OpenServer Release 6 family of operating systems.
+
+This operating system is a merger between the SCO OpenServer and SCO
+UnixWare family of products.  From a development point of view, this
+is expressed as having to support two ABI's. By default, the native
+compiler uses the System V Release 5 (UDK) ABI.  Using the -Kosr flag,
+the native compiler can use the classic SCO OpenServer Release 5 ABI.
+GCC makes no attempt to emulate this behaviour.  GCC only supports the
+native, UDK ABI.  The OSR5 ABI is deprecated, and several very useful
+API's, such as threads and large file support are not available when
+using it.
+
+If you really wish to use the OSR5 ABI, you could either create a
+GCC cross-compiler or simply use the OSR5 port of GCC on an OSR5 box.
+OSR5 is supported, but only on OSR5, not as a compatibility flag on
+OSR6.
+
+The standard shell (@file{/bin/sh}) is severely brain-dead.  You
+stand almost no chance of compiling GCC with it.  You need to
+set both @env{SHELL} and @env{CONFIG_SHELL} to @file{/usr/bin/bash}
+before running @file{configure}.  After running @file{configure},
+ensure that those variables are set before you run @file{gmake}:
+
+@smallexample
+  SHELL=/usr/bin/bash CONFIG_SHELL=/usr/bin/bash ./configure ...
+  SHELL=/usr/bin/bash CONFIG_SHELL=/usr/bin/bash gmake bootstrap
+@end smallexample
+
+You should also make sure you either use the GNU version of nm, or
+the @option{-p} option of the standard nm before running configure:
+
+@smallexample
+NM=gnm ./configure ...
+NM='nm -p' ./configure ...
+@end smallexample
+
+You will also need to edit @file{/usr/lib/iconv/iconv_data}, and
+make sure that the line refering to GNU iconv is first in the file,
+not last, which is where it is by default.  If you fail to do this
+you will get error messages from @file{msgfmt} about incomplete
+unicode characters.
+
+Before starting the build you will also need to increase the kernel
+limit on the maximum command line length.  Certain parts of the
+GCC build produce extremely large command lines.  Use the following
+to raise the value from the default of 32K to 256K:
+
+@smallexample
+  /etc/conf/bin/idtune -m ARG_MAX 262144
+  /etc/conf/bin/idbuild
+  init 6
+@end smallexample
+
+This will change the limit and reboot your system.  Obviously, this
+must all be done as the super-user.
+
+It is strongly recommended that you do not use shared libraries,
+and instead use the @option{--disable-shared} option when configuring
+GCC.  The libraries that GCC installs are relatively small, and the
+fractional savings in space are not worth the packaging difficulties
+that using shared libraries causes.  By default, both PIC and non-PIC
+versions of the libraries are created, so you can still use the GCC
+libraries when creating shared libraries of your own.
+
+As with SCO OpenServer Release 5, it is recommended that you use the
+GNU assembler and link editor.  This is now the only configuration
+that is tested.  Only the link editor in Maintenance Pack 2 has
+the required support for this version of GCC, and that support is
+shaky at best.  You will need a modern version of GNU binutils,
+suitably patched.  Version 2.16.91.0.3 was the version used for
+developing and testing this target.
+
+To use the GNU assembler and link editor, you must configure GCC using
+the @uref{./configure.html#with-gnu-as,,@option{--with-gnu-as}} and
+@uref{./configure.html#with-gnu-ld,,@option{--with-gnu-ld}} options.
+If you intend creating a distribution package, you should also provide
+explicit paths to the assembler and link editor using the
+@uref{./configure.html#with-as,,@option{--with-as=@dots{}}} and
+@uref{./configure.html#with-ld,,@option{--with-ld=@dots{}}} options:
+
+@smallexample
+./configure --enable-multilib --with-gnu-as --with-gnu-ld \
+    --with-as=/usr/local/bin/gas --with-ld=/usr/local/bin/gld
+@end smallexample
+
+This target depends heavily on multilib support. It creates special
+libraries for both the threaded and non-threaded model, as well as for
+PIC.  Therefore, you should use the @option{--enable-multilib} option
+when configuring for this target.
+
+If you want to run the testsuites (and it is highly recommended that you
+do), then in order to test all of the permutations of the libraries you
+need to pass extra arguments to DejaGNU.  For a full set of tests use:
+
+@smallexample
+gmake check RUNTESTFLAGS="--target_board 'unix@{-fPIC,-pthread,@}'"
+@end smallexample
+
+The trailing comma is important. Do not omit it.
+
+@html
+<hr />
+@end html
+@heading @anchor{ix86-x-sysv5}i?86-*-sysv5
+Use this for the SCO UnixWare 7 family of operating systems. Configuration
+of this target is identical to
+@uref{#ix86-x-sysv6-6,,SCO OpenServer Release 6}, with one additional
+twist.  The standard iconv library doesnt work, and GNU iconv has not
+been integrated on this target.  Therefore, you should use the
+@option{--disable-nls} option when configuring GCC.
+
+The target name @samp{i?86-pc-sysv5} is the prefered target name, rather
+than the auto-detected name @samp{i?86-unknown-UnixWare*}.
 
 @html
 <hr />
@@ -2971,8 +3154,8 @@ command like this:
       --host=i686-pc-udk --target=i686-pc-udk --program-prefix=udk-
 @end smallexample
 
-@emph{You should substitute @samp{i686} in the above command with the appropriate
-processor for your host.}
+@emph{You should substitute @samp{i686} in the above command with the
+appropriate processor for your host.}
 
 After the usual @samp{make bootstrap} and
 @samp{make install}, you can then access the UDK-targeted GCC
@@ -2981,6 +3164,8 @@ example, to invoke the C compiler, you w
 They will coexist peacefully with any native-target GCC tools you may
 have installed.
 
+This target has not been tested in a long time and will soon be
+deprecated.
 
 @html
 <hr />


GCC testsuite changes:

2005-10-07  Kean Johnston  <jkj@sco.com>

	* g++.dg/opt/range-test-1.C: Prevent re-inclusion of system
	headers.
	* g++.old-deja/g++.law/profile1.C: No longer expect fail on OSR5.
	* gcc.c-torture/compile/2000804-1.c: Skip if using -fPIC.
	* gcc.dg/20020919-1.c: Ditto.
	* gcc.dg/clobbers.c: Ditto.
	* gcc.dg/i386-asm-3.c: Ditto.
	* gcc.c-torture/execute/builtins/strlen-3.c: Declare variables as
	static so the test works with -fPIC mode too. Based on comment in
	PR19231 by Pinski.
	* gcc.dg/nest.c: Adjust regexp for SCO to catch all failures.
	* lib/target-supports.exp: No SCO platforms support -pg (yet).

Index: gcc/testsuite/g++.dg/opt/range-test-1.C
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/g++.dg/opt/range-test-1.C,v
retrieving revision 1.1
diff -u -3 -p -u -r1.1 range-test-1.C
--- gcc/testsuite/g++.dg/opt/range-test-1.C	18 Jun 2004 23:15:59 -0000	1.1
+++ gcc/testsuite/g++.dg/opt/range-test-1.C	13 Oct 2005 04:55:40 -0000
@@ -2,9 +2,13 @@
 // { dg-do run } */
 // { dg-options "-O2" } */
 
+#ifndef __RANGE_TEST_HDR_INCL
+#define __RANGE_TEST_HDR_INCL
+/* Protect against fix-header weakness */
 #include <stdlib.h>
 #include <stdio.h>
 #include <limits.h>
+#endif
 
 #if (INT_MAX == 2147483647) && (INT_MIN == -2147483648) \
     && (SCHAR_MIN == -128) && (SCHAR_MAX == 127) \
Index: gcc/testsuite/g++.old-deja/g++.law/profile1.C
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/g++.old-deja/g++.law/profile1.C,v
retrieving revision 1.10
diff -u -3 -p -u -r1.10 profile1.C
--- gcc/testsuite/g++.old-deja/g++.law/profile1.C	3 Sep 2004 18:09:31 -0000	1.10
+++ gcc/testsuite/g++.old-deja/g++.law/profile1.C	13 Oct 2005 04:55:40 -0000
@@ -1,4 +1,4 @@
-// { dg-do run { xfail i[3456]86-*-sco3.2v5* } }
+// { dg-do run }
 // { dg-require-profiling "-pg" }
 // { dg-options "-pg" }
 // { dg-options "-pg -static" { target hppa*-*-hpux* } }
Index: gcc/testsuite/gcc.c-torture/compile/20000804-1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.c-torture/compile/20000804-1.c,v
retrieving revision 1.2
diff -u -3 -p -u -r1.2 20000804-1.c
--- gcc/testsuite/gcc.c-torture/compile/20000804-1.c	13 Jun 2003 05:40:59 -0000	1.2
+++ gcc/testsuite/gcc.c-torture/compile/20000804-1.c	13 Oct 2005 04:55:40 -0000
@@ -1,6 +1,7 @@
 /* This does not work on m68hc11 or h8300 due to the use of an asm
    statement to force a 'long long' (64-bits) to go in a register.  */
 /* { dg-do assemble { xfail m6811-*-* m6812-*-* h8300-*-* } } */
+/* { dg-skip-if "" { i?86-*-* } { "-fpic" "-fPIC" } { "" } } */
 
 /* Copyright (C) 2000, 2003 Free Software Foundation */
 __complex__ long long f ()
Index: gcc/testsuite/gcc.c-torture/execute/builtins/strlen-3.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.c-torture/execute/builtins/strlen-3.c,v
retrieving revision 1.1
diff -u -3 -p -u -r1.1 strlen-3.c
--- gcc/testsuite/gcc.c-torture/execute/builtins/strlen-3.c	15 Sep 2004 09:05:03 -0000	1.1
+++ gcc/testsuite/gcc.c-torture/execute/builtins/strlen-3.c	13 Oct 2005 04:55:40 -0000
@@ -7,9 +7,9 @@
 extern void abort (void);
 extern __SIZE_TYPE__ strlen (const char *);
 extern char *strcpy (char *, const char *);
-const char bar[] = "Hello, World!";
-const char baz[] = "hello, world?";
-const char larger[20] = "short string";
+static const char bar[] = "Hello, World!";
+static const char baz[] = "hello, world?";
+static const char larger[20] = "short string";
 extern volatile int inside_main;
 
 int l1 = 1;
Index: gcc/testsuite/gcc.dg/20020919-1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/20020919-1.c,v
retrieving revision 1.2
diff -u -3 -p -u -r1.2 20020919-1.c
--- gcc/testsuite/gcc.dg/20020919-1.c	2 Oct 2002 08:26:39 -0000	1.2
+++ gcc/testsuite/gcc.dg/20020919-1.c	13 Oct 2005 04:55:40 -0000
@@ -10,6 +10,7 @@
 
 /* { dg-do compile { target alpha-*-* cris-*-* i?86-*-* mmix-*-* powerpc-*-* rs6000-*-* x86_64-*-* } } */
 /* { dg-options "-O2" } */
+/* { dg-skip-if "" { i?86-*-* } { "-m64" "-fpic" "-fPIC" } { "" } } */
 
 /* Constructed examples; input/output (same register), output, input, and
    input and output (different registers).  */
Index: gcc/testsuite/gcc.dg/20040813-1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/20040813-1.c,v
retrieving revision 1.8
diff -u -3 -p -u -r1.8 20040813-1.c
--- gcc/testsuite/gcc.dg/20040813-1.c	15 Jan 2005 20:28:25 -0000	1.8
+++ gcc/testsuite/gcc.dg/20040813-1.c	13 Oct 2005 04:55:40 -0000
@@ -2,7 +2,7 @@
 /* Contributed by Devang Patel  <dpatel@apple.com>  */
 
 /* { dg-do compile } */
-/* { dg-skip-if "No stabs" { mmix-*-* *-*-aix* *-*-netware* alpha*-*-* hppa*64*-*-* ia64-*-* } { "*" } { "" } } */
+/* { dg-skip-if "No stabs" { mmix-*-* *-*-aix* *-*-netware* alpha*-*-* hppa*64*-*-* ia64-*-* *-*-sysv5* } { "*" } { "" } } */
 /* { dg-options "-gstabs" } */
 
 int
Index: gcc/testsuite/gcc.dg/assign-warn-3.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/assign-warn-3.c,v
retrieving revision 1.1
diff -u -3 -p -u -r1.1 assign-warn-3.c
--- gcc/testsuite/gcc.dg/assign-warn-3.c	8 Oct 2004 19:52:04 -0000	1.1
+++ gcc/testsuite/gcc.dg/assign-warn-3.c	13 Oct 2005 04:55:40 -0000
@@ -2,6 +2,7 @@
    functions: should not be errors with -pedantic-errors.  */
 /* Origin: Joseph Myers <jsm@polyomino.org.uk> */
 /* { dg-do compile } */
+/* { dg-skip-if "" { i?86-*-* } { "-fpic" "-fPIC" } { "" } } */
 /* { dg-options "-O3 -std=c99 -pedantic-errors" } */
 
 /* This is valid to execute, so maybe shouldn't warn at all.  */
Index: gcc/testsuite/gcc.dg/clobbers.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/clobbers.c,v
retrieving revision 1.3
diff -u -3 -p -u -r1.3 clobbers.c
--- gcc/testsuite/gcc.dg/clobbers.c	23 May 2000 19:30:44 -0000	1.3
+++ gcc/testsuite/gcc.dg/clobbers.c	13 Oct 2005 04:55:40 -0000
@@ -1,6 +1,7 @@
 /* Test asm clobbers on x86. */
 
 /* { dg-do run { target i?86-*-* } } */
+/* { dg-skip-if "" { i?86-*-* } { "-fpic" "-fPIC" } { "" } } */
 
 extern void abort (void);
 
Index: gcc/testsuite/gcc.dg/i386-asm-3.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/i386-asm-3.c,v
retrieving revision 1.1
diff -u -3 -p -u -r1.1 i386-asm-3.c
--- gcc/testsuite/gcc.dg/i386-asm-3.c	13 Sep 2004 09:05:31 -0000	1.1
+++ gcc/testsuite/gcc.dg/i386-asm-3.c	13 Oct 2005 04:55:40 -0000
@@ -1,6 +1,7 @@
 /* PR inline-asm/6806 */
 /* { dg-do run { target i?86-*-* } } */
 /* { dg-options "-O2" } */
+/* { dg-skip-if "" { i?86-*-* } { "-fpic" "-fPIC" } { "" } } */
 
 extern void abort (void);
 
Index: gcc/testsuite/gcc.dg/i386-cmov1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/i386-cmov1.c,v
retrieving revision 1.4
diff -u -3 -p -u -r1.4 i386-cmov1.c
--- gcc/testsuite/gcc.dg/i386-cmov1.c	8 Jun 2003 14:50:18 -0000	1.4
+++ gcc/testsuite/gcc.dg/i386-cmov1.c	13 Oct 2005 04:55:40 -0000
@@ -1,4 +1,5 @@
 /* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-skip-if "" { i?86-*-* } { "-fpic" "-fPIC" } { "" } } */
 /* { dg-options "-O2 -march=k8" } */
 /* { dg-final { scan-assembler "sar\[^\\n\]*magic_namea" } } */
 /* { dg-final { scan-assembler "sar\[^\\n\]*magic_nameb" } } */
Index: gcc/testsuite/gcc.dg/i386-mul.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/i386-mul.c,v
retrieving revision 1.2
diff -u -3 -p -u -r1.2 i386-mul.c
--- gcc/testsuite/gcc.dg/i386-mul.c	8 Jun 2003 14:50:18 -0000	1.2
+++ gcc/testsuite/gcc.dg/i386-mul.c	13 Oct 2005 04:55:40 -0000
@@ -1,4 +1,5 @@
 /* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-skip-if "" { i?86-*-* } { "-fpic" "-fPIC" } { "" } } */
 /* { dg-options "-O2 -march=k8" } */
 /* { dg-final { scan-assembler "and\[^\\n\]*magic" } } */
 
Index: gcc/testsuite/gcc.dg/i386-ssetype-1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/i386-ssetype-1.c,v
retrieving revision 1.6
diff -u -3 -p -u -r1.6 i386-ssetype-1.c
--- gcc/testsuite/gcc.dg/i386-ssetype-1.c	16 Jun 2004 22:57:02 -0000	1.6
+++ gcc/testsuite/gcc.dg/i386-ssetype-1.c	13 Oct 2005 04:55:40 -0000
@@ -1,4 +1,5 @@
 /* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-skip-if "" { i?86-*-* } { "-fpic" "-fPIC" } { "" } } */
 /* { dg-options "-O2 -msse2 -march=k8" } */
 /* { dg-final { scan-assembler "andpd\[^\\n\]*magic" } } */
 /* { dg-final { scan-assembler "andnpd\[^\\n\]*magic" } } */
Index: gcc/testsuite/gcc.dg/i386-ssetype-3.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/i386-ssetype-3.c,v
retrieving revision 1.7
diff -u -3 -p -u -r1.7 i386-ssetype-3.c
--- gcc/testsuite/gcc.dg/i386-ssetype-3.c	16 Jun 2004 22:57:02 -0000	1.7
+++ gcc/testsuite/gcc.dg/i386-ssetype-3.c	13 Oct 2005 04:55:40 -0000
@@ -1,4 +1,5 @@
 /* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-skip-if "" { i?86-*-* } { "-fpic" "-fPIC" } { "" } } */
 /* { dg-options "-O2 -msse2 -march=k8" } */
 /* { dg-final { scan-assembler "andps\[^\\n\]*magic" } } */
 /* { dg-final { scan-assembler "andnps\[^\\n\]*magic" } } */
Index: gcc/testsuite/gcc.dg/i386-ssetype-5.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/i386-ssetype-5.c,v
retrieving revision 1.3
diff -u -3 -p -u -r1.3 i386-ssetype-5.c
--- gcc/testsuite/gcc.dg/i386-ssetype-5.c	8 Jun 2003 14:50:18 -0000	1.3
+++ gcc/testsuite/gcc.dg/i386-ssetype-5.c	13 Oct 2005 04:55:40 -0000
@@ -1,4 +1,5 @@
 /* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-skip-if "" { i?86-*-* } { "-fpic" "-fPIC" } { "" } } */
 /* { dg-options "-O2 -msse2 -march=k8" } */
 /* { dg-final { scan-assembler "pand\[^\\n\]*magic" } } */
 /* { dg-final { scan-assembler "pandn\[^\\n\]*magic" } } */
Index: gcc/testsuite/gcc.dg/nest.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/nest.c,v
retrieving revision 1.13
diff -u -3 -p -u -r1.13 nest.c
--- gcc/testsuite/gcc.dg/nest.c	3 Sep 2004 18:09:33 -0000	1.13
+++ gcc/testsuite/gcc.dg/nest.c	13 Oct 2005 04:55:40 -0000
@@ -4,7 +4,7 @@
 /* { dg-options "-O2 -pg" } */
 /* { dg-options "-O2 -pg -static" { target hppa*-*-hpux* } } */
 /* { dg-error "profiler" "No profiler support" { target xstormy16-*-* } 0 } */
-/* { dg-error "-pg not supported" "Profiler support missing" { target *-*-sco3.2v5* } 0 } */
+/* { dg-error ".*not supported.*" "Profiler support missing" { target *-*-sco3.2v5* } 0 } */
 /* { dg-bogus "\[Uu\]nresolved symbol ._mcount" "Profiling unsupported" { xfail *-*-netware* } 0 } */
 
 extern void abort (void);
Index: gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-2.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-2.c,v
retrieving revision 1.2
diff -u -3 -p -u -r1.2 ssa-dce-2.c
--- gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-2.c	13 May 2004 06:40:52 -0000	1.2
+++ gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-2.c	13 Oct 2005 04:55:40 -0000
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-O1 -fdump-tree-dce3" } */
+/* { dg-skip-if "" { i?86-*-* } { "-fpic" "-fPIC" } { "" } } */
 
 /* We should notice constantness of this function. */
 int t(int a) 
Index: gcc/testsuite/gcc.target/i386/pr21291.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.target/i386/pr21291.c,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 pr21291.c
--- gcc/testsuite/gcc.target/i386/pr21291.c	5 Aug 2005 02:33:11 -0000	1.1.2.1
+++ gcc/testsuite/gcc.target/i386/pr21291.c	13 Oct 2005 04:55:41 -0000
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-O" } */
+/* { dg-skip-if "" { i?86-*-* } { "-fpic" "-fPIC" } { "" } } */
 
 typedef unsigned long bngdigit;
 typedef bngdigit *bng;
Index: gcc/testsuite/lib/target-supports.exp
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/lib/target-supports.exp,v
retrieving revision 1.40.4.5
diff -u -3 -p -u -r1.40.4.5 target-supports.exp
--- gcc/testsuite/lib/target-supports.exp	16 May 2005 00:55:20 -0000	1.40.4.5
+++ gcc/testsuite/lib/target-supports.exp	13 Oct 2005 04:55:41 -0000
@@ -271,6 +271,14 @@ proc check_profiling_available { test_wh
 	return 0
     }
 
+    # None of the SCO / System V Release 5 platforms support -pg yet.
+    if { ([istarget *-*-sco3.2v5*] 
+	  || [istarget *-*-sco5v6*]
+	  || [istarget *-*-sysv5*])
+    && ([lindex $test_what 1] == "-pg") } {
+	return 0
+    }
+
     # Now examine the cache variable.
     if {![info exists profiling_available_saved]} {
 	# Some targets don't have any implementation of __bb_init_func or are


libffi changes:

2005-10-07  Kean Johnston  <jkj@sco.com>

	* configure.ac (TARGET, TARGETDIR): Define for SCO platforms.

Index: libffi/configure.ac
===================================================================
RCS file: /cvs/gcc/gcc/libffi/configure.ac,v
retrieving revision 1.9.12.2
diff -u -3 -p -u -r1.9.12.2 configure.ac
--- libffi/configure.ac	19 Aug 2005 14:57:22 -0000	1.9.12.2
+++ libffi/configure.ac	13 Oct 2005 04:55:41 -0000
@@ -48,6 +48,7 @@ i*86-*-solaris*) TARGET=X86; TARGETDIR=x
 i*86-*-beos*) TARGET=X86; TARGETDIR=x86;;
 i*86-*-freebsd* | i*86-*-kfreebsd*-gnu) TARGET=X86; TARGETDIR=x86;;
 i*86-*-netbsdelf* | i*86-*-knetbsd*-gnu) TARGET=X86; TARGETDIR=x86;;
+i*86-*-sco3.2v5* | i*86-*-sco5v6* | i*86-*-sysv5*) TARGET=X86; TARGETDIR=x86 ;;
 i*86-*-win32*) TARGET=X86_WIN32; TARGETDIR=x86;;
 i*86-*-cygwin*) TARGET=X86_WIN32; TARGETDIR=x86;;
 i*86-*-mingw*) TARGET=X86_WIN32; TARGETDIR=x86;;


libgfortran changes:

2005-10-10  Kean Johnston  <jkj@sco.com>

	* acinclude.m4: Include ../config/mmap.m4 for better mmap test.
	* configure.ac: Use new GCC_FUNC_MMAP.

Index: libgfortran/acinclude.m4
===================================================================
RCS file: /cvs/gcc/gcc/libgfortran/acinclude.m4,v
retrieving revision 1.5.12.2
diff -u -3 -p -u -r1.5.12.2 acinclude.m4
--- libgfortran/acinclude.m4	7 Sep 2005 21:31:55 -0000	1.5.12.2
+++ libgfortran/acinclude.m4	13 Oct 2005 04:55:41 -0000
@@ -73,6 +73,7 @@ main ()
     fi
   fi])
 
+sinclude(../config/mmap.m4)
 sinclude(../libtool.m4)
 dnl The lines below arrange for aclocal not to bring an installed
 dnl libtool.m4 into aclocal.m4, while still arranging for automake to
Index: libgfortran/configure.ac
===================================================================
RCS file: /cvs/gcc/gcc/libgfortran/configure.ac,v
retrieving revision 1.20.12.9
diff -u -3 -p -u -r1.20.12.9 configure.ac
--- libgfortran/configure.ac	7 Sep 2005 21:31:56 -0000	1.20.12.9
+++ libgfortran/configure.ac	13 Oct 2005 04:55:42 -0000
@@ -153,7 +153,7 @@ esac
 AC_SUBST(extra_ldflags_libgfortran)
 
 AC_SYS_LARGEFILE
-AC_FUNC_MMAP
+GCC_FUNC_MMAP
 AC_TYPE_OFF_T
 
 # check header files


libjava changes:

2005-10-07  Kean Johnston  <jkj@sco.com>

	* configure.ac (THREADCSSFLAGS, THREADLDFLAGS, THREADSPEC): Define
	for System V R5 targets and SCO OpenServer 6.
	Make sure we check for -lsocket before checking for socket-related
	functions like inet_aton or gethostname.
	If we are using any form of threads, define GCJ_USING_THREADS. This
	allows us to conditionalize thread code for cases where GCC's
	threads model is `none'.
	Make sure we dont define HAVE_GETHOSTBYNAME_R if it is not correctly
	prototyped in netdb.h.
	Use new GCC_FUNC_MMAP for better mmap detection.
	* acinlude.m4: Include ../config/mmap.m4 for new GCC_FUNC_MMAP.
	* include/config.h.in (GCJ_USING_THREADS): Added.
	* posix-threads.cc: SVR5 is multilib'ed with -pthread, which means
	we have a library version that doesn't support threads. Therefore,
	detect this and conditionalize the whole file based on that.
	* gnu/java/net/natPlainSocketImplPosix.cc: Dont define BSD_COMP
	before including sys/ioctl.h on UnixWare / OpenServer 6.
	* java/net/natNetworkInterfacePosix.cc: Ditto.
	* gnu/java/nio/channels/natFileChannelPosix.cc: Ditto.
	Make sure we #undef open on UnixWare / OpenServer 6, as the
	standard header files will have mapped this to open64 if compiling
	with LFS enabled.
	* java/io/natFilePosix.cc: Set a resonable default for MAXPATHLEN
	if one wasn't supplied by system headers.
	Undefine HAVE_READDIR_R on SCO OpenServer 5.
	* java/lang/natPosixProcess.cc: Stub out threads-related calls if
	we are not building a library that uses/supports threads.
	* deplist.sed: New file.
	* Makefile.am: Use deplist.sed rather than trying to construct the
	sed script on the fly with echo, which has all kinds of dependencies
	on how the host echo behaves.
	* Makefile.in: Regenerated.
Index: libjava/Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libjava/Makefile.am,v
retrieving revision 1.455.2.15
diff -u -3 -p -u -r1.455.2.15 Makefile.am
--- libjava/Makefile.am	10 Oct 2005 01:12:14 -0000	1.455.2.15
+++ libjava/Makefile.am	13 Oct 2005 04:55:43 -0000
@@ -267,10 +267,8 @@ EXTRA_DIST = $(all_java_source_files)
 # recompiles to native code.
 Makefile.deps: $(srcdir)/Makefile.in
 	@: $(call write_entries_to_file,$(all_java_source_files),files.tmplist)
-	echo 's,^\(.*\)/\([^/]*\)\.java$$,@1.list: &\' | sed 's/@/\\/g' > tmpsed
-	echo '@1/@2.class: @1.stamp,' | sed 's/@/\\/g' >> tmpsed
-	sed -ftmpsed files.tmplist > Makefile.deps
-	rm files.tmplist tmpsed
+	sed -f$(srcdir)/deplist.sed files.tmplist > Makefile.deps
+	rm files.tmplist
 
 all_native_compiled_dirs = $(sort $(patsubst %/, %, $(dir $(all_native_compiled_source_files))))
 all_java_dirs = $(sort $(patsubst %/, %, $(dir $(all_java_source_files))))
Index: libjava/Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/libjava/Makefile.in,v
retrieving revision 1.485.2.15
diff -u -3 -p -u -r1.485.2.15 Makefile.in
--- libjava/Makefile.in	10 Oct 2005 01:12:14 -0000	1.485.2.15
+++ libjava/Makefile.in	13 Oct 2005 04:55:44 -0000
@@ -6154,10 +6154,8 @@ uninstall-info: uninstall-info-recursive
 # recompiles to native code.
 Makefile.deps: $(srcdir)/Makefile.in
 	@: $(call write_entries_to_file,$(all_java_source_files),files.tmplist)
-	echo 's,^\(.*\)/\([^/]*\)\.java$$,@1.list: &\' | sed 's/@/\\/g' > tmpsed
-	echo '@1/@2.class: @1.stamp,' | sed 's/@/\\/g' >> tmpsed
-	sed -ftmpsed files.tmplist > Makefile.deps
-	rm files.tmplist tmpsed
+	sed -f$(srcdir)/deplist.sed files.tmplist > Makefile.deps
+	rm files.tmplist
 
 # Include automatically generated dependencies between Java source files.
 -include Makefile.deps $(all_java_deps_files)
Index: libjava/acinclude.m4
===================================================================
RCS file: /cvs/gcc/gcc/libjava/Attic/acinclude.m4,v
retrieving revision 1.31
diff -u -3 -p -u -r1.31 acinclude.m4
--- libjava/acinclude.m4	23 Sep 2004 01:14:00 -0000	1.31
+++ libjava/acinclude.m4	13 Oct 2005 04:55:44 -0000
@@ -1,4 +1,5 @@
 m4_include(../config/no-executables.m4)
+m4_include(../config/mmap.m4)
 
 dnl The lines below arrange for aclocal not to bring libtool.m4
 dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
Index: libjava/configure.ac
===================================================================
RCS file: /cvs/gcc/gcc/libjava/configure.ac,v
retrieving revision 1.19.2.5
diff -u -3 -p -u -r1.19.2.5 configure.ac
--- libjava/configure.ac	17 Aug 2005 12:56:57 -0000	1.19.2.5
+++ libjava/configure.ac	13 Oct 2005 04:55:45 -0000
@@ -633,6 +633,7 @@ THREADINCS=
 THREADDEPS=
 THREADH=
 THREADSPEC=
+using_threads=1
 case "$THREADS" in
  posix)
     case "$host" in
@@ -658,6 +659,17 @@ case "$THREADS" in
 	THREADLDFLAGS=-pthread
 	THREADSPEC=-lc_r
 	;;
+     *-*-sysv5* | *-*-sco5v6*)
+	# The only way we get here is if -pthread was specified on the
+	# command line, and the specs file in the main compiler driver
+	# will already know to insert the threads library in the right
+	# place. However, we err on the side of caution and specify it
+	# anyway. The worst that happens is we get two -pthread command
+	# line arguments. I can deal with that.
+	THREADCXXFLAGS=-pthread
+	THREADLDFLAGS=-pthread
+	THREADSPEC='%{!pthread:%{!shared:%eYou must specify -pthread when linking}}'
+	;;
      alpha*-dec-osf*)
 	THREADCXXFLAGS=-pthread
 	# boehm-gc needs some functions from librt, so link that too.
@@ -688,7 +700,18 @@ case "$THREADS" in
     ;;
 
  none)
+    using_threads=0
     THREADH=no-threads.h
+    case "$host" in
+      *-*-sysv5* | *-*-sco5v6*)
+	# This may seem counter-intuitive, specifying -pthread for the
+	# non-threaded case, but it is requires for natPosixProcess.cc
+	# to link correctly.
+	THREADCXXFLAGS=-pthread
+	THREADLDFLAGS=-pthread
+	THREADSPEC='%{!pthread:%{!shared:%eYou must specify -pthread when linking}}'
+	;;
+    esac
     ;;
 esac
 AC_CONFIG_LINKS(include/java-threads.h:include/$THREADH)
@@ -698,6 +721,11 @@ AC_SUBST(THREADDEPS)
 AC_SUBST(THREADSPEC)
 AC_SUBST(THREADLDFLAGS)
 AC_SUBST(THREADCXXFLAGS)
+
+if test "x$using_threads" = "x1"; then
+  AC_DEFINE(GCJ_USING_THREADS, 1, [Define if using any form of threads])
+fi
+
 AM_CONDITIONAL(USING_POSIX_THREADS, test "$THREADS" = posix)
 AM_CONDITIONAL(USING_WIN32_THREADS, test "$THREADS" = win32)
 AM_CONDITIONAL(USING_NO_THREADS, test "$THREADS" = none)
@@ -748,6 +776,57 @@ if test "x${with_newlib}" = "xyes"; then
    AC_DEFINE(NO_GETUID, 1, [Define if getuid() and friends are missing.])
    PLATFORMNET=NoNet
 else
+   # Some library-finding code we stole from Tcl.
+   #--------------------------------------------------------------------
+   #	Check for the existence of the -lsocket and -lnsl libraries.
+   #	The order here is important, so that they end up in the right
+   #	order in the command line generated by make.  Here are some
+   #	special considerations:
+   #	1. Use "connect" and "accept" to check for -lsocket, and
+   #	   "gethostbyname" to check for -lnsl.
+   #	2. Use each function name only once:  can't redo a check because
+   #	   autoconf caches the results of the last check and won't redo it.
+   #	3. Use -lnsl and -lsocket only if they supply procedures that
+   #	   aren't already present in the normal libraries.  This is because
+   #	   IRIX 5.2 has libraries, but they aren't needed and they're
+   #	   bogus:  they goof up name resolution if used.
+   #	4. On some SVR4 systems, can't use -lsocket without -lnsl too.
+   #	   To get around this problem, check for both libraries together
+   #	   if -lsocket doesn't work by itself.
+   #--------------------------------------------------------------------
+
+   AC_CACHE_CHECK([for socket libraries], gcj_cv_lib_sockets,
+    [gcj_cv_lib_sockets=
+     gcj_checkBoth=0
+     unset ac_cv_func_connect
+     AC_CHECK_FUNC(connect, gcj_checkSocket=0, gcj_checkSocket=1)
+     if test "$gcj_checkSocket" = 1; then
+	 unset ac_cv_func_connect
+	 AC_CHECK_LIB(socket, main, gcj_cv_lib_sockets="-lsocket",
+		      gcj_checkBoth=1)
+     fi
+     if test "$gcj_checkBoth" = 1; then
+	 gcj_oldLibs=$LIBS
+	 LIBS="$LIBS -lsocket -lnsl"
+	 unset ac_cv_func_accept
+	 AC_CHECK_FUNC(accept,
+		       [gcj_checkNsl=0
+			gcj_cv_lib_sockets="-lsocket -lnsl"])
+	 unset ac_cv_func_accept
+	 LIBS=$gcj_oldLibs
+     fi
+     unset ac_cv_func_gethostbyname
+     gcj_oldLibs=$LIBS
+     LIBS="$LIBS $gcj_cv_lib_sockets"
+     AC_CHECK_FUNC(gethostbyname, ,
+		   [AC_CHECK_LIB(nsl, main,
+				 [gcj_cv_lib_sockets="$gcj_cv_lib_sockets -lnsl"])])
+     unset ac_cv_func_gethostbyname
+     LIBS=$gcj_oldLIBS
+   ])
+   LIBS="$LIBS $gcj_cv_lib_sockets"
+   SYSTEMSPEC="$SYSTEMSPEC $gcj_cv_lib_sockets"
+
    AC_CHECK_FUNCS([strerror ioctl select fstat open fsync sleep opendir \
                    gmtime_r localtime_r readdir_r getpwuid_r getcwd \
 		   access stat mkdir rename rmdir unlink realpath utime chmod \
@@ -806,18 +885,24 @@ else
    AM_LC_MESSAGES
    AC_STRUCT_TIMEZONE
 
-   AC_CHECK_FUNCS(gethostbyname_r, [
-     AC_DEFINE(HAVE_GETHOSTBYNAME_R, 1,
-       [Define if you have the 'gethostbyname_r' function.])
-     # There are two different kinds of gethostbyname_r.
-     # We look for the one that returns `int'.
-     # Hopefully this check is robust enough.
-     AC_EGREP_HEADER(int.*gethostbyname_r, netdb.h, [
-       AC_DEFINE(GETHOSTBYNAME_R_RETURNS_INT, 1, [Define if gethostbyname_r returns 'int'.])])
+   # FIXME: libjava source code expects to find a prototype for
+   # gethostbyname_r in netdb.h.  The outer check ensures that
+   # HAVE_GETHOSTBYNAME_R will not be defined if the prototype fails
+   # to exist where expected.  (The root issue: AC_CHECK_FUNCS assumes C
+   # linkage check is enough, yet C++ code requires proper prototypes.)
+   AC_EGREP_HEADER(gethostbyname_r, netdb.h, [
+     AC_CHECK_FUNCS(gethostbyname_r, [
+       AC_DEFINE(HAVE_GETHOSTBYNAME_R, 1,
+         [Define if you have the 'gethostbyname_r' function.])
+       # There are two different kinds of gethostbyname_r.
+       # We look for the one that returns `int'.
+       # Hopefully this check is robust enough.
+       AC_EGREP_HEADER(int.*gethostbyname_r, netdb.h, [
+         AC_DEFINE(GETHOSTBYNAME_R_RETURNS_INT, 1, [Define if gethostbyname_r returns 'int'.])])
 
-     case " $GCINCS " in
-     *" -D_REENTRANT "*) ;;
-     *)
+       case " $GCINCS " in
+       *" -D_REENTRANT "*) ;;
+       *)
 	dnl On DU4.0, gethostbyname_r is only declared with -D_REENTRANT
 	AC_CACHE_CHECK([whether gethostbyname_r declaration requires -D_REENTRANT],
 	[libjava_cv_gethostbyname_r_needs_reentrant],
@@ -837,22 +922,23 @@ else
 	if test "x$libjava_cv_gethostbyname_r_needs_reentrant" = xyes; then
 	  AC_DEFINE(_REENTRANT, 1, [Required define if using POSIX threads])
 	fi
-     ;;
-     esac
+       ;;
+       esac
 
-     AC_CACHE_CHECK([for struct hostent_data],
-	[libjava_cv_struct_hostent_data], [dnl
-	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+       AC_CACHE_CHECK([for struct hostent_data],
+	  [libjava_cv_struct_hostent_data], [dnl
+	  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 #if GETHOSTBYNAME_R_NEEDS_REENTRANT && !defined(_REENTRANT)
 # define _REENTRANT 1
 #endif
 #include <netdb.h>]], [[struct hostent_data data;]])],
 	  [libjava_cv_struct_hostent_data=yes],
 	  [libjava_cv_struct_hostent_data=no])])
-     if test "x$libjava_cv_struct_hostent_data" = xyes; then
-       AC_DEFINE(HAVE_STRUCT_HOSTENT_DATA, 1,
-         [Define if struct hostent_data is defined in netdb.h])
-     fi
+       if test "x$libjava_cv_struct_hostent_data" = xyes; then
+         AC_DEFINE(HAVE_STRUCT_HOSTENT_DATA, 1,
+           [Define if struct hostent_data is defined in netdb.h])
+       fi
+     ])
    ])
 
    # FIXME: libjava source code expects to find a prototype for
@@ -936,56 +1022,6 @@ else
    AC_CHECK_LIB(dl, dlopen, [
        AC_DEFINE(HAVE_DLOPEN, 1, [Define if dlopen is available])])
 
-   # Some library-finding code we stole from Tcl.
-   #--------------------------------------------------------------------
-   #	Check for the existence of the -lsocket and -lnsl libraries.
-   #	The order here is important, so that they end up in the right
-   #	order in the command line generated by make.  Here are some
-   #	special considerations:
-   #	1. Use "connect" and "accept" to check for -lsocket, and
-   #	   "gethostbyname" to check for -lnsl.
-   #	2. Use each function name only once:  can't redo a check because
-   #	   autoconf caches the results of the last check and won't redo it.
-   #	3. Use -lnsl and -lsocket only if they supply procedures that
-   #	   aren't already present in the normal libraries.  This is because
-   #	   IRIX 5.2 has libraries, but they aren't needed and they're
-   #	   bogus:  they goof up name resolution if used.
-   #	4. On some SVR4 systems, can't use -lsocket without -lnsl too.
-   #	   To get around this problem, check for both libraries together
-   #	   if -lsocket doesn't work by itself.
-   #--------------------------------------------------------------------
-
-   AC_CACHE_CHECK([for socket libraries], gcj_cv_lib_sockets,
-    [gcj_cv_lib_sockets=
-     gcj_checkBoth=0
-     unset ac_cv_func_connect
-     AC_CHECK_FUNC(connect, gcj_checkSocket=0, gcj_checkSocket=1)
-     if test "$gcj_checkSocket" = 1; then
-	 unset ac_cv_func_connect
-	 AC_CHECK_LIB(socket, main, gcj_cv_lib_sockets="-lsocket",
-		      gcj_checkBoth=1)
-     fi
-     if test "$gcj_checkBoth" = 1; then
-	 gcj_oldLibs=$LIBS
-	 LIBS="$LIBS -lsocket -lnsl"
-	 unset ac_cv_func_accept
-	 AC_CHECK_FUNC(accept,
-		       [gcj_checkNsl=0
-			gcj_cv_lib_sockets="-lsocket -lnsl"])
-	 unset ac_cv_func_accept
-	 LIBS=$gcj_oldLibs
-     fi
-     unset ac_cv_func_gethostbyname
-     gcj_oldLibs=$LIBS
-     LIBS="$LIBS $gcj_cv_lib_sockets"
-     AC_CHECK_FUNC(gethostbyname, ,
-		   [AC_CHECK_LIB(nsl, main,
-				 [gcj_cv_lib_sockets="$gcj_cv_lib_sockets -lnsl"])])
-     unset ac_cv_func_gethostbyname
-     LIBS=$gcj_oldLIBS
-   ])
-   SYSTEMSPEC="$SYSTEMSPEC $gcj_cv_lib_sockets"
-
    if test "$with_system_zlib" = yes; then
       AC_CHECK_LIB(z, deflate, ZLIBSPEC=-lz, ZLIBSPEC=)
    fi
@@ -1285,7 +1321,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#in
           [AC_MSG_RESULT(no)])])])
 
 AC_FUNC_ALLOCA
-AC_FUNC_MMAP
+GCC_FUNC_MMAP
 
 AC_CHECK_PROGS(PERL, perl, false)
 
Index: libjava/deplist.sed
===================================================================
RCS file: libjava/deplist.sed
diff -N libjava/deplist.sed
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ libjava/deplist.sed	13 Oct 2005 04:55:45 -0000
@@ -0,0 +1,2 @@
+s,^\(.*\)/\([^/]*\)\.java$,\1.list: &\
+\1/\2.class: \1.stamp,
Index: libjava/posix-threads.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/posix-threads.cc,v
retrieving revision 1.36.2.1
diff -u -3 -p -u -r1.36.2.1 posix-threads.cc
--- libjava/posix-threads.cc	8 Jul 2005 13:56:07 -0000	1.36.2.1
+++ libjava/posix-threads.cc	13 Oct 2005 04:55:45 -0000
@@ -11,6 +11,12 @@ details.  */
 // TO DO:
 // * Document signal handling limitations
 
+// For System V Release 5, make this entire file a no-op if we are not
+// compiling a threads-aware version of the library. The library is
+// multilib'ed to support both threads and non-threads.
+#if !defined(__UNIXWARE__) && !defined(__OPENSERVER__) \
+	|| defined(_THREAD_SAFE)
+
 #include <config.h>
 
 // If we're using the Boehm GC, then we need to override some of the
@@ -481,3 +487,5 @@ _Jv_ThreadSelf_out_of_line(volatile self
 }
 
 #endif /* SLOW_PTHREAD_SELF */
+
+#endif /* _THREAD_SAFE || !UNIXWARE && !OPENSERVER */
Index: libjava/gnu/java/net/natPlainSocketImplPosix.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/java/net/natPlainSocketImplPosix.cc,v
retrieving revision 1.11.6.2
diff -u -3 -p -u -r1.11.6.2 natPlainSocketImplPosix.cc
--- libjava/gnu/java/net/natPlainSocketImplPosix.cc	6 Jun 2005 06:17:53 -0000	1.11.6.2
+++ libjava/gnu/java/net/natPlainSocketImplPosix.cc	13 Oct 2005 04:55:45 -0000
@@ -9,7 +9,7 @@ details.  */
 #include <config.h>
 #include <platform.h>
 
-#ifdef HAVE_SYS_IOCTL_H
+#if defined(HAVE_SYS_IOCTL_H) && !defined(__UNIXWARE__) && !defined(_SCO_DS)
 #define BSD_COMP /* Get FIONREAD on Solaris2. */
 #include <sys/ioctl.h>
 #endif
Index: libjava/gnu/java/nio/channels/natFileChannelPosix.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/java/nio/channels/natFileChannelPosix.cc,v
retrieving revision 1.6
diff -u -3 -p -u -r1.6 natFileChannelPosix.cc
--- libjava/gnu/java/nio/channels/natFileChannelPosix.cc	12 Nov 2004 19:15:27 -0000	1.6
+++ libjava/gnu/java/nio/channels/natFileChannelPosix.cc	13 Oct 2005 04:55:45 -0000
@@ -21,6 +21,9 @@ details.  */
 #include <errno.h>
 #include <fcntl.h>
 #include <stdio.h>
+#if defined(__UNIXWARE__) || defined(__OPENSERVER__)
+#undef open
+#endif
 #include <string.h>
 #include <sys/stat.h>
 #include <sys/param.h>
@@ -44,7 +47,7 @@ details.  */
 #include <java/nio/channels/FileLock.h>
 #include <gnu/java/nio/channels/FileChannelImpl.h>
 
-#ifdef HAVE_SYS_IOCTL_H
+#if defined(HAVE_SYS_IOCTL_H) && !defined(__UNIXWARE__) && !defined(_SCO_DS)
 #define BSD_COMP /* Get FIONREAD on Solaris2. */
 #include <sys/ioctl.h>
 #endif
Index: libjava/include/config.h.in
===================================================================
RCS file: /cvs/gcc/gcc/libjava/include/config.h.in,v
retrieving revision 1.59.10.1
diff -u -3 -p -u -r1.59.10.1 config.h.in
--- libjava/include/config.h.in	2 Apr 2005 02:30:40 -0000	1.59.10.1
+++ libjava/include/config.h.in	13 Oct 2005 04:55:45 -0000
@@ -33,6 +33,9 @@
 /* Short GCJ version ID */
 #undef GCJVERSION
 
+/* Define if using any form of threads */
+#undef GCJ_USING_THREADS
+
 /* Define if gethostbyaddr_r returns 'int'. */
 #undef GETHOSTBYADDR_R_RETURNS_INT
 
Index: libjava/java/io/natFilePosix.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/io/natFilePosix.cc,v
retrieving revision 1.5
diff -u -3 -p -u -r1.5 natFilePosix.cc
--- libjava/java/io/natFilePosix.cc	12 Sep 2003 01:08:18 -0000	1.5
+++ libjava/java/io/natFilePosix.cc	13 Oct 2005 04:55:45 -0000
@@ -26,6 +26,10 @@ details.  */
 #include <string.h>
 #include <utime.h>
 
+#ifndef MAXPATHLEN
+# define MAXPATHLEN	1024		/* Reasonable default */
+#endif
+
 #include <gcj/cni.h>
 #include <jvm.h>
 #include <java/io/File.h>
@@ -36,6 +40,10 @@ details.  */
 #include <java/io/FileFilter.h>
 #include <java/lang/System.h>
 
+#if (_SCO_DS - 0 == 1)
+# undef HAVE_READDIR_R
+#endif
+
 jboolean
 java::io::File::_access (jint query)
 {
Index: libjava/java/lang/natPosixProcess.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/lang/natPosixProcess.cc,v
retrieving revision 1.21
diff -u -3 -p -u -r1.21 natPosixProcess.cc
--- libjava/java/lang/natPosixProcess.cc	14 Sep 2004 20:09:31 -0000	1.21
+++ libjava/java/lang/natPosixProcess.cc	13 Oct 2005 04:55:45 -0000
@@ -22,7 +22,10 @@ details.  */
 #include <stdlib.h>
 #include <stdio.h>
 #include <unistd.h>
+
+#ifdef GCJ_USING_THREADS
 #include <pthread.h>
+#endif
 
 #include <gcj/cni.h>
 #include <jvm.h>
@@ -102,7 +105,11 @@ java::lang::ConcreteProcess$ProcessManag
 {
   using namespace java::lang;
   // Remenber our PID so other threads can kill us.
+#if defined(GCJ_USING_THREADS) 
   reaperPID = (jlong) pthread_self ();
+#else
+  reaperPID = (jlong) getpid();
+#endif
 
   // SIGCHLD is blocked in all threads in posix-threads.cc.
   // Setup the SIGCHLD handler.
@@ -128,7 +135,11 @@ java::lang::ConcreteProcess$ProcessManag
 {
   // Wait for SIGCHLD
   sigset_t mask;
+#ifdef GCJ_USING_THREADS
   pthread_sigmask (0, NULL, &mask);
+#else
+  sigprocmask (0, NULL, &mask);
+#endif
   sigdelset (&mask, SIGCHLD);
 
   // Use sigsuspend() instead of sigwait() as sigwait() doesn't play
@@ -192,7 +203,11 @@ error:
 void
 java::lang::ConcreteProcess$ProcessManager::signalReaper ()
 {
+#ifdef GCJ_USING_THREADS
   int c = pthread_kill ((pthread_t) reaperPID, SIGCHLD);
+#else
+  int c = kill ((pid_t)reaperPID, SIGCHLD);
+#endif
   if (c == 0)
     return;
   // pthread_kill() failed.
Index: libjava/java/net/natNetworkInterfacePosix.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/net/Attic/natNetworkInterfacePosix.cc,v
retrieving revision 1.1
diff -u -3 -p -u -r1.1 natNetworkInterfacePosix.cc
--- libjava/java/net/natNetworkInterfacePosix.cc	18 Mar 2003 06:01:16 -0000	1.1
+++ libjava/java/net/natNetworkInterfacePosix.cc	13 Oct 2005 04:55:45 -0000
@@ -27,10 +27,13 @@ details.  */
 #ifdef HAVE_NETDB_H
 #include <netdb.h>
 #endif
-#ifdef HAVE_SYS_IOCTL_H
+#if defined(HAVE_SYS_IOCTL_H) && !defined(__UNIXWARE__) && !defined(_SCO_DS)
 #define BSD_COMP /* Get FIONREAD on Solaris2. */
 #include <sys/ioctl.h>
 #endif
+#if defined(__UNIXWARE__) || (_SCO_DS - 0 >= 2)
+#include <sys/sockio.h>
+#endif
 #ifdef HAVE_NET_IF_H
 #include <net/if.h>
 #endif


libstdc++ changes:

2005-10-07  Kean Johnston  <jkj@sco.com>

	* acinclude.m4 (GLIBCXX_ENABLE_THREADS): Use AC_EGREP_CPP and a
	propper test case instead of grep.
	Include ../config/mmap.m4 for GCC_FUNC_MMAP.
	* configure.ac: Use GCC_FUNC_MMAP for better mmap detection.
	* config/io/basic_file_stdio.cc:  Dont define BSD_COMP before
	including sys/ioctl.h on UnixWare / OpenServer 6.
	* include/Makefile.am (thread_host_headers): Also include
	gthr-posix95.h and gthr-solaris.h
	* include/Makefile.in: Ditto.
	* include/c_std/std_cstring.h (memchr, strchr, strpbrk, strrchr,
	strstr): Explicitly cast return values to avoid picking up const
	versions of the inline functions from system headers.
	* include/c_std/std_cwchar.h (wcschr, wcspbrk, wcsrchr, wcsstr,
	wmemchr): Ditto.
	* testsuite/21_strings/c_strings/wchar_t/1.cc: Explicitly cast
	to (wchar_t*) when target type is wchar_t*. Only makes a difference
	on targets which also declare const wchar_t* versions of functions
	like wmemchr(), and harmless on all others.
	* testsuite/21_strings/c_strings/wchar_t/2.cc: Ditto.
	* testsuite/26_numerics/cmath/c99_classification_macros_c.cc:
	XFAIL for SCO systems.

Index: libstdc++-v3/acinclude.m4
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/acinclude.m4,v
retrieving revision 1.307.2.4
diff -u -3 -p -u -r1.307.2.4 acinclude.m4
--- libstdc++-v3/acinclude.m4	23 Jun 2005 09:23:59 -0000	1.307.2.4
+++ libstdc++-v3/acinclude.m4	13 Oct 2005 04:55:47 -0000
@@ -147,6 +147,7 @@ AC_DEFUN([GLIBCXX_CONFIGURE], [
 
 m4_include([linkage.m4])
 m4_include([../config/no-executables.m4])
+m4_include([../config/mmap.m4])
 
 
 dnl
@@ -1867,13 +1868,24 @@ AC_DEFUN([GLIBCXX_ENABLE_THREADS], [
 
   glibcxx_thread_h=gthr-$target_thread_file.h
 
-  dnl Check for __GTHREADS define.
+  dnl A simple grep through the file is naiive. It eliminates, for example,
+  dnl the possibility for gthr-sysv5.h to conditionally include a header
+  dnl file that is not threaded, based on compiler-asserted macros. So
+  dnl dont use grep, use AC_EGREP_CPP instead.
   gthread_file=${toplevel_srcdir}/gcc/${glibcxx_thread_h}
-  if grep __GTHREADS $gthread_file >/dev/null 2>&1 ; then
-    enable_thread=yes
-  else
-   enable_thread=no
-  fi
+  save_cppflags=$CPPFLAGS
+  CPPFLAGS="-I ${toplevel_srcdir}/gcc $CPPFLAGS"
+  AC_EGREP_CPP([yes],[
+#include "$gthread_file"
+#if (__GTHREADS - 0 >= 1)
+yes
+#else
+no
+#endif],[enable_thread=yes],[enable_thread=no])
+  CPPFLAGS=$save_cppflags
+
+  AC_MSG_CHECKING([if threads are to be supported])
+  AC_MSG_RESULT([$enable_thread])
 
   AC_SUBST(glibcxx_thread_h)
 ])
Index: libstdc++-v3/configure.ac
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/configure.ac,v
retrieving revision 1.32.10.4
diff -u -3 -p -u -r1.32.10.4 configure.ac
--- libstdc++-v3/configure.ac	11 Oct 2005 06:22:08 -0000	1.32.10.4
+++ libstdc++-v3/configure.ac	13 Oct 2005 04:55:49 -0000
@@ -152,7 +152,7 @@ if $GLIBCXX_IS_NATIVE; then
     ],
     [AC_DEFINE(HAVE_SIGSETJMP, 1, [Define if sigsetjmp is available.])])
 
-  AC_FUNC_MMAP
+  GCC_FUNC_MMAP
 
 else
 
Index: libstdc++-v3/config/io/basic_file_stdio.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/config/io/basic_file_stdio.cc,v
retrieving revision 1.35
diff -u -3 -p -u -r1.35 basic_file_stdio.cc
--- libstdc++-v3/config/io/basic_file_stdio.cc	21 Sep 2004 09:06:08 -0000	1.35
+++ libstdc++-v3/config/io/basic_file_stdio.cc	13 Oct 2005 04:55:49 -0000
@@ -44,8 +44,8 @@
 #include <unistd.h>
 #endif
 
-// Pick up FIONREAD on Solaris 2
-#ifdef _GLIBCXX_HAVE_SYS_IOCTL_H
+// Pick up FIONREAD on Solaris 2 but not on UnixWare/OpenServer 6
+#if defined(_GLIBCXX_HAVE_SYS_IOCTL_H) && !defined(__UNIXWARE__) && !defined(_SCO_DS)
 #define BSD_COMP 
 #include <sys/ioctl.h>
 #endif
Index: libstdc++-v3/include/Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/Makefile.am,v
retrieving revision 1.96.2.4
diff -u -3 -p -u -r1.96.2.4 Makefile.am
--- libstdc++-v3/include/Makefile.am	16 Jun 2005 23:30:49 -0000	1.96.2.4
+++ libstdc++-v3/include/Makefile.am	13 Oct 2005 04:55:49 -0000
@@ -386,6 +386,8 @@ thread_host_headers = \
 	${host_builddir}/gthr.h \
 	${host_builddir}/gthr-single.h \
 	${host_builddir}/gthr-posix.h \
+	${host_builddir}/gthr-posix95.h \
+	${host_builddir}/gthr-solaris.h \
 	${host_builddir}/gthr-tpf.h \
 	${host_builddir}/gthr-default.h
 
@@ -563,6 +565,22 @@ ${host_builddir}/gthr-posix.h: ${topleve
 	    -e 's/\(${uppercase}*USE_WEAK\)/_GLIBCXX_\1/g' \
 	    < ${toplevel_srcdir}/gcc/gthr-posix.h > $@
 
+${host_builddir}/gthr-posix95.h: ${toplevel_srcdir}/gcc/gthr-posix95.h \
+				   stamp-${host_alias}
+	sed -e 's/\(UNUSED\)/_GLIBCXX_\1/g' \
+	    -e 's/\(GCC${uppercase}*_H\)/_GLIBCXX_\1/g' \
+	    -e 's/SUPPORTS_WEAK/__GXX_WEAK__/g' \
+	    -e 's/\(${uppercase}*USE_WEAK\)/_GLIBCXX_\1/g' \
+	    < ${toplevel_srcdir}/gcc/gthr-posix95.h > $@
+
+${host_builddir}/gthr-solaris.h: ${toplevel_srcdir}/gcc/gthr-solaris.h \
+				   stamp-${host_alias}
+	sed -e 's/\(UNUSED\)/_GLIBCXX_\1/g' \
+	    -e 's/\(GCC${uppercase}*_H\)/_GLIBCXX_\1/g' \
+	    -e 's/SUPPORTS_WEAK/__GXX_WEAK__/g' \
+	    -e 's/\(${uppercase}*USE_WEAK\)/_GLIBCXX_\1/g' \
+	    < ${toplevel_srcdir}/gcc/gthr-solaris.h > $@
+
 ${host_builddir}/gthr-tpf.h: ${toplevel_srcdir}/gcc/gthr-tpf.h \
 				   stamp-${host_alias}
 	sed -e 's/\(UNUSED\)/_GLIBCXX_\1/g' \
Index: libstdc++-v3/include/Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/Makefile.in,v
retrieving revision 1.126.2.5
diff -u -3 -p -u -r1.126.2.5 Makefile.in
--- libstdc++-v3/include/Makefile.in	22 Jun 2005 20:39:09 -0000	1.126.2.5
+++ libstdc++-v3/include/Makefile.in	13 Oct 2005 04:55:49 -0000
@@ -598,6 +598,8 @@ thread_host_headers = \
 	${host_builddir}/gthr.h \
 	${host_builddir}/gthr-single.h \
 	${host_builddir}/gthr-posix.h \
+	${host_builddir}/gthr-posix95.h \
+	${host_builddir}/gthr-solaris.h \
 	${host_builddir}/gthr-tpf.h \
 	${host_builddir}/gthr-default.h
 
@@ -937,6 +939,22 @@ ${host_builddir}/gthr-posix.h: ${topleve
 	    -e 's/\(${uppercase}*USE_WEAK\)/_GLIBCXX_\1/g' \
 	    < ${toplevel_srcdir}/gcc/gthr-posix.h > $@
 
+${host_builddir}/gthr-posix95.h: ${toplevel_srcdir}/gcc/gthr-posix95.h \
+				   stamp-${host_alias}
+	sed -e 's/\(UNUSED\)/_GLIBCXX_\1/g' \
+	    -e 's/\(GCC${uppercase}*_H\)/_GLIBCXX_\1/g' \
+	    -e 's/SUPPORTS_WEAK/__GXX_WEAK__/g' \
+	    -e 's/\(${uppercase}*USE_WEAK\)/_GLIBCXX_\1/g' \
+	    < ${toplevel_srcdir}/gcc/gthr-posix95.h > $@
+
+${host_builddir}/gthr-solaris.h: ${toplevel_srcdir}/gcc/gthr-solaris.h \
+				   stamp-${host_alias}
+	sed -e 's/\(UNUSED\)/_GLIBCXX_\1/g' \
+	    -e 's/\(GCC${uppercase}*_H\)/_GLIBCXX_\1/g' \
+	    -e 's/SUPPORTS_WEAK/__GXX_WEAK__/g' \
+	    -e 's/\(${uppercase}*USE_WEAK\)/_GLIBCXX_\1/g' \
+	    < ${toplevel_srcdir}/gcc/gthr-solaris.h > $@
+
 ${host_builddir}/gthr-tpf.h: ${toplevel_srcdir}/gcc/gthr-tpf.h \
 				   stamp-${host_alias}
 	sed -e 's/\(UNUSED\)/_GLIBCXX_\1/g' \
Index: libstdc++-v3/include/c_std/std_cstring.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/c_std/std_cstring.h,v
retrieving revision 1.7
diff -u -3 -p -u -r1.7 std_cstring.h
--- libstdc++-v3/include/c_std/std_cstring.h	9 Dec 2003 03:44:35 -0000	1.7
+++ libstdc++-v3/include/c_std/std_cstring.h	13 Oct 2005 04:55:49 -0000
@@ -98,31 +98,31 @@ namespace std
 
   inline void*
   memchr(void* __p, int __c, size_t __n)
-  { return memchr(const_cast<const void*>(__p), __c, __n); }
+  { return (void*)memchr(const_cast<const void*>(__p), __c, __n); }
 
   using ::strchr;
 
   inline char*
   strchr(char* __s1, int __n)
-  { return __builtin_strchr(const_cast<const char*>(__s1), __n); }
+  { return (char*)__builtin_strchr(const_cast<const char*>(__s1), __n); }
 
   using ::strpbrk;
 
   inline char*
   strpbrk(char* __s1, const char* __s2)
-  { return __builtin_strpbrk(const_cast<const char*>(__s1), __s2); }
+  { return (char*)__builtin_strpbrk(const_cast<const char*>(__s1), __s2); }
 
   using ::strrchr;
 
   inline char*
   strrchr(char* __s1, int __n)
-  { return __builtin_strrchr(const_cast<const char*>(__s1), __n); }
+  { return (char*)__builtin_strrchr(const_cast<const char*>(__s1), __n); }
 
   using ::strstr;
 
   inline char*
   strstr(char* __s1, const char* __s2)
-  { return __builtin_strstr(const_cast<const char*>(__s1), __s2); }
+  { return (char*)__builtin_strstr(const_cast<const char*>(__s1), __s2); }
 }
 
 #endif
Index: libstdc++-v3/include/c_std/std_cwchar.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/c_std/std_cwchar.h,v
retrieving revision 1.10
diff -u -3 -p -u -r1.10 std_cwchar.h
--- libstdc++-v3/include/c_std/std_cwchar.h	20 Jul 2004 08:47:42 -0000	1.10
+++ libstdc++-v3/include/c_std/std_cwchar.h	13 Oct 2005 04:55:49 -0000
@@ -206,31 +206,31 @@ namespace std
 
   inline wchar_t*
   wcschr(wchar_t* __p, wchar_t __c)
-  { return wcschr(const_cast<const wchar_t*>(__p), __c); }
+  { return (wchar_t*)wcschr(const_cast<const wchar_t*>(__p), __c); }
 
   using ::wcspbrk;
 
   inline wchar_t*
   wcspbrk(wchar_t* __s1, wchar_t* __s2)
-  { return wcspbrk(const_cast<const wchar_t*>(__s1), __s2); }
+  { return (wchar_t*)wcspbrk(const_cast<const wchar_t*>(__s1), __s2); }
 
   using ::wcsrchr;
 
   inline wchar_t*
   wcsrchr(wchar_t* __p, wchar_t __c)
-  { return wcsrchr(const_cast<const wchar_t*>(__p), __c); }
+  { return (wchar_t*)wcsrchr(const_cast<const wchar_t*>(__p), __c); }
 
   using ::wcsstr;
 
   inline wchar_t*
   wcsstr(wchar_t* __s1, const wchar_t* __s2)
-  { return wcsstr(const_cast<const wchar_t*>(__s1), __s2); }
+  { return (wchar_t*)wcsstr(const_cast<const wchar_t*>(__s1), __s2); }
 
   using ::wmemchr;
 
   inline wchar_t*
   wmemchr(wchar_t* __p, wchar_t __c, size_t __n)
-  { return wmemchr(const_cast<const wchar_t*>(__p), __c, __n); }
+  { return (wchar_t*)wmemchr(const_cast<const wchar_t*>(__p), __c, __n); }
 }
 
 #if _GLIBCXX_USE_C99
Index: libstdc++-v3/testsuite/21_strings/c_strings/wchar_t/1.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/21_strings/c_strings/wchar_t/1.cc,v
retrieving revision 1.2
diff -u -3 -p -u -r1.2 1.cc
--- libstdc++-v3/testsuite/21_strings/c_strings/wchar_t/1.cc	23 Sep 2003 20:02:11 -0000	1.2
+++ libstdc++-v3/testsuite/21_strings/c_strings/wchar_t/1.cc	13 Oct 2005 19:56:55 -0000
@@ -44,7 +44,7 @@ void test01()
   // const char* wcspbrk(const wchar_t* s1, const wchar_t* s2);
   // char* wcspbrk(wchar_t* s1, const wchar_t* s2);
   cc1 = std::wcspbrk(ccarray1, ccarray2);
-  c1 = std::wcspbrk(carray, ccarray2);
+  c1 = (wchar_t*)std::wcspbrk(carray, ccarray2);
 
   // const wchar_t* strrchr(const wchar_t* s, wchar_t c);
   // wchar_t* strrchr(wchar_t* s, wchar_t c);
Index: libstdc++-v3/testsuite/21_strings/c_strings/wchar_t/2.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/21_strings/c_strings/wchar_t/2.cc,v
retrieving revision 1.2
diff -u -3 -p -u -r1.2 2.cc
--- libstdc++-v3/testsuite/21_strings/c_strings/wchar_t/2.cc	23 Sep 2003 20:02:11 -0000	1.2
+++ libstdc++-v3/testsuite/21_strings/c_strings/wchar_t/2.cc	13 Oct 2005 19:56:55 -0000
@@ -34,11 +34,11 @@ void test02()
   wcscpy(carray, ccarray1);
   wchar_t* w;
 
-  w = wmemchr(ccarray1, L'/', 3);
-  w = wcschr(ccarray1, L'/');
-  w = wcspbrk(ccarray1, ccarray2);
-  w = wcsrchr(ccarray1, L'c');
-  w = wcsstr(carray, carray);
+  w = (wchar_t*)wmemchr(ccarray1, L'/', 3);
+  w = (wchar_t*)wcschr(ccarray1, L'/');
+  w = (wchar_t*)wcspbrk(ccarray1, ccarray2);
+  w = (wchar_t*)wcsrchr(ccarray1, L'c');
+  w = (wchar_t*)wcsstr(carray, carray);
 }
 
 int main()
Index: libstdc++-v3/testsuite/26_numerics/cmath/c99_classification_macros_c.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/26_numerics/cmath/c99_classification_macros_c.cc,v
retrieving revision 1.1.54.1
diff -u -3 -p -u -r1.1.54.1 c99_classification_macros_c.cc
--- libstdc++-v3/testsuite/26_numerics/cmath/c99_classification_macros_c.cc	10 Sep 2005 16:14:07 -0000	1.1.54.1
+++ libstdc++-v3/testsuite/26_numerics/cmath/c99_classification_macros_c.cc	13 Oct 2005 04:55:49 -0000
@@ -27,8 +27,8 @@
 // invalidate any other reasons why the executable file might be covered by
 // the GNU General Public License.
 
-// { dg-do compile { xfail *-*-linux* *-*-freebsd5* } }
-// { dg-excess-errors "" { target *-*-linux* *-*-freebsd5* } }
+// { dg-do compile { xfail *-*-linux* *-*-freebsd5* *-*-sysv5* *-*-sco* } }
+// { dg-excess-errors "" { target *-*-linux* *-*-freebsd5* *-*-sysv5* *-*-sco* } }
 
 #include <math.h>
 

zlib changes:

2005-10-10  Kean Johnston  <jkj@sco.com>

	* acinclude.m4: include ../config/mmap.m4 for GCC_FUNC_MMAP
	* configure.ac: Use GCC_FUNC_MMAP for better mmap detection.

Index: zlib/acinclude.m4
===================================================================
RCS file: /cvs/gcc/gcc/zlib/acinclude.m4,v
retrieving revision 1.6
diff -u -3 -p -u -r1.6 acinclude.m4
--- zlib/acinclude.m4	11 Oct 2004 17:35:35 -0000	1.6
+++ zlib/acinclude.m4	13 Oct 2005 04:55:50 -0000
@@ -1,4 +1,5 @@
 sinclude(../config/no-executables.m4)
+sinclude(../config/mmap.m4)
 sinclude(../libtool.m4)
 dnl The lines below arrange for aclocal not to bring libtool.m4
 dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
Index: zlib/configure.ac
===================================================================
RCS file: /cvs/gcc/gcc/zlib/configure.ac,v
retrieving revision 1.3
diff -u -3 -p -u -r1.3 configure.ac
--- zlib/configure.ac	11 Oct 2004 17:35:36 -0000	1.3
+++ zlib/configure.ac	13 Oct 2005 04:55:50 -0000
@@ -77,7 +77,7 @@ if test -n "$with_cross_host"; then
    # We ignore --with-system-zlib in this case.
    target_all=libzgcj.la
 else
-   AC_FUNC_MMAP
+   GCC_FUNC_MMAP
    AC_CHECK_FUNCS(memcpy strerror)
 
    if test "$with_system_zlib" = yes; then

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]