- enable _cxa_atexit support
- implement pre-compiled header support using brk/sbrk. idea from drahn@ okay espie@
This commit is contained in:
parent
191b0e3fd1
commit
2016b12bcd
@ -1,4 +1,4 @@
|
||||
# $OpenBSD: Makefile,v 1.20 2008/02/23 00:26:07 naddy Exp $
|
||||
# $OpenBSD: Makefile,v 1.21 2008/06/12 01:14:06 kurt Exp $
|
||||
|
||||
ONLY_FOR_ARCHS= alpha i386 m68k sparc sparc64 powerpc vax amd64
|
||||
#BROKEN=adjust for types changes
|
||||
@ -8,15 +8,15 @@ DATE=20070307
|
||||
FULL_VERSION=4.2-${DATE}
|
||||
FULL_PKGVERSION=4.2.${DATE}
|
||||
|
||||
PKGNAME-main= gcc-${FULL_PKGVERSION}p5
|
||||
PKGNAME-c++ = g++-${FULL_PKGVERSION}p5
|
||||
PKGNAME-estdc= libstdc++-${FULL_PKGVERSION}p3
|
||||
PKGNAME-g77= g77-${FULL_PKGVERSION}p3
|
||||
PKGNAME-f95= g95-${FULL_PKGVERSION}p5
|
||||
PKGNAME-main= gcc-${FULL_PKGVERSION}p6
|
||||
PKGNAME-c++ = g++-${FULL_PKGVERSION}p6
|
||||
PKGNAME-estdc= libstdc++-${FULL_PKGVERSION}p4
|
||||
PKGNAME-g77= g77-${FULL_PKGVERSION}p4
|
||||
PKGNAME-f95= g95-${FULL_PKGVERSION}p6
|
||||
PKGNAME-java= gcj-${FULL_PKGVERSION}p3
|
||||
PKGNAME-objc= gobjc-${FULL_PKGVERSION}p5
|
||||
PKGNAME-ada= gnat-${FULL_PKGVERSION}p4
|
||||
SHARED_LIBS= estdc++ 7.0 \
|
||||
PKGNAME-objc= gobjc-${FULL_PKGVERSION}p6
|
||||
PKGNAME-ada= gnat-${FULL_PKGVERSION}p5
|
||||
SHARED_LIBS= estdc++ 8.0 \
|
||||
gfortran 2.0 \
|
||||
-org-w3c-dom 1.0 \
|
||||
-org-xml-sax 1.0 \
|
||||
|
@ -1,6 +1,18 @@
|
||||
--- gcc/config.gcc.orig Sat Feb 3 06:25:20 2007
|
||||
+++ gcc/config.gcc Wed Jun 13 20:34:15 2007
|
||||
@@ -618,7 +618,7 @@ alpha*-*-netbsd*)
|
||||
--- gcc/config.gcc.orig Sat Feb 3 00:25:20 2007
|
||||
+++ gcc/config.gcc Thu Apr 10 09:14:05 2008
|
||||
@@ -552,6 +552,11 @@ case ${target} in
|
||||
*-*-openbsd2.*|*-*-openbsd3.[012])
|
||||
tm_defines="${tm_defines} HAS_LIBC_R=1" ;;
|
||||
esac
|
||||
+ case ${target} in
|
||||
+ *-*-openbsd[1-3].*|*-*-openbsd4.[012]) ;;
|
||||
+ *)
|
||||
+ default_use_cxa_atexit=yes ;;
|
||||
+ esac
|
||||
;;
|
||||
*-*-rtems*)
|
||||
case ${enable_threads} in
|
||||
@@ -618,7 +623,7 @@ alpha*-*-netbsd*)
|
||||
;;
|
||||
alpha*-*-openbsd*)
|
||||
tm_defines="${tm_defines} OBSD_NO_DYNAMIC_LIBRARIES OBSD_HAS_DECLARE_FUNCTION_NAME OBSD_HAS_DECLARE_FUNCTION_SIZE OBSD_HAS_DECLARE_OBJECT"
|
||||
@ -9,7 +21,7 @@
|
||||
# default x-alpha is only appropriate for dec-osf.
|
||||
target_cpu_default="MASK_GAS"
|
||||
tmake_file="alpha/t-alpha alpha/t-ieee"
|
||||
@@ -1080,10 +1080,15 @@ i[34567]86-*-openbsd2.*|i[34567]86-*openbsd3.[0123])
|
||||
@@ -1080,10 +1085,15 @@ i[34567]86-*-openbsd2.*|i[34567]86-*openbsd3.[0123])
|
||||
;;
|
||||
i[34567]86-*-openbsd*)
|
||||
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h"
|
||||
@ -26,7 +38,7 @@
|
||||
i[34567]86-*-coff*)
|
||||
tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/i386-coff.h"
|
||||
use_fixproto=yes
|
||||
@@ -1474,7 +1479,7 @@ m68010-*-netbsdelf* | m68k*-*-netbsdelf*)
|
||||
@@ -1474,7 +1484,7 @@ m68010-*-netbsdelf* | m68k*-*-netbsdelf*)
|
||||
m68k*-*-openbsd*)
|
||||
# needed to unconfuse gdb
|
||||
tm_defines="${tm_defines} OBSD_OLD_GAS TARGET_DEFAULT=(MASK_68020|MASK_68881|MASK_BITFIELD)"
|
||||
@ -35,7 +47,7 @@
|
||||
tmake_file="t-libc-ok t-openbsd m68k/t-openbsd"
|
||||
# we need collect2 until our bug is fixed...
|
||||
use_collect2=yes
|
||||
@@ -1564,7 +1569,7 @@ mips*-*-linux*) # Linux MIPS, either endian.
|
||||
@@ -1564,7 +1574,7 @@ mips*-*-linux*) # Linux MIPS, either endian.
|
||||
mips*-*-openbsd*)
|
||||
tm_defines="${tm_defines} OBSD_HAS_DECLARE_FUNCTION_NAME OBSD_HAS_DECLARE_OBJECT OBSD_HAS_CORRECT_SPECS"
|
||||
target_cpu_default="MASK_ABICALLS"
|
||||
@ -44,7 +56,7 @@
|
||||
case ${target} in
|
||||
mips*el-*-openbsd*)
|
||||
tm_defines="${tm_defines} TARGET_ENDIAN_DEFAULT=0";;
|
||||
@@ -1682,11 +1687,11 @@ pdp11-*-bsd)
|
||||
@@ -1682,11 +1692,11 @@ pdp11-*-bsd)
|
||||
pdp11-*-*)
|
||||
use_fixproto=yes
|
||||
;;
|
||||
@ -61,7 +73,7 @@
|
||||
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 +2160,7 @@ sparc-*-netbsdelf*)
|
||||
extra_options="${extra_options} sparc/long-double-switch.opt"
|
||||
;;
|
||||
sparc64-*-openbsd*)
|
||||
@ -70,7 +82,7 @@
|
||||
extra_options="${extra_options} sparc/little-endian.opt"
|
||||
gas=yes gnu_ld=yes
|
||||
with_cpu=ultrasparc
|
||||
@@ -2395,7 +2400,7 @@ vax-*-netbsd*)
|
||||
@@ -2395,7 +2405,7 @@ vax-*-netbsd*)
|
||||
use_collect2=yes
|
||||
;;
|
||||
vax-*-openbsd*)
|
||||
|
@ -1,7 +1,7 @@
|
||||
$OpenBSD: patch-gcc_config_host-openbsd_c,v 1.1.1.1 2006/07/31 09:50:53 espie Exp $
|
||||
--- gcc/config/host-openbsd.c.orig Mon Jan 31 15:01:58 2005
|
||||
+++ gcc/config/host-openbsd.c Mon Jan 31 16:12:04 2005
|
||||
@@ -0,0 +1,41 @@
|
||||
$OpenBSD: patch-gcc_config_host-openbsd_c,v 1.2 2008/06/12 01:14:06 kurt Exp $
|
||||
--- gcc/config/host-openbsd.c.orig Wed Apr 23 07:42:45 2008
|
||||
+++ gcc/config/host-openbsd.c Wed Apr 23 17:57:19 2008
|
||||
@@ -0,0 +1,107 @@
|
||||
+/* OpenBSD host-specific hook definitions.
|
||||
+ Copyright (C) 2005 Free Software Foundation, Inc.
|
||||
+
|
||||
@ -22,24 +22,90 @@ $OpenBSD: patch-gcc_config_host-openbsd_c,v 1.1.1.1 2006/07/31 09:50:53 espie Ex
|
||||
+ Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
+ MA 02111-1307, USA. */
|
||||
+
|
||||
+#include <limits.h>
|
||||
+#include <unistd.h>
|
||||
+
|
||||
+#include "config.h"
|
||||
+#include "system.h"
|
||||
+#include "coretypes.h"
|
||||
+#include <sys/mman.h>
|
||||
+#include "hosthooks.h"
|
||||
+#include "hosthooks-def.h"
|
||||
+
|
||||
+#undef HOST_HOOKS_GT_PCH_GET_ADDRESS
|
||||
+#define HOST_HOOKS_GT_PCH_GET_ADDRESS openbsd_gt_pch_get_address
|
||||
+
|
||||
+#undef HOST_HOOKS_GT_PCH_USE_ADDRESS
|
||||
+#define HOST_HOOKS_GT_PCH_USE_ADDRESS openbsd_gt_pch_use_address
|
||||
+
|
||||
+static int
|
||||
+openbsd_gt_pch_use_address (void *base ATTRIBUTE_UNUSED,
|
||||
+ size_t size ATTRIBUTE_UNUSED, int fd ATTRIBUTE_UNUSED,
|
||||
+ size_t offset ATTRIBUTE_UNUSED)
|
||||
+/* Return the address of the PCH address space, if the PCH will fit in it. */
|
||||
+
|
||||
+void *
|
||||
+openbsd_gt_pch_get_address (size_t size, int fd ATTRIBUTE_UNUSED)
|
||||
+{
|
||||
+ return -1;
|
||||
+ void *base, *addr;
|
||||
+ size_t pgsz;
|
||||
+
|
||||
+ if (size > INT_MAX)
|
||||
+ return NULL;
|
||||
+
|
||||
+ pgsz = sysconf(_SC_PAGESIZE);
|
||||
+ if (pgsz == (size_t)-1)
|
||||
+ return NULL;
|
||||
+
|
||||
+ base = sbrk(0);
|
||||
+
|
||||
+ /* round up to nearest page */
|
||||
+ base = (void *)(((long)base + (pgsz - 1)) & ~(pgsz - 1));
|
||||
+ if (brk(base) != 0)
|
||||
+ return NULL;
|
||||
+
|
||||
+ /* attempt to allocate size */
|
||||
+ addr = sbrk(size);
|
||||
+ if (addr == (void *)-1)
|
||||
+ return NULL;
|
||||
+
|
||||
+ /* deallocate the memory */
|
||||
+ if (brk(base) != 0)
|
||||
+ return NULL;
|
||||
+
|
||||
+ /* confirm addr is as expected */
|
||||
+ if (addr != base)
|
||||
+ return NULL;
|
||||
+
|
||||
+ return base;
|
||||
+}
|
||||
+
|
||||
+/* Return 0 if we can reserve the PCH address space. */
|
||||
+
|
||||
+int
|
||||
+openbsd_gt_pch_use_address (void *base, size_t size, int fd ATTRIBUTE_UNUSED, size_t off ATTRIBUTE_UNUSED)
|
||||
+{
|
||||
+ void *addr;
|
||||
+
|
||||
+ if (size == 0)
|
||||
+ return -1;
|
||||
+
|
||||
+ /* sanity check base address */
|
||||
+ addr = sbrk(0);
|
||||
+ if (addr == (void *)-1 || base < addr)
|
||||
+ return -1;
|
||||
+
|
||||
+ /* set base for sbrk */
|
||||
+ if (brk(base) != 0)
|
||||
+ return -1;
|
||||
+
|
||||
+ /* attempt to get the memory */
|
||||
+ addr = sbrk(size);
|
||||
+ if (addr == (void *)-1)
|
||||
+ return -1;
|
||||
+
|
||||
+ /* sanity check the result */
|
||||
+ if (addr != base) {
|
||||
+ brk(base);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+const struct host_hooks host_hooks = HOST_HOOKS_INITIALIZER;
|
||||
|
@ -1,4 +1,4 @@
|
||||
@comment $OpenBSD: PLIST-c++,v 1.5 2007/03/20 10:48:52 espie Exp $
|
||||
@comment $OpenBSD: PLIST-c++,v 1.6 2008/06/12 01:14:06 kurt Exp $
|
||||
bin/ec++
|
||||
bin/eg++
|
||||
bin/${CONFIG}-ec++
|
||||
@ -505,6 +505,13 @@ include/c++/${V}/${CONFIG}/bits/gthr-tpf.h
|
||||
include/c++/${V}/${CONFIG}/bits/gthr.h
|
||||
include/c++/${V}/${CONFIG}/bits/messages_members.h
|
||||
include/c++/${V}/${CONFIG}/bits/os_defines.h
|
||||
include/c++/${V}/${CONFIG}/bits/stdc++.h
|
||||
include/c++/${V}/${CONFIG}/bits/stdc++.h.gch/
|
||||
include/c++/${V}/${CONFIG}/bits/stdc++.h.gch/O0g.gch
|
||||
include/c++/${V}/${CONFIG}/bits/stdc++.h.gch/O2g.gch
|
||||
include/c++/${V}/${CONFIG}/bits/stdtr1c++.h
|
||||
include/c++/${V}/${CONFIG}/bits/stdtr1c++.h.gch/
|
||||
include/c++/${V}/${CONFIG}/bits/stdtr1c++.h.gch/O2g.gch
|
||||
include/c++/${V}/${CONFIG}/bits/time_members.h
|
||||
include/c++/${V}/iomanip
|
||||
include/c++/${V}/ios
|
||||
@ -574,10 +581,10 @@ include/c++/${V}/tr1/stdio.h
|
||||
include/c++/${V}/tr1/stdlib.h
|
||||
include/c++/${V}/tr1/tgmath.h
|
||||
include/c++/${V}/tr1/tuple
|
||||
include/c++/${V}/tr1/tuple_defs.h
|
||||
include/c++/${V}/tr1/tuple_iterate.h
|
||||
include/c++/${V}/tr1/type_traits
|
||||
include/c++/${V}/tr1/type_traits_fwd.h
|
||||
include/c++/${V}/tr1/tuple_defs.h
|
||||
include/c++/${V}/tr1/unordered_map
|
||||
include/c++/${V}/tr1/unordered_set
|
||||
include/c++/${V}/tr1/utility
|
||||
|
Loading…
x
Reference in New Issue
Block a user