summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.bin/gcc')
-rw-r--r--gnu/usr.bin/gcc/config.guess3
-rw-r--r--gnu/usr.bin/gcc/config/pa/pa-openbsd.h89
-rw-r--r--gnu/usr.bin/gcc/config/pa/pa1-openbsd.h24
-rw-r--r--gnu/usr.bin/gcc/config/pa/t-pa10
-rw-r--r--gnu/usr.bin/gcc/config/pa/xm-openbsd.h1
-rw-r--r--gnu/usr.bin/gcc/configure7
-rw-r--r--gnu/usr.bin/gcc/configure.in7
-rw-r--r--gnu/usr.bin/gcc/libgcc1-test.c3
8 files changed, 142 insertions, 2 deletions
diff --git a/gnu/usr.bin/gcc/config.guess b/gnu/usr.bin/gcc/config.guess
index 30230b3dfe9..ba38770abaa 100644
--- a/gnu/usr.bin/gcc/config.guess
+++ b/gnu/usr.bin/gcc/config.guess
@@ -416,6 +416,9 @@ EOF
parisc*:Lites*:*:*)
echo hppa1.1-hp-lites
exit 0 ;;
+ hppa*:OpenBSD:*:*)
+ echo hppa-hp-openbsd
+ exit 0 ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd
exit 0 ;;
diff --git a/gnu/usr.bin/gcc/config/pa/pa-openbsd.h b/gnu/usr.bin/gcc/config/pa/pa-openbsd.h
new file mode 100644
index 00000000000..45db5d836d4
--- /dev/null
+++ b/gnu/usr.bin/gcc/config/pa/pa-openbsd.h
@@ -0,0 +1,89 @@
+/* Definitions for HP-PA systems running BSD as target machine for GNU compiler.
+ Copyright (C) 1993, 1995 Free Software Foundation, Inc.
+
+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. */
+
+/* We settle for little endian for now */
+
+#define TARGET_ENDIAN_DEFAULT 0
+
+#ifndef CROSS_COMPILE
+/* Look for the G++ include files in the system-defined place. */
+
+#undef GPLUSPLUS_INCLUDE_DIR
+#define GPLUSPLUS_INCLUDE_DIR "/usr/include/g++"
+
+/* Under OpenBSD, the normal location of the various *crt*.o files is the
+ /usr/lib directory. */
+
+#undef STANDARD_STARTFILE_PREFIX
+#define STANDARD_STARTFILE_PREFIX "/usr/lib/"
+#endif
+
+/* Provide a LINK_SPEC appropriate for OpenBSD. Here we provide support
+ for the special GCC options -static, -assert, and -nostdlib. */
+
+#undef LINK_SPEC
+#define LINK_SPEC \
+ "%{EB} %{EL} %{shared} %{non_shared} \
+ %{call_shared} %{no_archive} %{exact_version} \
+ %{!shared: %{!non_shared: %{!call_shared: -non_shared}}} \
+ %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so} \
+ %{!nostdlib:%{!r*:%{!e*:-e __start}}} -dc -dp \
+ %{static:-Bstatic} %{!static:-Bdynamic} %{assert*}"
+
+/* We have atexit(3). */
+
+#define HAVE_ATEXIT
+
+/* Implicit library calls should use memcpy, not bcopy, etc. */
+
+#define TARGET_MEM_FUNCTIONS
+
+/* Define hppa-specific OpenBSD predefines... */
+#ifndef CPP_PREDEFINES
+#define CPP_PREDEFINES "-Dunix -D__ANSI_COMPAT \
+-Asystem(unix) -Asystem(OpenBSD) -Amachine(hppa) \
+-D__OpenBSD__ -D__hppa__ -D__hppa"
+#endif
+
+/* Always uses gas. */
+#ifndef ASM_SPEC
+#define ASM_SPEC "\
+%|"
+#endif
+
+#ifndef CPP_SPEC
+#define CPP_SPEC "\
+%{posix:-D_POSIX_SOURCE}"
+#endif
+
+#define LIB_SPEC "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}"
+#define STARTFILE_SPEC \
+ "%{!shared:%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}"
+
+#ifndef MACHINE_TYPE
+#define MACHINE_TYPE "OpenBSD/hppa"
+#endif
+
+#define LOCAL_LABEL_PREFIX "."
+
+/* Since gas and gld are standard on OpenBSD, we don't need this */
+#undef ASM_FINAL_SPEC
+#undef STARTFILE_SPEC
+
diff --git a/gnu/usr.bin/gcc/config/pa/pa1-openbsd.h b/gnu/usr.bin/gcc/config/pa/pa1-openbsd.h
new file mode 100644
index 00000000000..c791b553769
--- /dev/null
+++ b/gnu/usr.bin/gcc/config/pa/pa1-openbsd.h
@@ -0,0 +1,24 @@
+/* Definitions of target machine for GNU compiler, for HP PA-RISC 1.1
+ Copyright (C) 1991 Free Software Foundation, Inc.
+ Contributed by Tim Moore (moore@defmacro.cs.utah.edu)
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+#define TARGET_DEFAULT 1 /* TARGET_SNAKE */
+
+#include "pa/pa-openbsd.h"
diff --git a/gnu/usr.bin/gcc/config/pa/t-pa b/gnu/usr.bin/gcc/config/pa/t-pa
index a359918a125..ecb5b2ac840 100644
--- a/gnu/usr.bin/gcc/config/pa/t-pa
+++ b/gnu/usr.bin/gcc/config/pa/t-pa
@@ -1,8 +1,14 @@
-LIBGCC1=libgcc1.null
-CROSS_LIBGCC1=libgcc1.null
+LIBGCC1=libgcc1-asm.a
+CROSS_LIBGCC1=libgcc1-asm.a
ADA_CFLAGS=-mdisable-indexing
+LIB1ASMSRC=pa/lib1funcs.asm
+LIB1ASMFUNCS=_divI _divU _modI _modU _remI _remU
LIB2FUNCS_EXTRA=lib2funcs.asm ee.asm ee_fp.asm
+lib1funcs.asm: $(srcdir)/config/pa/lib1funcs.asm
+ rm -f lib1funcs.asm
+ cp $(srcdir)/config/pa/lib1funcs.asm .
+
lib2funcs.asm: $(srcdir)/config/pa/lib2funcs.asm
rm -f lib2funcs.asm
cp $(srcdir)/config/pa/lib2funcs.asm .
diff --git a/gnu/usr.bin/gcc/config/pa/xm-openbsd.h b/gnu/usr.bin/gcc/config/pa/xm-openbsd.h
new file mode 100644
index 00000000000..7d1314fdc56
--- /dev/null
+++ b/gnu/usr.bin/gcc/config/pa/xm-openbsd.h
@@ -0,0 +1 @@
+#include "pa/xm-pa.h"
diff --git a/gnu/usr.bin/gcc/configure b/gnu/usr.bin/gcc/configure
index 4c39911d380..3a296a7f8b6 100644
--- a/gnu/usr.bin/gcc/configure
+++ b/gnu/usr.bin/gcc/configure
@@ -3165,6 +3165,13 @@ for machine in $build $host $target; do
use_collect2=yes
fixincludes=Makefile.in
;;
+ hppa*-*-openbsd*)
+ target_cpu_default=1
+ tm_file="${tm_file} pa/pa-openbsd.h pa/pa-gas.h"
+ xm_file=pa/xm-openbsd.h
+ use_collect2=yes
+ fixincludes=Makefile.in
+ ;;
i370-*-mvs*)
;;
i[34567]86-ibm-aix*) # IBM PS/2 running AIX
diff --git a/gnu/usr.bin/gcc/configure.in b/gnu/usr.bin/gcc/configure.in
index c12f8b9ce64..9f6533e1080 100644
--- a/gnu/usr.bin/gcc/configure.in
+++ b/gnu/usr.bin/gcc/configure.in
@@ -664,6 +664,13 @@ for machine in $build $host $target; do
use_collect2=yes
fixincludes=Makefile.in
;;
+ hppa*-*-openbsd*)
+ target_cpu_default=1
+ tm_file="${tm_file} pa/pa-openbsd.h pa/pa-gas.h"
+ xm_file=pa/xm-openbsd.h
+ use_collect2=yes
+ fixincludes=Makefile.in
+ ;;
i370-*-mvs*)
;;
i[[34567]]86-ibm-aix*) # IBM PS/2 running AIX
diff --git a/gnu/usr.bin/gcc/libgcc1-test.c b/gnu/usr.bin/gcc/libgcc1-test.c
index 977b9c76188..9442b51e2e3 100644
--- a/gnu/usr.bin/gcc/libgcc1-test.c
+++ b/gnu/usr.bin/gcc/libgcc1-test.c
@@ -96,8 +96,11 @@ dfoo ()
extern void start() __asm__("start");
extern void _start() __asm__("_start");
extern void __start() __asm__("__start");
+extern void ___start() __asm__("$START$");
+int global __asm__("$global$");
void start() {}
void _start() {}
void __start() {}
+void ___start() {}
void mainCRTStartup() {}