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]

Add 64-bit VMS support


Fri Dec 14 07:29:52 2001  Douglas B. Rupp  <rupp@gnat.com>

	* config.gcc (alpha64-dec-*vms*): New case.
	* config/alpha/t-vms64, config/alpha/vms-crt0-64.c: New files.
	* config/alpha/vms-psxcrt0-64.c, config/alpha/vms64.h: Likewise.
	* config/alpha/xm-vms64.h: Likewise.

*** config.gcc	2001/12/13 23:14:44	1.129
--- config.gcc	2001/12/14 12:50:33
*************** alpha*-*-vxworks*)
*** 520,523 ****
--- 520,540 ----
  	thread_file='vxworks'
  	;;
+ alpha64-dec-*vms*)
+ 	xm_defines=POSIX
+ 	tm_file="alpha/vms.h alpha/vms64.h"
+ 	xm_file="alpha/xm-vms.h alpha/xm-vms64.h"
+ 	tmake_file="alpha/t-alpha alpha/t-vms alpha/t-vms64 alpha/t-ieee"
+ 	xmake_file=alpha/x-vms
+ 	exeext=.exe
+ 	# This removes the cpu type and manufacturer components and
+ 	#  replaces "." with "_" in the operating system version.
+ 	case $host in *-*-*vms*)
+ 		target_alias=`echo $host \
+ 		  | sed 's/.*-.*-\(.*\)$/\1/' | sed 's/\./_/g'`
+ 		;;
+ 	esac
+ 	prefix=/gnu
+ 	local_prefix=/gnu
+ 	;;
  alpha*-dec-*vms*)
  	xm_defines=POSIX
*** /dev/null	Sun Dec  2 07:05:48 2001
--- config/alpha/t-vms64	Fri Dec 14 07:44:08 2001
***************
*** 0 ****
--- 1,8 ----
+ # Assemble startup files.
+ vcrt0.o: $(CRT0_S) $(GCC_PASSES)
+ 	decc -c /names=as_is /pointer_size=64  \
+ 	     $(srcdir)/config/alpha/vms-crt0-64.c -o vcrt0.o
+ 
+ pcrt0.o: $(CRT0_S) $(GCC_PASSES)
+ 	decc -c /names=as_is /pointer_size=64 \
+ 	     $(srcdir)/config/alpha/vms-psxcrt0-64.c -o pcrt0.o
*** /dev/null	Sun Dec  2 07:05:48 2001
--- config/alpha/vms-crt0-64.c	Fri Dec 14 07:41:57 2001
***************
*** 0 ****
--- 1,99 ----
+ /* VMS 64bit crt0 returning VMS style condition codes .
+    Copyright (C) 2001 Free Software Foundation, Inc.
+    Contributed by Douglas B. Rupp (rupp@gnat.com).
+ 
+ This file is part of GNU CC.
+ 
+ GNU CC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+ 
+ In addition to the permissions in the GNU General Public License, the
+ Free Software Foundation gives you unlimited permission to link the
+ compiled version of this file into combinations with other programs,
+ and to distribute those combinations without any restriction coming
+ from the use of this file.  (The General Public License restrictions
+ do apply in other respects; for example, they cover modification of
+ the file, and distribution when not linked into a combine
+ executable.)
+ 
+ GNU CC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+ 
+ You should have received a copy of the GNU General Public License
+ along with GNU CC; see the file COPYING.  If not, write to
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.  */
+ 
+ #if !defined(__DECC)
+ You Lose! This file can only be compiled with DEC C.
+ #else
+ 
+ /* This file can only be compiled with DEC C, due the the call to
+    lib$establish and the pragmas pointer_size.  */
+ 
+ #pragma __pointer_size short
+ 
+ #include <stdlib.h>
+ #include <string.h>
+ #include <ssdef.h>
+ 
+ extern void decc$main ();
+ 
+ extern int main ();
+ 
+ static int
+ handler (sigargs, mechargs)
+      void *sigargs;
+      void *mechargs;
+ {
+   return SS$_RESIGNAL;
+ }
+ 
+ int
+ __main (arg1, arg2, arg3, image_file_desc, arg5, arg6)
+      void *arg1, *arg2, *arg3;
+      void *image_file_desc;
+      void *arg5, *arg6;
+ {
+   int argc;
+   char **argv;
+   char **envp;
+ 
+ #pragma __pointer_size long
+ 
+   int i;
+   char **long_argv;
+   char **long_envp;
+ 
+ #pragma __pointer_size short
+ 
+   lib$establish (handler);
+   decc$main (arg1, arg2, arg3, image_file_desc,
+ 	     arg5, arg6, &argc, &argv, &envp);
+ 
+ #pragma __pointer_size long
+ 
+   /* Reallocate argv with 64 bit pointers. */
+   long_argv = (char **) malloc (sizeof (char *) * (argc + 1));
+ 
+   for (i = 0; i < argc; i++)
+     long_argv[i] = strdup (argv[i]);
+ 
+   long_argv[argc] = (char *) 0;
+ 
+   long_envp = (char **) malloc (sizeof (char *) * 5);
+ 
+   for (i = 0; envp[i]; i++)
+     long_envp[i] = strdup (envp[i]);
+ 
+   long_envp[i] = (char *) 0;
+ 
+ #pragma __pointer_size short
+ 
+   return main (argc, long_argv, long_envp);
+ }
+ #endif
*** /dev/null	Sun Dec  2 07:05:48 2001
--- config/alpha/vms-psxcrt0-64.c	Fri Dec 14 07:43:29 2001
***************
*** 0 ****
--- 1,128 ----
+ /* VMS 64bit crt0 returning Unix style condition codes .
+    Copyright (C) 2001 Free Software Foundation, Inc.
+    Contributed by Douglas B. Rupp (rupp@gnat.com).
+ 
+ This file is part of GNU CC.
+ 
+ GNU CC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+ 
+ In addition to the permissions in the GNU General Public License, the
+ Free Software Foundation gives you unlimited permission to link the
+ compiled version of this file into combinations with other programs,
+ and to distribute those combinations without any restriction coming
+ from the use of this file.  (The General Public License restrictions
+ do apply in other respects; for example, they cover modification of
+ the file, and distribution when not linked into a combine
+ executable.)
+ 
+ GNU CC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+ 
+ You should have received a copy of the GNU General Public License
+ along with GNU CC; see the file COPYING.  If not, write to
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.  */
+ 
+ #if !defined(__DECC)
+ You Lose! This file can only be compiled with DEC C.
+ #else
+ 
+ /* This file can only be compiled with DEC C, due the the call to
+    lib$establish and the pragmas pointer_size.  */
+ 
+ #pragma __pointer_size short
+ 
+ #include <stdlib.h>
+ #include <string.h>
+ #include <ssdef.h>
+ #include <stsdef.h>
+ #include <errnodef.h>
+ 
+ extern void decc$main ();
+ extern int main ();
+ 
+ static int
+ handler (sigargs, mechargs)
+      void *sigargs;
+      void *mechargs;
+ {
+   return SS$_RESIGNAL;
+ }
+ 
+ int
+ __main (arg1, arg2, arg3, image_file_desc, arg5, arg6)
+      void *arg1, *arg2, *arg3;
+      void *image_file_desc;
+      void *arg5, *arg6)
+ {
+   int argc;
+   char **argv;
+   char **envp;
+ 
+ #pragma __pointer_size long
+ 
+   int i;
+   char **long_argv;
+   char **long_envp;
+   int status;
+ 
+ #pragma __pointer_size short
+ 
+   lib$establish (handler);
+   decc$main (arg1, arg2, arg3, image_file_desc,
+ 	     arg5, arg6, &argc, &argv, &envp);
+ 
+ #pragma __pointer_size long
+ 
+   /* Reallocate argv with 64 bit pointers. */
+   long_argv = (char **) malloc (sizeof (char *) * (argc + 1));
+ 
+   for (i = 0; i < argc; i++)
+     long_argv[i] = strdup (argv[i]);
+ 
+   long_argv[argc] = (char *) 0;
+ 
+   long_envp = (char **) malloc (sizeof (char *) * 5);
+ 
+   for (i = 0; envp[i]; i++)
+     long_envp[i] = strdup (envp[i]);
+ 
+   long_envp[i] = (char *) 0;
+ 
+ #pragma __pointer_size short
+ 
+   status = main (argc, long_argv, long_envp);
+ 
+   /* Map into a range of 0 - 255.  */
+   status = status & 255;
+ 
+   if (status > 0)
+     {
+       int save_status = status;
+ 
+       status = C$_EXIT1 + ((status - 1) << STS$V_MSG_NO);
+ 
+       /* An exit failure status requires a "severe" error.  All status values
+ 	 are defined in errno with a successful (1) severity but can be
+ 	 changed to an error (2) severity by adding 1.  In addition for
+ 	 compatibility with UNIX exit() routines we inhibit a run-time error
+ 	 message from being generated on exit(1).  */
+ 
+       if (save_status == 1)
+ 	{
+ 	  status++;
+ 	  status |= STS$M_INHIB_MSG;
+ 	}
+     }
+ 
+   if (status == 0)
+     status = SS$_NORMAL;
+ 
+   return status;
+ }
+ #endif
*** /dev/null	Sun Dec  2 07:05:48 2001
--- config/alpha/vms64.h	Fri Dec 14 07:39:52 2001
***************
*** 0 ****
--- 1,32 ----
+ /* Output variables, constants and external declarations, for GNU compiler.
+    Copyright (C) 2001 Free Software Foundation, Inc.
+    Contributed by Douglas Rupp (rupp@gnat.com).
+ 
+ This file is part of GNU CC.
+ 
+ GNU CC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+ 
+ GNU CC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+ 
+ You should have received a copy of the GNU General Public License
+ along with GNU CC; see the file COPYING.  If not, write to
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.  */
+ 
+ /* Defaults to BITS_PER_WORD, e.g. 64 which is what is wanted.
+   This is incompatible with DEC C, but matches DEC Ada */
+ #undef LONG_TYPE_SIZE
+ 
+ /* Defaults to "long int" */
+ #undef SIZE_TYPE
+ #undef PTRDIFF_TYPE
+ 
+ #undef POINTERS_EXTEND_UNSIGNED
+ #undef POINTER_SIZE
+ #define POINTER_SIZE 64
*** /dev/null	Sun Dec  2 07:05:48 2001
--- config/alpha/xm-vms64.h	Fri Dec 14 07:39:23 2001
***************
*** 0 ****
--- 1,29 ----
+ /* Configuration for GNU C-compiler for openVMS/Alpha.
+    Copyright (C) 2001 Free Software Foundation, Inc.
+    Contributed by Douglas Rupp (rupp@gnat.com).
+ 
+ This file is part of GNU CC.
+ 
+ GNU CC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+ 
+ GNU CC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+ 
+ You should have received a copy of the GNU General Public License
+ along with GNU CC; see the file COPYING.  If not, write to
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.  */
+ 
+ #undef HOST_WIDE_INT
+ 
+ /* Since DEC C long != Gnu C long */
+ #define HOST_PTR_PRINTF "%llx"
+ #define HOST_WIDE_INT_PRINT_DEC "%lld"
+ #define HOST_WIDE_INT_PRINT_UNSIGNED "%llu"
+ #define HOST_WIDE_INT_PRINT_HEX "0x%llx"
+ #define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%llx%016llx"


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