summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2005-01-25 13:24:52 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2005-01-25 13:24:52 +0000
commit1c645c8db47c91a78bf9e3142e060b922173a9fa (patch)
treedea49fc4796ed60ba82b38f3bd2f32e0d33715c1 /gnu
parent715e607ad09ff02a6d54ca9fe356e0a8b7cc4b4f (diff)
hppa64-unknown-openbsd build support; espie@ miod@ brad@ ok
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/binutils/Makefile.bsd-wrapper4
-rw-r--r--gnu/usr.bin/binutils/bfd/config.bfd4
-rw-r--r--gnu/usr.bin/binutils/gas/config/te-obsdhppa64.h25
-rw-r--r--gnu/usr.bin/binutils/gas/configure5
-rw-r--r--gnu/usr.bin/binutils/gas/configure.in5
-rw-r--r--gnu/usr.bin/gcc/gcc/config.gcc8
-rw-r--r--gnu/usr.bin/gcc/gcc/config/pa/pa-openbsd1-64.h1
-rw-r--r--gnu/usr.bin/gcc/gcc/config/pa/pa-openbsd64.h233
-rw-r--r--gnu/usr.bin/gcc/gcc/config/pa/t-openbsd6412
9 files changed, 292 insertions, 5 deletions
diff --git a/gnu/usr.bin/binutils/Makefile.bsd-wrapper b/gnu/usr.bin/binutils/Makefile.bsd-wrapper
index 37119ea081c..4f914c9dc94 100644
--- a/gnu/usr.bin/binutils/Makefile.bsd-wrapper
+++ b/gnu/usr.bin/binutils/Makefile.bsd-wrapper
@@ -1,6 +1,6 @@
-# $OpenBSD: Makefile.bsd-wrapper,v 1.63 2005/01/15 19:54:04 kettenis Exp $
+# $OpenBSD: Makefile.bsd-wrapper,v 1.64 2005/01/25 13:24:51 mickey Exp $
-NEW_BINUTILS=amd64 alpha arm hppa i386 mips64 powerpc sparc sparc64
+NEW_BINUTILS=alpha amd64 arm hppa hppa64 i386 mips64 powerpc sparc sparc64
.for _arch in ${MACHINE_ARCH}
. if !empty(NEW_BINUTILS:M${_arch})
diff --git a/gnu/usr.bin/binutils/bfd/config.bfd b/gnu/usr.bin/binutils/bfd/config.bfd
index 3e071e3e70e..074f7d0ae3a 100644
--- a/gnu/usr.bin/binutils/bfd/config.bfd
+++ b/gnu/usr.bin/binutils/bfd/config.bfd
@@ -360,6 +360,10 @@ case "${targ}" in
;;
#ifdef BFD64
+ hppa64*-*-openbsd*)
+ targ_defvec=bfd_elf64_hppa_vec
+ targ_selvecs=bfd_elf64_hppa_linux_vec
+ ;;
hppa*64*-*-linux-gnu*)
targ_defvec=bfd_elf64_hppa_linux_vec
targ_selvecs=bfd_elf64_hppa_vec
diff --git a/gnu/usr.bin/binutils/gas/config/te-obsdhppa64.h b/gnu/usr.bin/binutils/gas/config/te-obsdhppa64.h
new file mode 100644
index 00000000000..296dc580e88
--- /dev/null
+++ b/gnu/usr.bin/binutils/gas/config/te-obsdhppa64.h
@@ -0,0 +1,25 @@
+/* te-obsdhppa64.h -- OpenBSD target environment declarations.
+ Copyright 2005
+ Free Software Foundation, Inc.
+
+ This file is part of GAS, the GNU Assembler.
+
+ GAS 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.
+
+ GAS 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 GAS; see the file COPYING. If not, write to the Free
+ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
+#define TE_OpenBSD 1
+#define LOCAL_LABELS_FB 1
+#define TARGET_ARCH_SIZE 64
+#include "obj-format.h"
diff --git a/gnu/usr.bin/binutils/gas/configure b/gnu/usr.bin/binutils/gas/configure
index ca7b6338b1a..a35663d3dd0 100644
--- a/gnu/usr.bin/binutils/gas/configure
+++ b/gnu/usr.bin/binutils/gas/configure
@@ -4271,7 +4271,10 @@ for this_target in $target $canon_targets ; do
hppa-*-*elf*) fmt=elf em=hppa ;;
hppa-*-lites*) fmt=elf em=hppa ;;
hppa-*-netbsd*) fmt=elf em=nbsd ;;
- hppa-*-openbsd*) fmt=elf em=obsd ;;
+ hppa-*-openbsd*) case ${cpu} in
+ hppa64) fmt=elf em=obsdhppa64 ;;
+ hppa) fmt=elf em=obsd ;;
+ esac ;;
hppa-*-osf*) fmt=som em=hppa ;;
hppa-*-rtems*) fmt=elf em=hppa ;;
hppa-*-hpux11*) case ${cpu} in
diff --git a/gnu/usr.bin/binutils/gas/configure.in b/gnu/usr.bin/binutils/gas/configure.in
index ead9f9fe423..f28993a30c3 100644
--- a/gnu/usr.bin/binutils/gas/configure.in
+++ b/gnu/usr.bin/binutils/gas/configure.in
@@ -241,7 +241,10 @@ changequote([,])dnl
hppa-*-*elf*) fmt=elf em=hppa ;;
hppa-*-lites*) fmt=elf em=hppa ;;
hppa-*-netbsd*) fmt=elf em=nbsd ;;
- hppa-*-openbsd*) fmt=elf em=obsd ;;
+ hppa-*-openbsd*) case ${cpu} in
+ hppa64) fmt=elf em=obsdhppa64 ;;
+ hppa) fmt=elf em=obsd ;;
+ esac ;;
hppa-*-osf*) fmt=som em=hppa ;;
hppa-*-rtems*) fmt=elf em=hppa ;;
hppa-*-hpux11*) case ${cpu} in
diff --git a/gnu/usr.bin/gcc/gcc/config.gcc b/gnu/usr.bin/gcc/gcc/config.gcc
index 8bca2161852..0de60e22919 100644
--- a/gnu/usr.bin/gcc/gcc/config.gcc
+++ b/gnu/usr.bin/gcc/gcc/config.gcc
@@ -834,7 +834,13 @@ hppa*-*-linux* | parisc*-*-linux*)
pa/pa32-regs.h pa/pa32-linux.h"
tmake_file="t-slibgcc-elf-ver t-linux pa/t-linux"
;;
-hppa*-*-openbsd*)
+hppa64-*-openbsd*)
+ target_cpu_default="(MASK_PA_11 | MASK_PA_20)"
+ tm_file="${openbsd_libspec} pa/pa64-start.h pa/pa.h pa/pa64-regs.h \
+ pa/pa-64.h pa/pa-openbsd1-64.h openbsd.h pa/pa-openbsd64.h"
+ tmake_file="${tmake_file} pa/t-openbsd64"
+ ;;
+hppa-*-openbsd*)
target_cpu_default="MASK_PA_11 | MASK_NO_SPACE_REGS"
tmake_file="t-libc-ok t-openbsd t-openbsd-thread pa/t-openbsd"
;;
diff --git a/gnu/usr.bin/gcc/gcc/config/pa/pa-openbsd1-64.h b/gnu/usr.bin/gcc/gcc/config/pa/pa-openbsd1-64.h
new file mode 100644
index 00000000000..31caf1e9473
--- /dev/null
+++ b/gnu/usr.bin/gcc/gcc/config/pa/pa-openbsd1-64.h
@@ -0,0 +1 @@
+#define OBSD_HAS_DECLARE_FUNCTION_NAME
diff --git a/gnu/usr.bin/gcc/gcc/config/pa/pa-openbsd64.h b/gnu/usr.bin/gcc/gcc/config/pa/pa-openbsd64.h
new file mode 100644
index 00000000000..6a6e544615f
--- /dev/null
+++ b/gnu/usr.bin/gcc/gcc/config/pa/pa-openbsd64.h
@@ -0,0 +1,233 @@
+/* Configuration file for an hppa64 risc OpenBSD target.
+ Copyright (C) 2005 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. */
+
+
+#undef MAX_OFILE_ALIGNMENT
+#define MAX_OFILE_ALIGNMENT 0x8000
+
+/* libc's profiling functions don't need gcc to allocate counters. */
+#define NO_PROFILE_COUNTERS 1
+
+/* Run-time target specifications. */
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS() \
+ do \
+ { \
+ OPENBSD_OS_CPP_BUILTINS_ELF(); \
+ OPENBSD_OS_CPP_BUILTINS_LP64(); \
+ builtin_define ("__hppa64__"); \
+ } \
+ while (0)
+
+
+/* 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*}"
+
+/* 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
+
+/* This is how to output an internal numbered label where
+ PREFIX is the class of label and NUM is the number within the class.
+
+ For most svr4 systems, the convention is that any symbol which begins
+ with a period is not put into the linker symbol table by the assembler. */
+
+#undef ASM_OUTPUT_INTERNAL_LABEL
+#define ASM_OUTPUT_INTERNAL_LABEL(FILE, PREFIX, NUM) \
+ do \
+ { \
+ fprintf (FILE, ".%s%u:\n", PREFIX, (unsigned) (NUM)); \
+ } \
+ while (0)
+
+/* This is how to store into the string LABEL
+ the symbol_ref name of an internal numbered label where
+ PREFIX is the class of label and NUM is the number within the class.
+ This is suitable for output with `assemble_name'.
+
+ For most svr4 systems, the convention is that any symbol which begins
+ with a period is not put into the linker symbol table by the assembler. */
+
+#undef ASM_GENERATE_INTERNAL_LABEL
+#define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM) \
+ do \
+ { \
+ sprintf (LABEL, "*.%s%u", PREFIX, (unsigned) (NUM)); \
+ } \
+ while (0)
+
+/* A C expression whose value is RTL representing the location of the
+ incoming return address at the beginning of any function, before the
+ prologue. You only need to define this macro if you want to support
+ call frame debugging information like that provided by DWARF 2. */
+#define INCOMING_RETURN_ADDR_RTX (gen_rtx_REG (word_mode, 2))
+#define DWARF_FRAME_RETURN_COLUMN (DWARF_FRAME_REGNUM (2))
+
+/* This macro chooses the encoding of pointers embedded in the exception
+ handling sections. If at all possible, this should be defined such
+ that the exception handling section will not require dynamic relocations,
+ and so may be read-only.
+
+ FIXME: We use DW_EH_PE_aligned to output a PLABEL constructor for
+ global function pointers. */
+#define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \
+ (CODE == 2 && GLOBAL ? DW_EH_PE_aligned : DW_EH_PE_absptr)
+
+/* Handle special EH pointer encodings. Absolute, pc-relative, and
+ indirect are handled automatically. Since pc-relative encoding is
+ not possible on the PA and we don't have the infrastructure for
+ data relative encoding, we use aligned plabels for global function
+ pointers. */
+#define ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX(FILE, ENCODING, SIZE, ADDR, DONE) \
+ do { \
+ if (((ENCODING) & 0x0F) == DW_EH_PE_aligned) \
+ { \
+ fputs (integer_asm_op (SIZE, FALSE), FILE); \
+ fputs ("P%", FILE); \
+ assemble_name (FILE, XSTR (ADDR, 0)); \
+ goto DONE; \
+ } \
+ } while (0)
+
+/* 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\""
+#define TARGET_ASM_NAMED_SECTION default_elf_asm_named_section
+
+/* 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-openbsd64 b/gnu/usr.bin/gcc/gcc/config/pa/t-openbsd64
new file mode 100644
index 00000000000..e376d22538e
--- /dev/null
+++ b/gnu/usr.bin/gcc/gcc/config/pa/t-openbsd64
@@ -0,0 +1,12 @@
+#Plug millicode routines into libgcc.a We want these on both native and
+#cross compiles.
+
+LIB1ASMFUNCS = _divI _divU _remI _remU _div_const _mulI
+LIB1ASMSRC = pa/milli64.S
+
+# Compile crtbeginS.o and crtendS.o as PIC.
+# Actually, hppa64 is always PIC but adding -fPIC does no harm.
+CRTSTUFF_T_CFLAGS_S = -fPIC
+
+# Compile libgcc2.a as PIC.
+TARGET_LIBGCC2_CFLAGS = -fPIC -Dpa64=1 -DELF=1