summaryrefslogtreecommitdiff
path: root/gcc/config/alpha
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/alpha')
-rw-r--r--gcc/config/alpha/t-vms648
-rw-r--r--gcc/config/alpha/vms-crt0-64.c99
-rw-r--r--gcc/config/alpha/vms-psxcrt0-64.c128
-rw-r--r--gcc/config/alpha/vms64.h32
-rw-r--r--gcc/config/alpha/xm-vms64.h29
5 files changed, 296 insertions, 0 deletions
diff --git a/gcc/config/alpha/t-vms64 b/gcc/config/alpha/t-vms64
new file mode 100644
index 00000000000..e3fc3be6435
--- /dev/null
+++ b/gcc/config/alpha/t-vms64
@@ -0,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
diff --git a/gcc/config/alpha/vms-crt0-64.c b/gcc/config/alpha/vms-crt0-64.c
new file mode 100644
index 00000000000..4120a6b4c0f
--- /dev/null
+++ b/gcc/config/alpha/vms-crt0-64.c
@@ -0,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
diff --git a/gcc/config/alpha/vms-psxcrt0-64.c b/gcc/config/alpha/vms-psxcrt0-64.c
new file mode 100644
index 00000000000..be3e70d6414
--- /dev/null
+++ b/gcc/config/alpha/vms-psxcrt0-64.c
@@ -0,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
diff --git a/gcc/config/alpha/vms64.h b/gcc/config/alpha/vms64.h
new file mode 100644
index 00000000000..3b4f5874669
--- /dev/null
+++ b/gcc/config/alpha/vms64.h
@@ -0,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
diff --git a/gcc/config/alpha/xm-vms64.h b/gcc/config/alpha/xm-vms64.h
new file mode 100644
index 00000000000..26fd82923a4
--- /dev/null
+++ b/gcc/config/alpha/xm-vms64.h
@@ -0,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"