From cb91f0f41557e80cbd1c5d8549f10a14ff6e41e2 Mon Sep 17 00:00:00 2001 From: kettenis Date: Sun, 1 Aug 2010 21:23:02 +0000 Subject: [PATCH] Add infrastructure to buil GCC 4.2.1 on OpenBSD/sparc. --- gnu/gcc/gcc/config/sparc/openbsd.h | 79 +++++++++++++++++++++++++++++ gnu/usr.bin/cc/Makefile.tgt | 5 +- gnu/usr.bin/cc/cc_tools/size-host.h | 4 +- gnu/usr.bin/cc/libgcc/Makefile | 4 +- 4 files changed, 87 insertions(+), 5 deletions(-) create mode 100644 gnu/gcc/gcc/config/sparc/openbsd.h diff --git a/gnu/gcc/gcc/config/sparc/openbsd.h b/gnu/gcc/gcc/config/sparc/openbsd.h new file mode 100644 index 00000000000..b50733dad94 --- /dev/null +++ b/gnu/gcc/gcc/config/sparc/openbsd.h @@ -0,0 +1,79 @@ +/* Configuration file for sparc OpenBSD target. + Copyright (C) 1999, 2005 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC 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. + +GCC 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 GCC; see the file COPYING. If not, write to +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#undef TARGET_VERSION +#define TARGET_VERSION fprintf (stderr, " (OpenBSD/sparc)") + +/* Target OS builtins. */ +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + OPENBSD_OS_CPP_BUILTINS(); \ + } \ + while (0) + +#undef CPP_SUBTARGET_SPEC +#define CPP_SUBTARGET_SPEC "" + +#undef MD_EXEC_PREFIX +#undef MD_STARTFILE_PREFIX + +#undef ASM_SPEC +#define ASM_SPEC "\ +%{v:-V} -s %{fpic|fPIC|fpie|fPIE:-K PIC} \ +%{mlittle-endian:-EL} \ +%(asm_cpu) %(asm_arch) \ +" + +/* Layout of source language data types. */ +#undef WCHAR_TYPE +#define WCHAR_TYPE "int" + +#undef WCHAR_TYPE_SIZE +#define WCHAR_TYPE_SIZE 32 + +#undef WINT_TYPE +#define WINT_TYPE "int" + +#undef INTMAX_TYPE +#define INTMAX_TYPE "long long int" + +#undef UINTMAX_TYPE +#define UINTMAX_TYPE "long long unsigned int" + +#undef LONG_DOUBLE_TYPE_SIZE +#define LONG_DOUBLE_TYPE_SIZE 64 + +#undef LINK_SPEC +#define LINK_SPEC \ + "%{!shared:%{!nostdlib:%{!r*:%{!e*:-e __start}}}} \ + %{shared:-shared} %{R*} \ + %{static:-Bstatic} \ + %{!static:-Bdynamic} \ + %{assert*} \ + %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so}" + +/* 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}" diff --git a/gnu/usr.bin/cc/Makefile.tgt b/gnu/usr.bin/cc/Makefile.tgt index e536dc17cca..61fd0d59183 100644 --- a/gnu/usr.bin/cc/Makefile.tgt +++ b/gnu/usr.bin/cc/Makefile.tgt @@ -1,5 +1,5 @@ # $FreeBSD: src/gnu/usr.bin/cc/Makefile.tgt,v 1.11.8.1 2009/04/15 03:14:26 kensmith Exp $ -# $OpenBSD: Makefile.tgt,v 1.5 2010/05/09 19:22:51 kettenis Exp $ +# $OpenBSD: Makefile.tgt,v 1.6 2010/08/01 21:23:02 kettenis Exp $ TARGET_ARCH?= ${MACHINE_ARCH} @@ -14,6 +14,9 @@ GCC_CPU= pa TARGET_CPU_DEFAULT= MASK_PA_11 .elif ${TARGET_ARCH} == "powerpc" GCC_CPU= rs6000 +.elif ${TARGET_ARCH} == "sparc" +GCC_CPU= sparc +TARGET_CPU_DEFAULT= TARGET_CPU_v7 .elif ${TARGET_ARCH} == "sparc64" GCC_CPU= sparc TARGET_CPU_DEFAULT= TARGET_CPU_ultrasparc diff --git a/gnu/usr.bin/cc/cc_tools/size-host.h b/gnu/usr.bin/cc/cc_tools/size-host.h index ae730fccaac..4ca9d4ea10e 100644 --- a/gnu/usr.bin/cc/cc_tools/size-host.h +++ b/gnu/usr.bin/cc/cc_tools/size-host.h @@ -1,5 +1,5 @@ /* $FreeBSD: src/gnu/usr.bin/cc/cc_tools/size-host.h,v 1.1.8.1 2009/04/15 03:14:26 kensmith Exp $ */ -/* $OpenBSD: size-host.h,v 1.2 2009/11/02 09:50:39 jsg Exp $ */ +/* $OpenBSD: size-host.h,v 1.3 2010/08/01 21:23:02 kettenis Exp $ */ #ifdef SIZEOF_INT # undef SIZEOF_INT @@ -37,6 +37,6 @@ #undef WORDS_BIGENDIAN #endif -#if defined(__sparc64__) || defined(__ARMEB__) +#if defined(__sparc__) || defined(__sparc64__) || defined(__ARMEB__) #define WORDS_BIGENDIAN 1 #endif diff --git a/gnu/usr.bin/cc/libgcc/Makefile b/gnu/usr.bin/cc/libgcc/Makefile index be17201783e..ab050a1d78f 100644 --- a/gnu/usr.bin/cc/libgcc/Makefile +++ b/gnu/usr.bin/cc/libgcc/Makefile @@ -1,5 +1,5 @@ # $FreeBSD: src/gnu/lib/libgcc/Makefile,v 1.58.8.1 2009/04/15 03:14:26 kensmith Exp $ -# $OpenBSD: Makefile,v 1.11 2010/05/07 18:47:29 kettenis Exp $ +# $OpenBSD: Makefile,v 1.12 2010/08/01 21:23:02 kettenis Exp $ .include @@ -186,7 +186,7 @@ OBJ_GRPS = STD DIV # Floating point emulation functions # .if ${TARGET_ARCH} == "armNOT_YET" || ${TARGET_ARCH} == "powerpc" || \ - ${TARGET_ARCH} == "sparc64" + ${TARGET_ARCH} == "sparc" || ${TARGET_ARCH} == "sparc64" FPBIT_CFLAGS = -DFINE_GRAINED_LIBRARIES -DFLOAT DPBIT_CFLAGS = -DFINE_GRAINED_LIBRARIES -- 2.20.1