- activate powerpc support at last

- explicitly disable tls (Thread-local storage) so it is not incorrectly
detected on some arch(s)

ok espie@
This commit is contained in:
ajacoutot 2007-06-19 21:23:37 +00:00
parent 9aa590ac81
commit 3a20c29c43
7 changed files with 258 additions and 8 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.13 2007/05/16 10:19:14 steven Exp $ # $OpenBSD: Makefile,v 1.14 2007/06/19 21:23:37 ajacoutot Exp $
ONLY_FOR_ARCHS= alpha i386 m68k sparc sparc64 powerpc vax amd64 ONLY_FOR_ARCHS= alpha i386 m68k sparc sparc64 powerpc vax amd64
#BROKEN='adjust for types changes' #BROKEN='adjust for types changes'
@ -8,13 +8,13 @@ DATE=20070307
FULL_VERSION=4.2-${DATE} FULL_VERSION=4.2-${DATE}
FULL_PKGVERSION=4.2.${DATE} FULL_PKGVERSION=4.2.${DATE}
PKGNAME-main= gcc-${FULL_PKGVERSION}p0 PKGNAME-main= gcc-${FULL_PKGVERSION}p1
PKGNAME-c++ = g++-${FULL_PKGVERSION}p0 PKGNAME-c++ = g++-${FULL_PKGVERSION}p1
PKGNAME-estdc= libstdc++-${FULL_PKGVERSION}p0 PKGNAME-estdc= libstdc++-${FULL_PKGVERSION}p1
PKGNAME-g77= g77-${FULL_PKGVERSION}p0 PKGNAME-g77= g77-${FULL_PKGVERSION}p0
PKGNAME-f95= g95-${FULL_PKGVERSION}p0 PKGNAME-f95= g95-${FULL_PKGVERSION}p1
PKGNAME-java= gcj-${FULL_PKGVERSION}p0 PKGNAME-java= gcj-${FULL_PKGVERSION}p0
PKGNAME-objc= gobjc-${FULL_PKGVERSION}p0 PKGNAME-objc= gobjc-${FULL_PKGVERSION}p1
PKGNAME-ada= gnat-${FULL_PKGVERSION}p0 PKGNAME-ada= gnat-${FULL_PKGVERSION}p0
SHARED_LIBS= estdc++ 7.0 \ SHARED_LIBS= estdc++ 7.0 \
gfortran 2.0 \ gfortran 2.0 \
@ -128,6 +128,7 @@ CONFIGURE_ARGS+= \
--with-system-zlib \ --with-system-zlib \
--disable-libmudflap \ --disable-libmudflap \
--disable-libgomp \ --disable-libgomp \
--disable-tls \
--with-as=/usr/bin/as \ --with-as=/usr/bin/as \
--with-ld=/usr/bin/ld \ --with-ld=/usr/bin/ld \
--with-gnu-ld \ --with-gnu-ld \

View File

@ -1,5 +1,5 @@
--- gcc/config.gcc.orig Sat Feb 3 06:25:20 2007 --- gcc/config.gcc.orig Sat Feb 3 06:25:20 2007
+++ gcc/config.gcc Sun Mar 18 23:58:43 2007 +++ gcc/config.gcc Wed Jun 13 20:34:15 2007
@@ -618,7 +618,7 @@ alpha*-*-netbsd*) @@ -618,7 +618,7 @@ alpha*-*-netbsd*)
;; ;;
alpha*-*-openbsd*) alpha*-*-openbsd*)
@ -44,6 +44,23 @@
case ${target} in case ${target} in
mips*el-*-openbsd*) mips*el-*-openbsd*)
tm_defines="${tm_defines} TARGET_ENDIAN_DEFAULT=0";; tm_defines="${tm_defines} TARGET_ENDIAN_DEFAULT=0";;
@@ -1682,11 +1687,11 @@ pdp11-*-bsd)
pdp11-*-*)
use_fixproto=yes
;;
-# port not yet contributed
-#powerpc-*-openbsd*)
-# tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-fprules-fpbit "
-# extra_headers=
-# ;;
+powerpc-*-openbsd*)
+ tm_file="${tm_file} dbxelf.h elfos.h openbsd.h openbsd-libpthread.h freebsd-spec.h rs6000/sysv4.h rs6000/openbsd.h"
+ tmake_file="${tmake_file} rs6000/t-openbsd"
+ extra_options="${extra_options} rs6000/sysv4.opt"
+ ;;
powerpc64-*-linux*)
tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h"
test x$with_cpu != x || cpu_is_64bit=yes
@@ -2150,7 +2155,7 @@ sparc-*-netbsdelf*) @@ -2150,7 +2155,7 @@ sparc-*-netbsdelf*)
extra_options="${extra_options} sparc/long-double-switch.opt" extra_options="${extra_options} sparc/long-double-switch.opt"
;; ;;

View File

@ -0,0 +1,28 @@
$OpenBSD: patch-gcc_config_rs6000_openbsd1_h,v 1.1 2007/06/19 21:23:38 ajacoutot Exp $
--- gcc/config/rs6000/openbsd1.h.orig Tue Jun 12 14:05:16 2007
+++ gcc/config/rs6000/openbsd1.h Tue Jun 12 14:05:16 2007
@@ -0,0 +1,24 @@
+/* Configuration file for an rs6000 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. */
+
+#define OBSD_HAS_CORRECT_SPECS
+#define OBSD_HAS_DECLARE_FUNCTION_NAME
+#define OBSD_HAS_DECLARE_FUNCTION_SIZE
+#define OBSD_HAS_DECLARE_OBJECT

View File

@ -0,0 +1,136 @@
$OpenBSD: patch-gcc_config_rs6000_openbsd_h,v 1.1 2007/06/19 21:23:38 ajacoutot Exp $
--- gcc/config/rs6000/openbsd.h.orig Sat Jun 9 17:11:08 2007
+++ gcc/config/rs6000/openbsd.h Sat Jun 9 18:24:52 2007
@@ -0,0 +1,132 @@
+/* Configuration file for an rs6000 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. */
+
+/* XXX need to check ASM_WEAKEN_LABEL/ASM_GLOBALIZE_LABEL. */
+
+/* Run-time target specifications. */
+#undef TARGET_OS_CPP_BUILTINS /* FIXME: sysv4.h should not define this! */
+#define TARGET_OS_CPP_BUILTINS() \
+ do \
+ { \
+ OPENBSD_OS_CPP_BUILTINS_ELF(); \
+ builtin_define ("__PPC"); \
+ builtin_define ("__PPC__"); \
+ builtin_define ("__powerpc"); \
+ builtin_define ("__powerpc__"); \
+ builtin_assert ("cpu=powerpc"); \
+ builtin_assert ("machine=powerpc"); \
+ } \
+ while (0)
+
+/* Override the default from rs6000.h to avoid conflicts with macros
+ defined in OpenBSD header files. */
+
+#undef RS6000_CPU_CPP_ENDIAN_BUILTINS
+#define RS6000_CPU_CPP_ENDIAN_BUILTINS() \
+ do \
+ { \
+ if (BYTES_BIG_ENDIAN) \
+ { \
+ builtin_define ("__BIG_ENDIAN__"); \
+ builtin_assert ("machine=bigendian"); \
+ } \
+ else \
+ { \
+ builtin_define ("__LITTLE_ENDIAN__"); \
+ builtin_assert ("machine=littleendian"); \
+ } \
+ } \
+ while (0)
+
+#undef CPP_OS_DEFAULT_SPEC
+#define CPP_OS_DEFAULT_SPEC "%(cpp_os_openbsd)"
+
+#undef LINKER_NAME
+#define LINKER_NAME "ld"
+
+#undef LINK_SPEC
+#define LINK_SPEC "%{shared:-shared} \
+ %{!shared: \
+ %{!static: \
+ %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so}} \
+ %{static:-static}}"
+
+#undef LIB_DEFAULT_SPEC
+#define LIB_DEFAULT_SPEC "%(lib_openbsd)"
+
+#undef STARTFILE_DEFAULT_SPEC
+#define STARTFILE_DEFAULT_SPEC "%(startfile_openbsd)"
+
+#undef ENDFILE_DEFAULT_SPEC
+#define ENDFILE_DEFAULT_SPEC "%(endfile_openbsd)"
+
+#undef LINK_START_DEFAULT_SPEC
+#define LINK_START_DEFAULT_SPEC "%(link_start_openbsd)"
+
+#undef LINK_OS_DEFAULT_SPEC
+#define LINK_OS_DEFAULT_SPEC "%(link_os_openbsd)"
+
+#undef TARGET_VERSION
+#define TARGET_VERSION fprintf (stderr, " (PowerPC OpenBSD)");
+
+/* Default ABI to use */
+#undef RS6000_ABI_NAME
+#define RS6000_ABI_NAME "openbsd"
+
+/* Define this macro as a C expression for the initializer of an
+ array of string to tell the driver program which options are
+ defaults for this target and thus do not need to be handled
+ specially when using `MULTILIB_OPTIONS'.
+
+ Do not define this macro if `MULTILIB_OPTIONS' is not defined in
+ the target makefile fragment or if none of the options listed in
+ `MULTILIB_OPTIONS' are set by default. *Note Target Fragment::. */
+
+#undef MULTILIB_DEFAULTS
+#define MULTILIB_DEFAULTS { "mbig", "mcall-openbsd" }
+
+/* collect2 support (Macros for initialization). */
+
+
+/* Don't tell collect2 we use COFF as we don't have (yet ?) a dynamic ld
+ library with the proper functions to handle this -> collect2 will
+ default to using nm. */
+#undef OBJECT_FORMAT_COFF
+
+/* Some code gets optimized incorrectly by move_movables() in loop.c */
+#define BROKEN_MOVE_MOVABLES_P
+
+/* This must agree with <machine/_types.h> */
+#undef SIZE_TYPE
+#define SIZE_TYPE "long unsigned int"
+
+#undef PTRDIFF_TYPE
+#define PTRDIFF_TYPE "long int"
+
+#undef WCHAR_TYPE
+#define WCHAR_TYPE "int"
+
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE 32
+
+#undef TRAMPOLINE_SIZE
+#define TRAMPOLINE_SIZE 40
+

View File

@ -0,0 +1,59 @@
$OpenBSD: patch-gcc_config_rs6000_t-openbsd,v 1.1 2007/06/19 21:23:38 ajacoutot Exp $
--- gcc/config/rs6000/t-openbsd.orig Tue Jun 12 12:23:22 2007
+++ gcc/config/rs6000/t-openbsd Tue Jun 12 12:18:16 2007
@@ -0,0 +1,55 @@
+# include t-rs6000 too
+# this is taken from t-ppccomm
+# but crt* removed.
+
+
+LIB2FUNCS_EXTRA = tramp.S
+
+# This one can't end up in shared libgcc
+LIB2FUNCS_STATIC_EXTRA = eabi.S
+
+# We want fine grained libraries, so use the new code to build the
+# floating point emulation libraries.
+FPBIT = fp-bit.c
+DPBIT = dp-bit.c
+
+
+dp-bit.c: $(srcdir)/config/fp-bit.c
+ cat $(srcdir)/config/fp-bit.c > dp-bit.c
+
+fp-bit.c: $(srcdir)/config/fp-bit.c
+ echo '#define FLOAT' > fp-bit.c
+ cat $(srcdir)/config/fp-bit.c >> fp-bit.c
+
+eabi.S: $(srcdir)/config/rs6000/eabi.asm
+ cat $(srcdir)/config/rs6000/eabi.asm > eabi.S
+
+tramp.S: $(srcdir)/config/rs6000/tramp.asm
+ cat $(srcdir)/config/rs6000/tramp.asm > tramp.S
+
+# Switch synonyms
+MULTILIB_MATCHES_FLOAT = msoft-float=mcpu?401 \
+ msoft-float=mcpu?403 \
+ msoft-float=mcpu?ec603e \
+ msoft-float=mcpu?801 \
+ msoft-float=mcpu?821 \
+ msoft-float=mcpu?823 \
+ msoft-float=mcpu?860
+MULTILIB_MATCHES_ENDIAN = mlittle=mlittle-endian mbig=mbig-endian
+MULTILIB_MATCHES_SYSV = mcall-sysv=mcall-sysv-eabi mcall-sysv=mcall-sysv-noeabi mcall-sysv=mcall-linux mcall-sysv=mcall-netbsd
+
+LIBGCC = stmp-multilib
+INSTALL_LIBGCC = install-multilib
+EXTRA_MULTILIB_PARTS = crtsavres$(objext)
+
+crtsavres.S: $(srcdir)/config/rs6000/crtsavres.asm
+ cat $(srcdir)/config/rs6000/crtsavres.asm >crtsavres.S
+
+$(T)crtsavres$(objext): crtsavres.S
+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c crtsavres.S -o $(T)crtsavres$(objext)
+
+# It is important that crtbegin.o, etc., aren't surprised by stuff in .sdata.
+CRTSTUFF_T_CFLAGS = -msdata=none
+# Make sure crt*.o are built with -fPIC even if configured with
+# --enable-shared --disable-multilib
+CRTSTUFF_T_CFLAGS_S = -fPIC -msdata=none

View File

@ -0,0 +1,8 @@
@comment $OpenBSD: PFRAG.PPC-main,v 1.1 2007/06/19 21:23:38 ajacoutot Exp $
lib/gcc/${CONFIG}/${V}/crtsavres.o
lib/gcc/${CONFIG}/${V}/include/altivec.h
lib/gcc/${CONFIG}/${V}/include/ppc-asm.h
lib/gcc/${CONFIG}/${V}/include/spe.h
lib/gcc/${CONFIG}/${V}/install-tools/include/altivec.h
lib/gcc/${CONFIG}/${V}/install-tools/include/ppc-asm.h
lib/gcc/${CONFIG}/${V}/install-tools/include/spe.h

View File

@ -1,4 +1,4 @@
@comment $OpenBSD: PLIST-main,v 1.3 2007/03/17 22:34:13 espie Exp $ @comment $OpenBSD: PLIST-main,v 1.4 2007/06/19 21:23:38 ajacoutot Exp $
@pkgpath lang/gcc/4.2 @pkgpath lang/gcc/4.2
%%SHARED%% %%SHARED%%
bin/ecpp bin/ecpp
@ -60,6 +60,7 @@ libexec/gcc/${CONFIG}/${V}/install-tools/fixinc.sh
libexec/gcc/${CONFIG}/${V}/install-tools/fixincl libexec/gcc/${CONFIG}/${V}/install-tools/fixincl
libexec/gcc/${CONFIG}/${V}/install-tools/mkheaders libexec/gcc/${CONFIG}/${V}/install-tools/mkheaders
%%I386%% %%I386%%
%%PPC%%
%%PIC%% %%PIC%%
@man man/man1/ecpp.1 @man man/man1/ecpp.1
@man man/man1/egcc.1 @man man/man1/egcc.1