summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/gcc/gcc/config.gcc4
-rw-r--r--gnu/usr.bin/gcc/gcc/config/pa/openbsd.h201
-rw-r--r--gnu/usr.bin/gcc/gcc/config/pa/t-openbsd17
3 files changed, 220 insertions, 2 deletions
diff --git a/gnu/usr.bin/gcc/gcc/config.gcc b/gnu/usr.bin/gcc/gcc/config.gcc
index 2cebf4705f1..051f599b2de 100644
--- a/gnu/usr.bin/gcc/gcc/config.gcc
+++ b/gnu/usr.bin/gcc/gcc/config.gcc
@@ -821,8 +821,8 @@ hppa*-*-linux* | parisc*-*-linux*)
tmake_file="t-slibgcc-elf-ver t-linux pa/t-linux"
;;
hppa*-*-openbsd*)
- target_cpu_default="MASK_PA_11"
- tmake_file=pa/t-bsd
+ target_cpu_default="MASK_PA_11 | MASK_NO_SPACE_REGS"
+ tmake_file="t-libc-ok t-openbsd t-openbsd-thread pa/t-openbsd"
;;
hppa1.1-*-pro*)
target_cpu_default="(MASK_JUMP_IN_DELAY | MASK_PORTABLE_RUNTIME | MASK_GAS | MASK_NO_SPACE_REGS | MASK_SOFT_FLOAT)"
diff --git a/gnu/usr.bin/gcc/gcc/config/pa/openbsd.h b/gnu/usr.bin/gcc/gcc/config/pa/openbsd.h
new file mode 100644
index 00000000000..8d3ede55273
--- /dev/null
+++ b/gnu/usr.bin/gcc/gcc/config/pa/openbsd.h
@@ -0,0 +1,201 @@
+/* Configuration file for an hppa risc OpenBSD target.
+ Copyright (C) 1999 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. */
+
+
+#include <pa/pa.h>
+#include <pa/pa32-regs.h>
+#define OBSD_HAS_DECLARE_FUNCTION_NAME
+#include <openbsd.h>
+
+/* Turn off various SOM crap we don't want. */
+#undef TARGET_ELF32
+#define TARGET_ELF32 1
+
+#undef MAX_OFILE_ALIGNMENT
+#define MAX_OFILE_ALIGNMENT 0x8000
+
+/* Run-time target specifications. */
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS() \
+ do \
+ { \
+ builtin_define_std ("__ELF__"); \
+ builtin_define_std ("__ANSI_COMPAT"); \
+ builtin_define_std ("__unix__"); \
+ builtin_define_std ("__OpenBSD__"); \
+ builtin_assert ("system=OpenBSD"); \
+ builtin_assert ("system=unix"); \
+ } \
+ while (0)
+
+
+#undef OVERRIDE_OPTIONS
+#define OVERRIDE_OPTIONS \
+{ \
+ override_options (); \
+ if (! flag_pic) \
+ target_flags |= MASK_PORTABLE_RUNTIME | MASK_FAST_INDIRECT_CALLS;\
+}
+
+/* XXX Why doesn't PA support -R like everyone ??? */
+#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*}"
+
+/* Layout of source language data types. */
+
+/* This must agree with <machine/ansi.h> */
+#undef SIZE_TYPE
+#define SIZE_TYPE "unsigned int"
+
+#undef PTRDIFF_TYPE
+#define PTRDIFF_TYPE "int"
+
+#undef WCHAR_TYPE
+#define WCHAR_TYPE "int"
+
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE 32
+
+/* Output at beginning of assembler file. */
+/* This is slightly changed from main pa.h to only output dyncall
+ when compiling PIC. */
+#undef ASM_FILE_START
+#define ASM_FILE_START(FILE) \
+do { \
+ if (write_symbols != NO_DEBUG) \
+ output_file_directive ((FILE), main_input_filename); \
+ if (TARGET_64BIT) \
+ fputs("\t.LEVEL 2.0w\n", FILE); \
+ else if (TARGET_PA_20) \
+ fputs("\t.LEVEL 2.0\n", FILE); \
+ else if (TARGET_PA_11) \
+ fputs("\t.LEVEL 1.1\n", FILE); \
+ else \
+ fputs("\t.LEVEL 1.0\n", FILE); \
+ if (flag_pic || !TARGET_FAST_INDIRECT_CALLS) \
+ fputs ("\t.IMPORT $$dyncall, MILLICODE\n", FILE); \
+ if (profile_flag) \
+ fputs ("\t.IMPORT _mcount, CODE\n", FILE); \
+ } while (0)
+
+#undef ASM_OUTPUT_FUNCTION_PREFIX
+
+/* We want local labels to start with period if made with asm_fprintf. */
+#undef LOCAL_LABEL_PREFIX
+#define LOCAL_LABEL_PREFIX "."
+
+/* Use the default. */
+#undef ASM_OUTPUT_LABEL
+
+/* Define these to generate the Linux/ELF/SysV style of internal
+ labels all the time - i.e. to be compatible with
+ ASM_GENERATE_INTERNAL_LABEL in <elfos.h>. Compare these with the
+ ones in pa.h and note the lack of dollar signs in these. FIXME:
+ shouldn't we fix pa.h to use ASM_GENERATE_INTERNAL_LABEL instead? */
+
+#undef ASM_OUTPUT_ADDR_VEC_ELT
+#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
+ if (TARGET_BIG_SWITCH) \
+ fprintf (FILE, "\tstw %%r1,-16(%%r30)\n\tldil LR'.L%d,%%r1\n\tbe RR'.L%d(%%sr4,%%r1)\n\tldw -16(%%r30),%%r1\n", VALUE, VALUE); \
+ else \
+ fprintf (FILE, "\tb .L%d\n\tnop\n", VALUE)
+#undef ASM_OUTPUT_ADDR_DIFF_ELT
+#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
+ if (TARGET_BIG_SWITCH) \
+ fprintf (FILE, "\tstw %%r1,-16(%%r30)\n\tldw T'.L%d(%%r19),%%r1\n\tbv %%r0(%%r1)\n\tldw -16(%%r30),%%r1\n", VALUE); \
+ else \
+ fprintf (FILE, "\tb .L%d\n\tnop\n", VALUE)
+
+#undef STRING_ASM_OP
+#define STRING_ASM_OP ".stringz"
+
+#undef DBX_OUTPUT_MAIN_SOURCE_FILE_END
+
+#undef ASM_OUTPUT_SECTION_NAME
+/* Switch into a generic section.
+ This is currently only used to support section attributes.
+
+ We make the section read-only and executable for a function decl,
+ read-only for a const data decl, and writable for a non-const data decl. */
+#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC) \
+ fprintf (FILE, "\t.section\t%s,\"%s\",@progbits\n", NAME, \
+ (DECL) && TREE_CODE (DECL) == FUNCTION_DECL ? "ax" : \
+ (DECL) && DECL_READONLY_SECTION (DECL, RELOC) ? "a" : "aw")
+
+/* FIXME: Hacked from the <elfos.h> one so that we avoid multiple
+ labels in a function declaration (since pa.c seems determined to do
+ it differently) */
+
+#undef ASM_DECLARE_FUNCTION_NAME
+#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
+ do \
+ { \
+ if (TREE_PUBLIC (DECL)) \
+ { \
+ fputs ("\t.export ", FILE); \
+ assemble_name (FILE, NAME); \
+ fputs (", entry\n", FILE); \
+ } \
+ ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "function"); \
+ ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
+ } \
+ while (0)
+
+/* As well as globalizing the label, we need to encode the label
+ to ensure a plabel is generated in an indirect call. */
+#undef ASM_OUTPUT_EXTERNAL_LIBCALL
+#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
+ do \
+ { \
+ if (!FUNCTION_NAME_P (XSTR (FUN, 0))) \
+ hppa_encode_label (FUN); \
+ (*targetm.asm_out.globalize_label) (FILE, XSTR (FUN, 0)); \
+ } \
+ while (0)
+
+/* As an elf system, we need crtbegin/crtend stuff. */
+#undef STARTFILE_SPEC
+#define STARTFILE_SPEC "%{!shared: %{pg:gcrt0%O%s} %{!pg:%{p:gcrt0%O%s} %{!p:crt0%O%s}} crtbegin%O%s} %{shared:crtbeginS%O%s}"
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC "%{!shared:crtend%O%s} %{shared:crtendS%O%s}"
+
+#undef TEXT_SECTION_ASM_OP
+#define TEXT_SECTION_ASM_OP "\t.text"
+#undef READONLY_DATA_SECTION_ASM_OP
+#define READONLY_DATA_SECTION_ASM_OP "\t.section\t.rodata"
+#undef DATA_SECTION_ASM_OP
+#define DATA_SECTION_ASM_OP "\t.data"
+#undef BSS_SECTION_ASM_OP
+#define BSS_SECTION_ASM_OP "\t.section\t.bss"
+#define CTORS_SECTION_ASM_OP "\t.section\t.ctors,\"aw\""
+#define DTORS_SECTION_ASM_OP "\t.section\t.dtors,\"aw\""
+
+/* Remove hpux specific pa defines. */
+#undef LDD_SUFFIX
+#undef PARSE_LDD_OUTPUT
+
+#undef DO_GLOBAL_DTORS_BODY
+#define HAS_INIT_SECTION
diff --git a/gnu/usr.bin/gcc/gcc/config/pa/t-openbsd b/gnu/usr.bin/gcc/gcc/config/pa/t-openbsd
new file mode 100644
index 00000000000..16bd8bbad4e
--- /dev/null
+++ b/gnu/usr.bin/gcc/gcc/config/pa/t-openbsd
@@ -0,0 +1,17 @@
+#Plug millicode routines into libgcc.a We want these on both native and
+#cross compiles. We use the "64-bit" routines because the "32-bit" code
+#is broken for certain corner cases.
+
+LIB1ASMFUNCS = _divI _divU _remI _remU _div_const _mulI _dyncall
+LIB1ASMSRC = pa/milli64.S
+
+# Compile libgcc2.a as PIC.
+TARGET_LIBGCC2_CFLAGS = -DELF=1 -DLINUX
+
+# Don't build a shared libgcc_s.so. Our libgcc contains millicode, and
+# the ABI (linker and dynamic linker really) does not allow millicode
+# to be exported from shared libraries. Consequently, to successfully
+# link against libgcc_s.so it is necessary to link against _both_
+# libgcc_s.so and libgcc.a. This is a pain. It's easier just to disable
+# the shared libgcc.
+SHLIB_LINK =