Sat Jan 25 13:38:48 2014 UTC ()
Update to 4.6.4
* Add OpenBSD/amd64 5.4 support
Changelog:
* Bugfixes
(ryoon)
diff -r1.23 -r1.24 pkgsrc/lang/gcc46/Makefile
diff -r1.13 -r1.14 pkgsrc/lang/gcc46/distinfo
diff -r0 -r1.1 pkgsrc/lang/gcc46/files/patch-gcc_targhooks.c-openbsd.diff
diff -r1.3 -r1.4 pkgsrc/lang/gcc46/patches/patch-aa
diff -r1.2 -r1.3 pkgsrc/lang/gcc46/patches/patch-ab
diff -r1.2 -r1.3 pkgsrc/lang/gcc46/patches/patch-ah
diff -r1.2 -r1.3 pkgsrc/lang/gcc46/patches/patch-libstdc++-v3_config_os_bsd_netbsd_ctype__base.h
diff -r0 -r1.1 pkgsrc/lang/gcc46/patches/patch-boehm-gc_configure
diff -r0 -r1.1 pkgsrc/lang/gcc46/patches/patch-boehm-gc_dyn__load.c
diff -r0 -r1.1 pkgsrc/lang/gcc46/patches/patch-boehm-gc_include_gc__config.h.in
diff -r0 -r1.1 pkgsrc/lang/gcc46/patches/patch-boehm-gc_include_gc__config__macros.h
diff -r0 -r1.1 pkgsrc/lang/gcc46/patches/patch-boehm-gc_include_gc__pthread__redirects.h
diff -r0 -r1.1 pkgsrc/lang/gcc46/patches/patch-boehm-gc_include_private_gcconfig.h
diff -r0 -r1.1 pkgsrc/lang/gcc46/patches/patch-boehm-gc_mach__dep.c
diff -r0 -r1.1 pkgsrc/lang/gcc46/patches/patch-boehm-gc_os__dep.c
diff -r0 -r1.1 pkgsrc/lang/gcc46/patches/patch-boehm-gc_pthread__support.c
diff -r0 -r1.1 pkgsrc/lang/gcc46/patches/patch-boehm-gc_tests_test.c
diff -r0 -r1.1 pkgsrc/lang/gcc46/patches/patch-boehm-gc_threadlibs.c
diff -r0 -r1.1 pkgsrc/lang/gcc46/patches/patch-gcc_common.opt
diff -r0 -r1.1 pkgsrc/lang/gcc46/patches/patch-gcc_config.host
diff -r0 -r1.1 pkgsrc/lang/gcc46/patches/patch-gcc_config_exec-stack.h
diff -r0 -r1.1 pkgsrc/lang/gcc46/patches/patch-gcc_config_host-openbsd.c
diff -r0 -r1.1 pkgsrc/lang/gcc46/patches/patch-gcc_config_i386_openbsd.h
diff -r0 -r1.1 pkgsrc/lang/gcc46/patches/patch-gcc_config_i386_openbsd64.h
diff -r0 -r1.1 pkgsrc/lang/gcc46/patches/patch-gcc_config_i386_openbsdelf.h
diff -r0 -r1.1 pkgsrc/lang/gcc46/patches/patch-gcc_config_openbsd-libpthread.h
diff -r0 -r1.1 pkgsrc/lang/gcc46/patches/patch-gcc_config_openbsd.h
diff -r0 -r1.1 pkgsrc/lang/gcc46/patches/patch-gcc_config_t-openbsd
diff -r0 -r1.1 pkgsrc/lang/gcc46/patches/patch-gcc_config_x-openbsd
diff -r0 -r1.1 pkgsrc/lang/gcc46/patches/patch-gcc_configure
diff -r0 -r1.1 pkgsrc/lang/gcc46/patches/patch-gcc_defaults.h
diff -r0 -r1.1 pkgsrc/lang/gcc46/patches/patch-gcc_gcc.c
diff -r0 -r1.1 pkgsrc/lang/gcc46/patches/patch-gcc_lto_lto.c
diff -r0 -r1.1 pkgsrc/lang/gcc46/patches/patch-gcc_opts.c
diff -r0 -r1.1 pkgsrc/lang/gcc46/patches/patch-gcc_unwind-dw2-fde-glibc.c
diff -r0 -r1.1 pkgsrc/lang/gcc46/patches/patch-gcc_unwind-dw2-fde-openbsd.c
diff -r0 -r1.1 pkgsrc/lang/gcc46/patches/patch-libstdc++-v3_include_std_mutex
--- pkgsrc/lang/gcc46/Attic/Makefile 2013/05/31 12:41:11 1.23
+++ pkgsrc/lang/gcc46/Attic/Makefile 2014/01/25 13:38:47 1.24
| @@ -1,30 +1,29 @@ | | | @@ -1,30 +1,29 @@ |
1 | # $NetBSD: Makefile,v 1.23 2013/05/31 12:41:11 wiz Exp $ | | 1 | # $NetBSD: Makefile,v 1.24 2014/01/25 13:38:47 ryoon Exp $ |
2 | | | 2 | |
3 | DISTNAME= gcc-${GCC_VERSION} | | 3 | DISTNAME= gcc-${GCC_VERSION} |
4 | PKGNAME= gcc46-${GCC_VERSION} | | 4 | PKGNAME= gcc46-${GCC_VERSION} |
5 | PKGREVISION= 5 | | | |
6 | CATEGORIES= lang | | 5 | CATEGORIES= lang |
7 | MASTER_SITES= ${MASTER_SITE_GNU:=gcc/gcc-${GCC_VERSION}/} | | 6 | MASTER_SITES= ${MASTER_SITE_GNU:=gcc/gcc-${GCC_VERSION}/} |
8 | EXTRACT_SUFX= .tar.bz2 | | 7 | EXTRACT_SUFX= .tar.bz2 |
9 | | | 8 | |
10 | MAINTAINER= sbd@NetBSD.org | | 9 | MAINTAINER= sbd@NetBSD.org |
11 | HOMEPAGE= http://gcc.gnu.org/ | | 10 | HOMEPAGE= http://gcc.gnu.org/ |
12 | COMMENT= GNU Compiler Collection 4.6 | | 11 | COMMENT= GNU Compiler Collection 4.6 |
13 | LICENSE= gnu-gpl-v2 AND gnu-gpl-v3 AND gnu-lgpl-v2 AND gnu-lgpl-v3 | | 12 | LICENSE= gnu-gpl-v2 AND gnu-gpl-v3 AND gnu-lgpl-v2 AND gnu-lgpl-v3 |
14 | | | 13 | |
15 | USE_TOOLS+= awk:run bash:run chmod gmake:run makeinfo sed:run | | 14 | USE_TOOLS+= awk:run bash:run chmod gmake:run makeinfo sed:run |
16 | | | 15 | |
17 | GCC_VERSION= 4.6.3 | | 16 | GCC_VERSION= 4.6.4 |
18 | | | 17 | |
19 | GCC_SUBPREFIX= gcc46 | | 18 | GCC_SUBPREFIX= gcc46 |
20 | GCC_PREFIX= ${PREFIX}/${GCC_SUBPREFIX} | | 19 | GCC_PREFIX= ${PREFIX}/${GCC_SUBPREFIX} |
21 | FILES_SUBST+= PKGNAME=${PKGNAME} | | 20 | FILES_SUBST+= PKGNAME=${PKGNAME} |
22 | MESSAGE_SUBST+= GCC_PREFIX=${GCC_PREFIX} | | 21 | MESSAGE_SUBST+= GCC_PREFIX=${GCC_PREFIX} |
23 | | | 22 | |
24 | | | 23 | |
25 | # To avoid GNU surprises | | 24 | # To avoid GNU surprises |
26 | CONFIG_SHELL= ${TOOLS_PATH.bash} | | 25 | CONFIG_SHELL= ${TOOLS_PATH.bash} |
27 | | | 26 | |
28 | NOT_FOR_PLATFORM= Interix-*-* DragonFly-*-* | | 27 | NOT_FOR_PLATFORM= Interix-*-* DragonFly-*-* |
29 | UNLIMIT_RESOURCES+= datasize | | 28 | UNLIMIT_RESOURCES+= datasize |
30 | UNLIMIT_RESOURCES+= stacksize | | 29 | UNLIMIT_RESOURCES+= stacksize |
| @@ -105,26 +104,32 @@ CFLAGS+= -I${BUILDLINK_DIR}/include | | | @@ -105,26 +104,32 @@ CFLAGS+= -I${BUILDLINK_DIR}/include |
105 | | | 104 | |
106 | pre-configure: | | 105 | pre-configure: |
107 | .if ${OPSYS} == "DragonFly" | | 106 | .if ${OPSYS} == "DragonFly" |
108 | ${CP} ${FILESDIR}/dragonfly.h ${WRKSRC}/gcc/config/dragonfly.h | | 107 | ${CP} ${FILESDIR}/dragonfly.h ${WRKSRC}/gcc/config/dragonfly.h |
109 | ${CP} ${FILESDIR}/dragonfly-spec.h ${WRKSRC}/gcc/config/dragonfly-spec.h | | 108 | ${CP} ${FILESDIR}/dragonfly-spec.h ${WRKSRC}/gcc/config/dragonfly-spec.h |
110 | ${CP} ${FILESDIR}/i386-dragonfly.h ${WRKSRC}/gcc/config/i386/dragonfly.h | | 109 | ${CP} ${FILESDIR}/i386-dragonfly.h ${WRKSRC}/gcc/config/i386/dragonfly.h |
111 | ${CP} ${FILESDIR}/i386-dragonfly64.h ${WRKSRC}/gcc/config/i386/dragonfly64.h | | 110 | ${CP} ${FILESDIR}/i386-dragonfly64.h ${WRKSRC}/gcc/config/i386/dragonfly64.h |
112 | .endif | | 111 | .endif |
113 | | | 112 | |
114 | .if ${OPSYS} == "NetBSD" | | 113 | .if ${OPSYS} == "NetBSD" |
115 | ${CP} ${WRKSRC}/gcc/config/freebsd-stdint.h ${WRKSRC}/gcc/config/netbsd-stdint.h | | 114 | ${CP} ${WRKSRC}/gcc/config/freebsd-stdint.h ${WRKSRC}/gcc/config/netbsd-stdint.h |
116 | .endif | | 115 | .endif |
117 | | | 116 | |
| | | 117 | # gengtype does not recognize #ifdef. |
| | | 118 | .if ${OPSYS} == "OpenBSD" |
| | | 119 | cd ${WRKSRC}/gcc && \ |
| | | 120 | patch -p1 < ${FILESDIR}/patch-gcc_targhooks.c-openbsd.diff |
| | | 121 | .endif |
| | | 122 | |
118 | do-configure: | | 123 | do-configure: |
119 | ${MKDIR} ${WRKDIR}/obj | | 124 | ${MKDIR} ${WRKDIR}/obj |
120 | cd ${WRKDIR}/obj; ${SETENV} ${CONFIGURE_ENV} ${CONFIG_SHELL} ${WRKSRC}/configure ${CONFIGURE_ARGS} | | 125 | cd ${WRKDIR}/obj; ${SETENV} ${CONFIGURE_ENV} ${CONFIG_SHELL} ${WRKSRC}/configure ${CONFIGURE_ARGS} |
121 | | | 126 | |
122 | do-build: | | 127 | do-build: |
123 | (${_ULIMIT_CMD} cd ${WRKDIR}/obj && ${SETENV} ${MAKE_ENV} ${GMAKE} -j${MAKE_JOBS:U1:Q} ) | | 128 | (${_ULIMIT_CMD} cd ${WRKDIR}/obj && ${SETENV} ${MAKE_ENV} ${GMAKE} -j${MAKE_JOBS:U1:Q} ) |
124 | | | 129 | |
125 | do-test: | | 130 | do-test: |
126 | #.if (${MACHINE_GNU_ARCH} == "x86_64") | | 131 | #.if (${MACHINE_GNU_ARCH} == "x86_64") |
127 | # (cd ${FILESDIR} && ${CP} netbsd64macro.dfs ${WRKSRC}/gcc/testsuite/ada/acats/support/macro.dfs) | | 132 | # (cd ${FILESDIR} && ${CP} netbsd64macro.dfs ${WRKSRC}/gcc/testsuite/ada/acats/support/macro.dfs) |
128 | #.endif | | 133 | #.endif |
129 | (${_ULIMIT_CMD} cd ${WRKDIR}/obj && ${GMAKE} -k check) | | 134 | (${_ULIMIT_CMD} cd ${WRKDIR}/obj && ${GMAKE} -k check) |
130 | | | 135 | |
--- pkgsrc/lang/gcc46/Attic/distinfo 2013/04/30 22:24:15 1.13
+++ pkgsrc/lang/gcc46/Attic/distinfo 2014/01/25 13:38:47 1.14
| @@ -1,19 +1,49 @@ | | | @@ -1,19 +1,49 @@ |
1 | $NetBSD: distinfo,v 1.13 2013/04/30 22:24:15 joerg Exp $ | | 1 | $NetBSD: distinfo,v 1.14 2014/01/25 13:38:47 ryoon Exp $ |
2 | | | 2 | |
3 | SHA1 (gcc-4.6.3.tar.bz2) = ce317ca5c8185b58bc9300182b534608c578637f | | 3 | SHA1 (gcc-4.6.4.tar.bz2) = 63933a8a5cf725626585dbba993c8b0f6db1335d |
4 | RMD160 (gcc-4.6.3.tar.bz2) = 9abb2f940d08fc84f2d91b6a6ce8d662ca889269 | | 4 | RMD160 (gcc-4.6.4.tar.bz2) = 6a58b053812cf75622bc4579e020cd9471f46916 |
5 | Size (gcc-4.6.3.tar.bz2) = 71999439 bytes | | 5 | Size (gcc-4.6.4.tar.bz2) = 72006076 bytes |
6 | SHA1 (patch-aa) = e68232cd14d6be31dd2c45aefb454dde75d0bbba | | 6 | SHA1 (patch-aa) = 8bb19e38cacf5dbf9e9f3cac71211d52ec8358c3 |
7 | SHA1 (patch-ab) = 419dbd3e80b960ac391dba123d8de68abdd35355 | | 7 | SHA1 (patch-ab) = f25d0b276041e57dcfb00638bc4232b4e0f5abb6 |
8 | SHA1 (patch-ac) = 0f708412670eca90c2c8e3fa675cffb14be768cd | | 8 | SHA1 (patch-ac) = 0f708412670eca90c2c8e3fa675cffb14be768cd |
9 | SHA1 (patch-ad) = b5e17219e7b7ba158b9f3e1a67e155fb158b4484 | | 9 | SHA1 (patch-ad) = b5e17219e7b7ba158b9f3e1a67e155fb158b4484 |
10 | SHA1 (patch-af) = e4e194ef29924eb986536972c5f5e9f37d98eba3 | | 10 | SHA1 (patch-af) = e4e194ef29924eb986536972c5f5e9f37d98eba3 |
11 | SHA1 (patch-ag) = 1753d08075de8527d8f14afc3df4afeacb10d507 | | 11 | SHA1 (patch-ag) = 1753d08075de8527d8f14afc3df4afeacb10d507 |
12 | SHA1 (patch-ah) = 8df9292331e68a69481aaabc894f285199a7eb05 | | 12 | SHA1 (patch-ah) = bb08426c9eca792f1af4d87f9ea8c827a452fe47 |
13 | SHA1 (patch-ak) = 377d6ab5d454f0af2709680dd656f0449228aca9 | | 13 | SHA1 (patch-ak) = 377d6ab5d454f0af2709680dd656f0449228aca9 |
14 | SHA1 (patch-al) = 20d16fba8c1b9e578c9df6523397e29a94409990 | | 14 | SHA1 (patch-al) = 20d16fba8c1b9e578c9df6523397e29a94409990 |
| | | 15 | SHA1 (patch-boehm-gc_configure) = 65fa922741428a4a353bf1d3946090eccc0aa809 |
| | | 16 | SHA1 (patch-boehm-gc_dyn__load.c) = 2d73263d33f905f75da8cff501f5e00c0322f334 |
| | | 17 | SHA1 (patch-boehm-gc_include_gc__config.h.in) = 613d5ebbdcb92fc3cd3b04c4a643c70c9b5a7667 |
| | | 18 | SHA1 (patch-boehm-gc_include_gc__config__macros.h) = 106e09e72990591d5eea3beeea9b2c311e5fa6e5 |
| | | 19 | SHA1 (patch-boehm-gc_include_gc__pthread__redirects.h) = 5df4e69665bc69c4a53f80361ed84bc7b7ef7b6f |
| | | 20 | SHA1 (patch-boehm-gc_include_private_gcconfig.h) = 0dfffa8af8c4a6c2f00b561e8750fb2349a5b42e |
| | | 21 | SHA1 (patch-boehm-gc_mach__dep.c) = d91ca0d42357647ccf9fa3f4624bf8eaea2afbf9 |
| | | 22 | SHA1 (patch-boehm-gc_os__dep.c) = d50619167d76eec4ec6b8fb8e9a9ec65d1e8b69c |
| | | 23 | SHA1 (patch-boehm-gc_pthread__support.c) = 1028b0e8604e0477dd80ec20c04ffc00278237a9 |
| | | 24 | SHA1 (patch-boehm-gc_tests_test.c) = f4f2c7a701ef166004746e5f819f7e04c4176b24 |
| | | 25 | SHA1 (patch-boehm-gc_threadlibs.c) = 62cabc51234e1ce5c60e70bef9fc4d8f92b9739d |
| | | 26 | SHA1 (patch-gcc_common.opt) = 52cbab619bbf7df69a902b066a1d0626193f49b0 |
| | | 27 | SHA1 (patch-gcc_config.host) = 5be619aad33ee0ac05d8fb64879be5e530914122 |
15 | SHA1 (patch-gcc_config_arm_elf.h) = 28c67bb698ebe9a3aa45c4cff29f028c82cc7606 | | 28 | SHA1 (patch-gcc_config_arm_elf.h) = 28c67bb698ebe9a3aa45c4cff29f028c82cc7606 |
16 | SHA1 (patch-gcc_config_arm_t-netbsd) = a1682f4f8dc7e393446f19f615737ddfc98fcb7f | | 29 | SHA1 (patch-gcc_config_arm_t-netbsd) = a1682f4f8dc7e393446f19f615737ddfc98fcb7f |
17 | SHA1 (patch-libstdc++-v3_config_os_bsd_netbsd_ctype__base.h) = 7e8413cf45d49890ad7634f9276188413c8ed30a | | 30 | SHA1 (patch-gcc_config_exec-stack.h) = 2ff8a153a41638de2943c4109f38ea3a7c26c00d |
| | | 31 | SHA1 (patch-gcc_config_host-openbsd.c) = 109ce33dbbc19c988637d77dce4d240d6bfc912c |
| | | 32 | SHA1 (patch-gcc_config_i386_openbsd.h) = 0adb1e531eb9d773cbd6944f279e949e59035bd3 |
| | | 33 | SHA1 (patch-gcc_config_i386_openbsd64.h) = c4fdb98de196702afad36a75886967babf49a55a |
| | | 34 | SHA1 (patch-gcc_config_i386_openbsdelf.h) = cd7afa938514dc80fb53c683fb089468c935d2ae |
| | | 35 | SHA1 (patch-gcc_config_openbsd-libpthread.h) = 826aaae4b2dda5a49ec71510f0752aba3c1b0b91 |
| | | 36 | SHA1 (patch-gcc_config_openbsd.h) = a396d14b2df78a4c45d3e51ef7fe960bbc8d5754 |
| | | 37 | SHA1 (patch-gcc_config_t-openbsd) = 662fe8d0c4b58145fb3268bc7ac432a1616c1106 |
| | | 38 | SHA1 (patch-gcc_config_x-openbsd) = b307d75331b9a7f6271698c68f1647a03d204eb9 |
| | | 39 | SHA1 (patch-gcc_configure) = 906906aca782c75b2a053aef272a8472f0a9a9ee |
| | | 40 | SHA1 (patch-gcc_defaults.h) = 72b145fdf9baecc061e90e9634eb5f842215a962 |
| | | 41 | SHA1 (patch-gcc_gcc.c) = 264e561efe02e1e343400ef7dff182e71b358ff5 |
| | | 42 | SHA1 (patch-gcc_lto_lto.c) = 3c7df0691d300d2915388e7ef019b9717a9673d7 |
| | | 43 | SHA1 (patch-gcc_opts.c) = e02ebec8a9de24492a3aba80ee8c742446f2c549 |
| | | 44 | SHA1 (patch-gcc_unwind-dw2-fde-glibc.c) = 704ccc2b1058344586e0ccb8bcd291f41d93ed0a |
| | | 45 | SHA1 (patch-gcc_unwind-dw2-fde-openbsd.c) = 74b7df494848d8d52e4574bac3fa3742cd3ff0d7 |
| | | 46 | SHA1 (patch-libstdc++-v3_config_os_bsd_netbsd_ctype__base.h) = eac78601d0f531c8a49c88eacc59691312f1cf25 |
18 | SHA1 (patch-libstdc++-v3_config_os_bsd_netbsd_ctype__inline.h) = 830038744cbbb713ecc3f960a9509bef16176db9 | | 47 | SHA1 (patch-libstdc++-v3_config_os_bsd_netbsd_ctype__inline.h) = 830038744cbbb713ecc3f960a9509bef16176db9 |
19 | SHA1 (patch-libstdc++-v3_config_os_bsd_netbsd_ctype__noninline.h) = ce481809b051cb281772a0ad4d561241731f7556 | | 48 | SHA1 (patch-libstdc++-v3_config_os_bsd_netbsd_ctype__noninline.h) = ce481809b051cb281772a0ad4d561241731f7556 |
| | | 49 | SHA1 (patch-libstdc++-v3_include_std_mutex) = 872322df9bf7406d9fd3fc1e12dd7573c3c91bd2 |
--- gcc/targhooks.c.orig 2014-01-25 15:53:51.000000000 +0900
+++ gcc/targhooks.c 2014-01-25 15:38:03.000000000 +0900
@@ -56,6 +56,7 @@
#include "tree.h"
#include "expr.h"
#include "output.h"
+#include "c-family/c-common.h"
#include "diagnostic-core.h"
#include "function.h"
#include "target.h"
@@ -658,7 +659,7 @@
rtx x;
t = build_decl (UNKNOWN_LOCATION,
- VAR_DECL, get_identifier ("__stack_chk_guard"),
+ VAR_DECL, get_identifier ("__guard_local"),
ptr_type_node);
TREE_STATIC (t) = 1;
TREE_PUBLIC (t) = 1;
@@ -667,6 +668,8 @@
TREE_THIS_VOLATILE (t) = 1;
DECL_ARTIFICIAL (t) = 1;
DECL_IGNORED_P (t) = 1;
+ DECL_VISIBILITY (t) = VISIBILITY_HIDDEN;
+ DECL_VISIBILITY_SPECIFIED (t) = 1;
/* Do not share RTL as the declaration is visible outside of
current function. */
@@ -679,67 +682,68 @@
return t;
}
-static GTY(()) tree stack_chk_fail_decl;
+static GTY(()) int stack_protect_labelno;
tree
default_external_stack_protect_fail (void)
{
- tree t = stack_chk_fail_decl;
-
- if (t == NULL_TREE)
- {
- t = build_function_type_list (void_type_node, NULL_TREE);
- t = build_decl (UNKNOWN_LOCATION,
- FUNCTION_DECL, get_identifier ("__stack_chk_fail"), t);
- TREE_STATIC (t) = 1;
- TREE_PUBLIC (t) = 1;
- DECL_EXTERNAL (t) = 1;
- TREE_USED (t) = 1;
- TREE_THIS_VOLATILE (t) = 1;
- TREE_NOTHROW (t) = 1;
- DECL_ARTIFICIAL (t) = 1;
- DECL_IGNORED_P (t) = 1;
- DECL_VISIBILITY (t) = VISIBILITY_DEFAULT;
- DECL_VISIBILITY_SPECIFIED (t) = 1;
-
- stack_chk_fail_decl = t;
- }
-
- return build_call_expr (t, 0);
+ tree t, func, type, init, stack_smash_handler;
+ const char *name;
+ size_t length;
+ char name_buf[32];
+
+ if (NULL == (name = fname_as_string (0))) {
+ name = (char *)xmalloc(32);
+ strlcpy (name, "*unknown*", 32);
+ }
+ length = strlen (name);
+ /* Build a decl for __func__. */
+ type = build_array_type (char_type_node,
+ build_index_type (size_int (length)));
+ type = build_qualified_type (type, TYPE_QUAL_CONST);
+
+ init = build_string (length + 1, name);
+ free ((char *) name);
+ TREE_TYPE (init) = type;
+
+ func = build_decl (UNKNOWN_LOCATION, VAR_DECL, NULL_TREE, type);
+ TREE_STATIC (func) = 1;
+ TREE_READONLY (func) = 1;
+ DECL_ARTIFICIAL (func) = 1;
+ ASM_GENERATE_INTERNAL_LABEL (name_buf, "LSSH", stack_protect_labelno++);
+ DECL_NAME (func) = get_identifier (name_buf);
+ DECL_INITIAL (func) = init;
+
+ assemble_variable (func, 0, 0, 0);
+
+ /* Build a decl for __stack_smash_handler. */
+ t = build_pointer_type (TREE_TYPE (func));
+ t = build_function_type_list (void_type_node, t, NULL_TREE);
+ t = build_decl (UNKNOWN_LOCATION,
+ FUNCTION_DECL, get_identifier ("__stack_smash_handler"), t);
+ /* t = build_fn_decl ("__stack_smash_handler", t); */
+ TREE_STATIC (t) = 1;
+ TREE_PUBLIC (t) = 1;
+ DECL_EXTERNAL (t) = 1;
+ TREE_USED (t) = 1;
+ TREE_THIS_VOLATILE (t) = 1;
+ TREE_NOTHROW (t) = 1;
+ DECL_ARTIFICIAL (t) = 1;
+ DECL_IGNORED_P (t) = 1;
+ DECL_VISIBILITY (t) = VISIBILITY_DEFAULT;
+ DECL_VISIBILITY_SPECIFIED (t) = 1;
+
+ stack_smash_handler = t;
+
+ /* Generate a call to __stack_smash_handler(__func__). */
+ t = build_fold_addr_expr (func);
+ return build_call_expr (stack_smash_handler, 1, t);
}
tree
default_hidden_stack_protect_fail (void)
{
-#ifndef HAVE_GAS_HIDDEN
return default_external_stack_protect_fail ();
-#else
- tree t = stack_chk_fail_decl;
-
- if (!flag_pic)
- return default_external_stack_protect_fail ();
-
- if (t == NULL_TREE)
- {
- t = build_function_type_list (void_type_node, NULL_TREE);
- t = build_decl (UNKNOWN_LOCATION, FUNCTION_DECL,
- get_identifier ("__stack_chk_fail_local"), t);
- TREE_STATIC (t) = 1;
- TREE_PUBLIC (t) = 1;
- DECL_EXTERNAL (t) = 1;
- TREE_USED (t) = 1;
- TREE_THIS_VOLATILE (t) = 1;
- TREE_NOTHROW (t) = 1;
- DECL_ARTIFICIAL (t) = 1;
- DECL_IGNORED_P (t) = 1;
- DECL_VISIBILITY_SPECIFIED (t) = 1;
- DECL_VISIBILITY (t) = VISIBILITY_HIDDEN;
-
- stack_chk_fail_decl = t;
- }
-
- return build_call_expr (t, 0);
-#endif
}
bool
--- pkgsrc/lang/gcc46/patches/Attic/patch-aa 2012/04/17 07:48:13 1.3
+++ pkgsrc/lang/gcc46/patches/Attic/patch-aa 2014/01/25 13:38:48 1.4
| @@ -1,24 +1,24 @@ | | | @@ -1,24 +1,24 @@ |
1 | $NetBSD: patch-aa,v 1.3 2012/04/17 07:48:13 sbd Exp $ | | 1 | $NetBSD: patch-aa,v 1.4 2014/01/25 13:38:48 ryoon Exp $ |
2 | | | 2 | |
3 | * Add t-crtstuff to tmake_file on NetBSD. | | 3 | * Add t-crtstuff to tmake_file on NetBSD. |
4 | * Add netbsd-stdint.h to tm_file on NetBSD. | | 4 | * Add netbsd-stdint.h to tm_file on NetBSD. |
5 | * wrap the system stdint.h on NetBSD. | | 5 | * wrap the system stdint.h on NetBSD. |
6 | | | 6 | |
7 | * Add Dragonfly support. | | 7 | * Add Dragonfly support. |
8 | | | 8 | |
9 | --- gcc/config.gcc.orig 2011-07-22 18:44:50.000000000 +0200 | | 9 | --- gcc/config.gcc.orig 2013-03-06 17:40:07.000000000 +0000 |
10 | +++ gcc/config.gcc 2012-03-13 13:40:05.000000000 +0100 | | 10 | +++ gcc/config.gcc |
11 | @@ -561,6 +561,33 @@ | | 11 | @@ -561,6 +561,33 @@ case ${target} in |
12 | # need_64bit_hwint=yes # system compiler has this for all arch! | | 12 | # need_64bit_hwint=yes # system compiler has this for all arch! |
13 | use_gcc_stdint=wrap | | 13 | use_gcc_stdint=wrap |
14 | ;; | | 14 | ;; |
15 | +*-*-dragonfly*) | | 15 | +*-*-dragonfly*) |
16 | + gas=yes | | 16 | + gas=yes |
17 | + gnu_ld=yes | | 17 | + gnu_ld=yes |
18 | + extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o" | | 18 | + extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o" |
19 | + case ${target} in | | 19 | + case ${target} in |
20 | + *-*-dragonfly1 | *-*-dragonfly[1].*) | | 20 | + *-*-dragonfly1 | *-*-dragonfly[1].*) |
21 | + tm_defines="${tm_defines} DFBSD_MAJOR=1" ;; | | 21 | + tm_defines="${tm_defines} DFBSD_MAJOR=1" ;; |
22 | + *-*-dragonfly2 | *-*-dragonfly[2].*) | | 22 | + *-*-dragonfly2 | *-*-dragonfly[2].*) |
23 | + tm_defines="${tm_defines} DFBSD_MAJOR=2" ;; | | 23 | + tm_defines="${tm_defines} DFBSD_MAJOR=2" ;; |
24 | + *-*-dragonfly3 | *-*-dragonfly[3].*) | | 24 | + *-*-dragonfly3 | *-*-dragonfly[3].*) |
| @@ -32,35 +32,78 @@ $NetBSD: patch-aa,v 1.3 2012/04/17 07:48 | | | @@ -32,35 +32,78 @@ $NetBSD: patch-aa,v 1.3 2012/04/17 07:48 |
32 | + esac | | 32 | + esac |
33 | + tmake_file="t-slibgcc-elf-ver t-dragonfly" | | 33 | + tmake_file="t-slibgcc-elf-ver t-dragonfly" |
34 | + case ${enable_threads} in | | 34 | + case ${enable_threads} in |
35 | + "" | yes | posix) | | 35 | + "" | yes | posix) |
36 | + thread_file='posix' | | 36 | + thread_file='posix' |
37 | + tmake_file="${tmake_file} t-dragonfly-thread" | | 37 | + tmake_file="${tmake_file} t-dragonfly-thread" |
38 | + ;; | | 38 | + ;; |
39 | + esac | | 39 | + esac |
40 | + dfbsd_tm_file="${dfbsd_tm_file} dragonfly-spec.h dragonfly.h" | | 40 | + dfbsd_tm_file="${dfbsd_tm_file} dragonfly-spec.h dragonfly.h" |
41 | + ;; | | 41 | + ;; |
42 | *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu) | | 42 | *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu) |
43 | extra_options="$extra_options gnu-user.opt" | | 43 | extra_options="$extra_options gnu-user.opt" |
44 | extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o" | | 44 | extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o" |
45 | @@ -655,6 +682,7 @@ | | 45 | @@ -655,6 +682,7 @@ case ${target} in |
46 | default_use_cxa_atexit=yes | | 46 | default_use_cxa_atexit=yes |
47 | ;; | | 47 | ;; |
48 | esac | | 48 | esac |
49 | + use_gcc_stdint=wrap | | 49 | + use_gcc_stdint=wrap |
50 | ;; | | 50 | ;; |
51 | *-*-openbsd*) | | 51 | *-*-openbsd*) |
52 | tmake_file="t-libc-ok t-openbsd t-libgcc-pic" | | 52 | tmake_file="t-libc-ok t-openbsd t-libgcc-pic" |
53 | @@ -1219,19 +1247,26 @@ | | 53 | @@ -668,6 +696,14 @@ case ${target} in |
| | | 54 | *-*-openbsd2.*|*-*-openbsd3.[012]) |
| | | 55 | tm_defines="${tm_defines} HAS_LIBC_R=1" ;; |
| | | 56 | esac |
| | | 57 | + case ${target} in |
| | | 58 | + *-*-openbsd[0-3].*|*-*-openbsd4.[012]) |
| | | 59 | + # keep default of no cxa_atexit support for these older releases |
| | | 60 | + ;; |
| | | 61 | + *) |
| | | 62 | + default_use_cxa_atexit=yes |
| | | 63 | + ;; |
| | | 64 | + esac |
| | | 65 | ;; |
| | | 66 | *-*-rtems*) |
| | | 67 | case ${enable_threads} in |
| | | 68 | @@ -741,7 +777,7 @@ alpha*-*-netbsd*) |
| | | 69 | tmake_file="${tmake_file} alpha/t-alpha alpha/t-ieee" |
| | | 70 | ;; |
| | | 71 | alpha*-*-openbsd*) |
| | | 72 | - tm_defines="${tm_defines} OBSD_HAS_DECLARE_FUNCTION_NAME OBSD_HAS_DECLARE_FUNCTION_SIZE OBSD_HAS_DECLARE_OBJECT" |
| | | 73 | + tm_defines="${tm_defines} OBSD_HAS_DECLARE_FUNCTION_NAME OBSD_HAS_DECLARE_FUNCTION_SIZE OBSD_HAS_DECLARE_OBJECT PIE_DEFAULT=2" |
| | | 74 | tm_file="alpha/alpha.h alpha/elf.h openbsd.h openbsd-stdint.h alpha/openbsd.h openbsd-libpthread.h" |
| | | 75 | extra_options="${extra_options} openbsd.opt alpha/elf.opt" |
| | | 76 | # default x-alpha is only appropriate for dec-osf. |
| | | 77 | @@ -1057,10 +1093,14 @@ hppa*-*-linux*) |
| | | 78 | tmake_file="$tmake_file pa/t-slibgcc-dwarf-ver" |
| | | 79 | fi |
| | | 80 | ;; |
| | | 81 | -# port not yet contributed. |
| | | 82 | -#hppa*-*-openbsd*) |
| | | 83 | -# target_cpu_default="MASK_PA_11" |
| | | 84 | -# ;; |
| | | 85 | +hppa*-*-openbsd*) |
| | | 86 | + target_cpu_default="MASK_PA_11" |
| | | 87 | + tm_defines="${tm_defines} PIE_DEFAULT=1" |
| | | 88 | + tm_file="${tm_file} dbxelf.h elfos.h openbsd-libpthread.h \ |
| | | 89 | + pa/pa32-regs.h pa/openbsd.h openbsd.h" |
| | | 90 | + tmake_file="${tmake_file} pa/t-openbsd" |
| | | 91 | + extra_options="${extra_options} openbsd.opt" |
| | | 92 | + ;; |
| | | 93 | hppa[12]*-*-hpux10*) |
| | | 94 | case ${target} in |
| | | 95 | hppa1.1-*-* | hppa2*-*-*) |
| | | 96 | @@ -1223,19 +1263,26 @@ x86_64-*-freebsd*) |
54 | tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/x86-64.h i386/freebsd.h i386/freebsd64.h" | | 97 | tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/x86-64.h i386/freebsd.h i386/freebsd64.h" |
55 | tmake_file="${tmake_file} i386/t-crtstuff" | | 98 | tmake_file="${tmake_file} i386/t-crtstuff" |
56 | ;; | | 99 | ;; |
57 | +x86_64-*-dragonfly*) | | 100 | +x86_64-*-dragonfly*) |
58 | + tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${dfbsd_tm_file} i386/x86-64.h i386/dragonfly.h i386/dragonfly64.h" | | 101 | + tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${dfbsd_tm_file} i386/x86-64.h i386/dragonfly.h i386/dragonfly64.h" |
59 | + ;; | | 102 | + ;; |
60 | +i[34567]86-*-dragonfly*) | | 103 | +i[34567]86-*-dragonfly*) |
61 | + tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${dfbsd_tm_file} i386/dragonfly.h" | | 104 | + tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${dfbsd_tm_file} i386/dragonfly.h" |
62 | + ;; | | 105 | + ;; |
63 | i[34567]86-*-netbsdelf*) | | 106 | i[34567]86-*-netbsdelf*) |
64 | - tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/netbsd-elf.h" | | 107 | - tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/netbsd-elf.h" |
65 | + tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/netbsd-elf.h netbsd-stdint.h" | | 108 | + tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/netbsd-elf.h netbsd-stdint.h" |
66 | extra_options="${extra_options} netbsd.opt netbsd-elf.opt" | | 109 | extra_options="${extra_options} netbsd.opt netbsd-elf.opt" |
| @@ -70,13 +113,91 @@ $NetBSD: patch-aa,v 1.3 2012/04/17 07:48 | | | @@ -70,13 +113,91 @@ $NetBSD: patch-aa,v 1.3 2012/04/17 07:48 |
70 | - tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h netbsd.h netbsd-aout.h i386/netbsd.h" | | 113 | - tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h netbsd.h netbsd-aout.h i386/netbsd.h" |
71 | + tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h netbsd.h netbsd-aout.h i386/netbsd.h netbsd-stdint.h" | | 114 | + tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h netbsd.h netbsd-aout.h i386/netbsd.h netbsd-stdint.h" |
72 | extra_options="${extra_options} netbsd.opt" | | 115 | extra_options="${extra_options} netbsd.opt" |
73 | tmake_file="${tmake_file} t-netbsd" | | 116 | tmake_file="${tmake_file} t-netbsd" |
74 | extra_parts="" | | 117 | extra_parts="" |
75 | use_collect2=yes | | 118 | use_collect2=yes |
76 | ;; | | 119 | ;; |
77 | x86_64-*-netbsd*) | | 120 | x86_64-*-netbsd*) |
78 | - tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/x86-64.h i386/netbsd64.h" | | 121 | - tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/x86-64.h i386/netbsd64.h" |
79 | + tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/x86-64.h i386/netbsd64.h netbsd-stdint.h" | | 122 | + tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/x86-64.h i386/netbsd64.h netbsd-stdint.h" |
80 | extra_options="${extra_options} netbsd.opt netbsd-elf.opt" | | 123 | extra_options="${extra_options} netbsd.opt netbsd-elf.opt" |
81 | tmake_file="${tmake_file} i386/t-crtstuff" | | 124 | tmake_file="${tmake_file} i386/t-crtstuff" |
82 | ;; | | 125 | ;; |
| | | 126 | @@ -1248,12 +1295,19 @@ i[34567]86-*-openbsd2.*|i[34567]86-*open |
| | | 127 | use_collect2=yes |
| | | 128 | ;; |
| | | 129 | i[34567]86-*-openbsd*) |
| | | 130 | + tm_defines="${tm_defines} PIE_DEFAULT=1" |
| | | 131 | tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h" |
| | | 132 | tm_file="${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h i386/openbsdelf.h" |
| | | 133 | extra_options="${extra_options} openbsd.opt" |
| | | 134 | gas=yes |
| | | 135 | gnu_ld=yes |
| | | 136 | ;; |
| | | 137 | +x86_64-*-openbsd*) |
| | | 138 | + tm_defines="${tm_defines} PIE_DEFAULT=1" |
| | | 139 | + tm_file="i386/biarch64.h i386/i386.h i386/unix.h i386/att.h dbxelf.h elfos.h openbsd.h openbsd-libpthread.h i386/x86-64.h i386/openbsd64.h" |
| | | 140 | + tm_file="${tm_file} exec-stack.h" |
| | | 141 | + tmake_file="t-libc-ok t-openbsd i386/t-openbsd" |
| | | 142 | + ;; |
| | | 143 | i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | i[34567]86-*-gnu* | i[34567]86-*-kopensolaris*-gnu) |
| | | 144 | # Intel 80386's running GNU/* |
| | | 145 | # with ELF format using glibc 2 |
| | | 146 | @@ -1914,14 +1968,15 @@ mips*-*-linux*) # Linux MIPS, either |
| | | 147 | test x$with_llsc != x || with_llsc=yes |
| | | 148 | ;; |
| | | 149 | mips*-*-openbsd*) |
| | | 150 | - tm_defines="${tm_defines} OBSD_HAS_DECLARE_FUNCTION_NAME OBSD_HAS_DECLARE_OBJECT OBSD_HAS_CORRECT_SPECS" |
| | | 151 | - target_cpu_default="MASK_ABICALLS" |
| | | 152 | - tm_file="mips/mips.h openbsd.h openbsd-stdint.h openbsd-libpthread.h mips/openbsd.h mips/sdb.h" |
| | | 153 | + tm_defines="${tm_defines} OBSD_HAS_DECLARE_FUNCTION_NAME OBSD_HAS_DECLARE_OBJECT OBSD_HAS_CORRECT_SPECS MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_64 PIE_DEFAULT=1" |
| | | 154 | + tm_file="dbxelf.h elfos.h openbsd.h openbsd-stdint.h openbsd-libpthread.h mips/mips.h mips/openbsd64.h" |
| | | 155 | extra_options="${extra_options} openbsd.opt" |
| | | 156 | case ${target} in |
| | | 157 | mips*el-*-openbsd*) |
| | | 158 | - tm_defines="${tm_defines} TARGET_ENDIAN_DEFAULT=0";; |
| | | 159 | - *) tm_defines="${tm_defines} TARGET_ENDIAN_DEFAULT=MASK_BIG_ENDIAN";; |
| | | 160 | + tm_defines="${tm_defines} TARGET_ENDIAN_DEFAULT=0" |
| | | 161 | + target_cpu_default="MASK_ABICALLS";; |
| | | 162 | + *) tm_defines="${tm_defines} TARGET_ENDIAN_DEFAULT=MASK_BIG_ENDIAN" |
| | | 163 | + target_cpu_default="MASK_ABICALLS|MASK_FIX_R4000|MASK_FIX_R4400";; |
| | | 164 | esac |
| | | 165 | ;; |
| | | 166 | mips*-sde-elf*) |
| | | 167 | @@ -2061,10 +2116,11 @@ picochip-*) |
| | | 168 | tmake_file="picochip/t-picochip t-pnt16-warn" |
| | | 169 | ;; |
| | | 170 | # port not yet contributed |
| | | 171 | -#powerpc-*-openbsd*) |
| | | 172 | -# tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-fprules-fpbit " |
| | | 173 | -# extra_headers= |
| | | 174 | -# ;; |
| | | 175 | +powerpc-*-openbsd*) |
| | | 176 | + tm_file="${tm_file} dbxelf.h elfos.h openbsd.h openbsd-libpthread.h freebsd-spec.h rs6000/sysv4.h rs6000/openbsd.h" |
| | | 177 | + tmake_file="${tmake_file} rs6000/t-openbsd" |
| | | 178 | + extra_options="${extra_options} rs6000/sysv4.opt" |
| | | 179 | + ;; |
| | | 180 | powerpc-*-darwin*) |
| | | 181 | extra_options="${extra_options} rs6000/darwin.opt" |
| | | 182 | extra_parts="crt2.o" |
| | | 183 | @@ -2665,6 +2721,7 @@ sparc64-*-netbsd*) |
| | | 184 | tmake_file="${tmake_file} sparc/t-netbsd64" |
| | | 185 | ;; |
| | | 186 | sparc64-*-openbsd*) |
| | | 187 | + tm_defines="${tm_defines} PIE_DEFAULT=2" |
| | | 188 | tm_file="sparc/openbsd1-64.h ${tm_file} dbxelf.h elfos.h sparc/sysv4.h sparc/sp64-elf.h" |
| | | 189 | tm_file="${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h sparc/openbsd64.h" |
| | | 190 | extra_options="${extra_options} openbsd.opt" |
| | | 191 | @@ -2830,6 +2887,12 @@ case ${target} in |
| | | 192 | arch_without_sse2=yes |
| | | 193 | arch_without_64bit=yes |
| | | 194 | ;; |
| | | 195 | + i386-*-openbsd*) |
| | | 196 | + arch=i486 |
| | | 197 | + cpu=generic |
| | | 198 | + arch_without_sse2=yes |
| | | 199 | + arch_without_64bit=yes |
| | | 200 | + ;; |
| | | 201 | i386-*-*) |
| | | 202 | arch=i386 |
| | | 203 | cpu=i386 |
--- pkgsrc/lang/gcc46/patches/Attic/patch-ab 2012/04/17 07:48:13 1.2
+++ pkgsrc/lang/gcc46/patches/Attic/patch-ab 2014/01/25 13:38:48 1.3
| @@ -1,26 +1,53 @@ | | | @@ -1,26 +1,53 @@ |
1 | $NetBSD: patch-ab,v 1.2 2012/04/17 07:48:13 sbd Exp $ | | 1 | $NetBSD: patch-ab,v 1.3 2014/01/25 13:38:48 ryoon Exp $ |
2 | | | 2 | |
3 | * Add Dragonfly support. | | 3 | * Add Dragonfly support. |
4 | | | 4 | |
5 | --- libgcc/config.host.orig 2011-03-14 06:06:23.000000000 +0000 | | 5 | --- libgcc/config.host.orig 2011-11-23 22:15:54.000000000 +0000 |
6 | +++ libgcc/config.host | | 6 | +++ libgcc/config.host |
7 | @@ -159,6 +159,8 @@ case ${host} in | | 7 | @@ -150,6 +150,8 @@ case ${host} in |
8 | # machine-specific sections may refine and add to this | | 8 | # machine-specific sections may refine and add to this |
9 | # configuration. | | 9 | # configuration. |
10 | ;; | | 10 | ;; |
11 | +*-*-dragonfly*) | | 11 | +*-*-dragonfly*) |
12 | + ;; | | 12 | + ;; |
13 | *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu*) | | 13 | *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu*) |
14 | extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o" | | 14 | extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o" |
15 | ;; | | 15 | ;; |
16 | @@ -287,6 +289,10 @@ i[34567]86-*-freebsd*) | | 16 | @@ -257,6 +259,8 @@ hppa*64*-*-linux*) |
| | | 17 | ;; |
| | | 18 | hppa*-*-linux*) |
| | | 19 | ;; |
| | | 20 | +hppa-*-openbsd*) |
| | | 21 | + ;; |
| | | 22 | hppa[12]*-*-hpux10*) |
| | | 23 | ;; |
| | | 24 | hppa*64*-*-hpux11*) |
| | | 25 | @@ -278,6 +282,10 @@ i[34567]86-*-freebsd*) |
17 | x86_64-*-freebsd*) | | 26 | x86_64-*-freebsd*) |
18 | tmake_file="${tmake_file} i386/t-freebsd" | | 27 | tmake_file="${tmake_file} i386/t-freebsd" |
19 | ;; | | 28 | ;; |
20 | +i[34567]86-*-dragonfly*) | | 29 | +i[34567]86-*-dragonfly*) |
21 | + ;; | | 30 | + ;; |
22 | +x86_64-*-dragonfly*) | | 31 | +x86_64-*-dragonfly*) |
23 | + ;; | | 32 | + ;; |
24 | i[34567]86-*-netbsdelf*) | | 33 | i[34567]86-*-netbsdelf*) |
25 | ;; | | 34 | ;; |
26 | i[34567]86-*-netbsd*) | | 35 | i[34567]86-*-netbsd*) |
| | | 36 | @@ -288,6 +296,8 @@ i[34567]86-*-openbsd2.*|i[34567]86-*open |
| | | 37 | ;; |
| | | 38 | i[34567]86-*-openbsd*) |
| | | 39 | ;; |
| | | 40 | +x86_64-*-openbsd*) |
| | | 41 | + ;; |
| | | 42 | i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | i[34567]86-*-gnu*) |
| | | 43 | extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o" |
| | | 44 | tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm" |
| | | 45 | @@ -459,6 +469,8 @@ powerpc-*-freebsd*) |
| | | 46 | ;; |
| | | 47 | powerpc-*-netbsd*) |
| | | 48 | ;; |
| | | 49 | +powerpc-*-openbsd*) |
| | | 50 | + ;; |
| | | 51 | powerpc-*-eabispe*) |
| | | 52 | tmake_file="${tmake_file} rs6000/t-ppccomm" |
| | | 53 | ;; |
--- pkgsrc/lang/gcc46/patches/Attic/patch-ah 2012/04/17 07:48:13 1.2
+++ pkgsrc/lang/gcc46/patches/Attic/patch-ah 2014/01/25 13:38:48 1.3
| @@ -1,25 +1,37 @@ | | | @@ -1,25 +1,37 @@ |
1 | $NetBSD: patch-ah,v 1.2 2012/04/17 07:48:13 sbd Exp $ | | 1 | $NetBSD: patch-ah,v 1.3 2014/01/25 13:38:48 ryoon Exp $ |
2 | | | 2 | |
3 | On NetBSD the 'cabs' and 'cabsf' functions are are __RENAME so that | | 3 | On NetBSD the 'cabs' and 'cabsf' functions are are __RENAME so that |
4 | thay have '__c99_' prefixes. | | 4 | thay have '__c99_' prefixes. |
5 | | | 5 | |
6 | --- gcc/fortran/f95-lang.c.orig 2011-02-24 09:53:26.000000000 +0000 | | 6 | --- gcc/fortran/f95-lang.c.orig 2011-04-05 08:13:16.000000000 +0000 |
7 | +++ gcc/fortran/f95-lang.c | | 7 | +++ gcc/fortran/f95-lang.c |
8 | @@ -824,10 +824,17 @@ gfc_init_builtin_functions (void) | | 8 | @@ -823,10 +823,17 @@ gfc_init_builtin_functions (void) |
9 | | | 9 | |
10 | gfc_define_builtin ("__builtin_cabsl", func_clongdouble_longdouble, | | 10 | gfc_define_builtin ("__builtin_cabsl", func_clongdouble_longdouble, |
11 | BUILT_IN_CABSL, "cabsl", ATTR_CONST_NOTHROW_LEAF_LIST); | | 11 | BUILT_IN_CABSL, "cabsl", ATTR_CONST_NOTHROW_LEAF_LIST); |
12 | +#if defined(__NetBSD__) | | 12 | +#if defined(__NetBSD__) |
13 | + gfc_define_builtin ("__builtin_cabs", func_cdouble_double, | | 13 | + gfc_define_builtin ("__builtin_cabs", func_cdouble_double, |
14 | + BUILT_IN_CABS, "__c99_cabs", ATTR_CONST_NOTHROW_LEAF_LIST); | | 14 | + BUILT_IN_CABS, "__c99_cabs", ATTR_CONST_NOTHROW_LEAF_LIST); |
15 | + gfc_define_builtin ("__builtin_cabsf", func_cfloat_float, | | 15 | + gfc_define_builtin ("__builtin_cabsf", func_cfloat_float, |
16 | + BUILT_IN_CABSF, "__c99_cabsf", ATTR_CONST_NOTHROW_LEAF_LIST); | | 16 | + BUILT_IN_CABSF, "__c99_cabsf", ATTR_CONST_NOTHROW_LEAF_LIST); |
17 | +#else | | 17 | +#else |
18 | gfc_define_builtin ("__builtin_cabs", func_cdouble_double, | | 18 | gfc_define_builtin ("__builtin_cabs", func_cdouble_double, |
19 | BUILT_IN_CABS, "cabs", ATTR_CONST_NOTHROW_LEAF_LIST); | | 19 | BUILT_IN_CABS, "cabs", ATTR_CONST_NOTHROW_LEAF_LIST); |
20 | gfc_define_builtin ("__builtin_cabsf", func_cfloat_float, | | 20 | gfc_define_builtin ("__builtin_cabsf", func_cfloat_float, |
21 | BUILT_IN_CABSF, "cabsf", ATTR_CONST_NOTHROW_LEAF_LIST); | | 21 | BUILT_IN_CABSF, "cabsf", ATTR_CONST_NOTHROW_LEAF_LIST); |
22 | +#endif | | 22 | +#endif |
23 | | | 23 | |
24 | gfc_define_builtin ("__builtin_copysignl", mfunc_longdouble[1], | | 24 | gfc_define_builtin ("__builtin_copysignl", mfunc_longdouble[1], |
25 | BUILT_IN_COPYSIGNL, "copysignl", | | 25 | BUILT_IN_COPYSIGNL, "copysignl", |
| | | 26 | @@ -1163,6 +1170,11 @@ gfc_maybe_initialize_eh (void) |
| | | 27 | using_eh_for_cleanups (); |
| | | 28 | } |
| | | 29 | |
| | | 30 | +const char * |
| | | 31 | +fname_as_string(int pretty_p) |
| | | 32 | +{ |
| | | 33 | + return NULL; |
| | | 34 | +} |
| | | 35 | |
| | | 36 | #include "gt-fortran-f95-lang.h" |
| | | 37 | #include "gtype-fortran.h" |
--- pkgsrc/lang/gcc46/patches/Attic/patch-libstdc++-v3_config_os_bsd_netbsd_ctype__base.h 2013/04/30 22:24:16 1.2
+++ pkgsrc/lang/gcc46/patches/Attic/patch-libstdc++-v3_config_os_bsd_netbsd_ctype__base.h 2014/01/25 13:38:48 1.3
| @@ -1,63 +1,63 @@ | | | @@ -1,63 +1,63 @@ |
1 | $NetBSD: patch-libstdc++-v3_config_os_bsd_netbsd_ctype__base.h,v 1.2 2013/04/30 22:24:16 joerg Exp $ | | 1 | $NetBSD: patch-libstdc++-v3_config_os_bsd_netbsd_ctype__base.h,v 1.3 2014/01/25 13:38:48 ryoon Exp $ |
2 | | | 2 | |
3 | --- libstdc++-v3/config/os/bsd/netbsd/ctype_base.h.orig 2011-01-30 22:39:36.000000000 +0000 | | 3 | --- libstdc++-v3/config/os/bsd/netbsd/ctype_base.h.orig 2012-06-20 08:30:55.000000000 +0000 |
4 | +++ libstdc++-v3/config/os/bsd/netbsd/ctype_base.h | | 4 | +++ libstdc++-v3/config/os/bsd/netbsd/ctype_base.h |
5 | @@ -30,8 +30,6 @@ | | 5 | @@ -30,7 +30,7 @@ |
6 | // Full details can be found from the CVS files at: | | 6 | // Full details can be found from the CVS files at: |
7 | // anoncvs@anoncvs.netbsd.org:/cvsroot/basesrc/include/ctype.h | | 7 | // anoncvs@anoncvs.netbsd.org:/cvsroot/basesrc/include/ctype.h |
8 | // See www.netbsd.org for details of access. | | 8 | // See www.netbsd.org for details of access. |
9 | - | | 9 | - |
10 | -#include <sys/param.h> | | 10 | + |
11 | | | | |
12 | namespace std _GLIBCXX_VISIBILITY(default) | | 11 | namespace std _GLIBCXX_VISIBILITY(default) |
13 | { | | 12 | { |
14 | @@ -45,21 +43,21 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION | | 13 | _GLIBCXX_BEGIN_NAMESPACE_VERSION |
| | | 14 | @@ -43,21 +43,21 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION |
15 | | | 15 | |
16 | // NB: Offsets into ctype<char>::_M_table force a particular size | | 16 | // NB: Offsets into ctype<char>::_M_table force a particular size |
17 | // on the mask type. Because of this, we don't use an enum. | | 17 | // on the mask type. Because of this, we don't use an enum. |
18 | +#if defined(_CTYPE_BL) | | 18 | +#if defined(_CTYPE_BL) |
19 | + typedef unsigned short mask; | | 19 | + typedef unsigned short mask; |
20 | + static const mask upper = _CTYPE_U; | | 20 | + static const mask upper = _CTYPE_U; |
21 | + static const mask lower = _CTYPE_L; | | 21 | + static const mask lower = _CTYPE_L; |
22 | + static const mask alpha = _CTYPE_A; | | 22 | + static const mask alpha = _CTYPE_A; |
23 | + static const mask digit = _CTYPE_D; | | 23 | + static const mask digit = _CTYPE_D; |
24 | + static const mask xdigit = _CTYPE_X; | | 24 | + static const mask xdigit = _CTYPE_X; |
25 | + static const mask space = _CTYPE_S; | | 25 | + static const mask space = _CTYPE_S; |
26 | + static const mask print = _CTYPE_R; | | 26 | + static const mask print = _CTYPE_R; |
27 | + static const mask graph = _CTYPE_G; | | 27 | + static const mask graph = _CTYPE_G; |
28 | + static const mask cntrl = _CTYPE_C; | | 28 | + static const mask cntrl = _CTYPE_C; |
29 | + static const mask punct = _CTYPE_P; | | 29 | + static const mask punct = _CTYPE_P; |
30 | + static const mask alnum = _CTYPE_A | _CTYPE_D; | | 30 | + static const mask alnum = _CTYPE_A | _CTYPE_D; |
31 | +#elif defined(_CTYPE_U) | | 31 | +#elif defined(_CTYPE_U) |
32 | typedef unsigned char mask; | | 32 | typedef unsigned char mask; |
33 | - | | 33 | - |
34 | -#if __NetBSD_Version__ < 599004100 | | 34 | -#ifndef _CTYPE_U |
35 | - static const mask upper = _U; | | 35 | - static const mask upper = _U; |
36 | - static const mask lower = _L; | | 36 | - static const mask lower = _L; |
37 | - static const mask alpha = _U | _L; | | 37 | - static const mask alpha = _U | _L; |
38 | - static const mask digit = _N; | | 38 | - static const mask digit = _N; |
39 | - static const mask xdigit = _N | _X; | | 39 | - static const mask xdigit = _N | _X; |
40 | - static const mask space = _S; | | 40 | - static const mask space = _S; |
41 | - static const mask print = _P | _U | _L | _N | _B; | | 41 | - static const mask print = _P | _U | _L | _N | _B; |
42 | - static const mask graph = _P | _U | _L | _N; | | 42 | - static const mask graph = _P | _U | _L | _N; |
43 | - static const mask cntrl = _C; | | 43 | - static const mask cntrl = _C; |
44 | - static const mask punct = _P; | | 44 | - static const mask punct = _P; |
45 | - static const mask alnum = _U | _L | _N; | | 45 | - static const mask alnum = _U | _L | _N; |
46 | -#else | | 46 | -#else |
47 | static const mask upper = _CTYPE_U; | | 47 | static const mask upper = _CTYPE_U; |
48 | static const mask lower = _CTYPE_L; | | 48 | static const mask lower = _CTYPE_L; |
49 | static const mask alpha = _CTYPE_U | _CTYPE_L; | | 49 | static const mask alpha = _CTYPE_U | _CTYPE_L; |
50 | @@ -71,6 +69,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION | | 50 | @@ -69,6 +69,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION |
51 | static const mask cntrl = _CTYPE_C; | | 51 | static const mask cntrl = _CTYPE_C; |
52 | static const mask punct = _CTYPE_P; | | 52 | static const mask punct = _CTYPE_P; |
53 | static const mask alnum = _CTYPE_U | _CTYPE_L | _CTYPE_N; | | 53 | static const mask alnum = _CTYPE_U | _CTYPE_L | _CTYPE_N; |
54 | +#else | | 54 | +#else |
55 | + typedef unsigned char mask; | | 55 | + typedef unsigned char mask; |
56 | + static const mask upper = _U; | | 56 | + static const mask upper = _U; |
57 | + static const mask lower = _L; | | 57 | + static const mask lower = _L; |
58 | + static const mask alpha = _U | _L; | | 58 | + static const mask alpha = _U | _L; |
59 | + static const mask digit = _N; | | 59 | + static const mask digit = _N; |
60 | + static const mask xdigit = _N | _X; | | 60 | + static const mask xdigit = _N | _X; |
61 | + static const mask space = _S; | | 61 | + static const mask space = _S; |
62 | + static const mask print = _P | _U | _L | _N | _B; | | 62 | + static const mask print = _P | _U | _L | _N | _B; |
63 | + static const mask graph = _P | _U | _L | _N; | | 63 | + static const mask graph = _P | _U | _L | _N; |
$NetBSD: patch-boehm-gc_configure,v 1.1 2014/01/25 13:38:48 ryoon Exp $
--- boehm-gc/configure.orig 2013-04-12 09:58:00.000000000 +0000
+++ boehm-gc/configure
@@ -10756,7 +10756,7 @@ netbsd*)
need_version=no
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ #finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
dynamic_linker='NetBSD (a.out) ld.so'
else
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
@@ -14480,7 +14480,7 @@ openbsd*)
*) need_version=no ;;
esac
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ #finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
shlibpath_var=LD_LIBRARY_PATH
if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
case $host_os in
@@ -14855,6 +14855,11 @@ $as_echo "#define _REENTRANT 1" >>confde
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"Only HP-UX 11 POSIX threads are supported.\"" >&5
$as_echo "$as_me: WARNING: \"Only HP-UX 11 POSIX threads are supported.\"" >&2;}
;;
+ *-*-openbsd*)
+ $as_echo "#define GC_OPENBSD_THREADS 1" >>confdefs.h
+ THREADLIBS=-pthread
+ INCLUDES="$INCLUDES -pthread"
+ ;;
*-*-kfreebsd*-gnu)
$as_echo "#define GC_FREEBSD_THREADS 1" >>confdefs.h
@@ -14995,7 +15000,6 @@ else
POWERPC_DARWIN_FALSE=
fi
-
# Darwin needs a few extra special tests to deal with variation in the
# system headers.
case "$host" in
@@ -15306,6 +15310,9 @@ $as_echo "#define DATASTART_IS_ETEXT 1"
sparc-*-netbsd*)
machdep="sparc_netbsd_mach_dep.lo"
;;
+ sparc*-*-openbsd*)
+ machdep="sparc_mach_dep.lo"
+ ;;
sparc-sun-solaris2.3)
machdep="sparc_mach_dep.lo"
$NetBSD: patch-boehm-gc_dyn__load.c,v 1.1 2014/01/25 13:38:48 ryoon Exp $
--- boehm-gc/dyn_load.c.orig 2010-11-29 14:58:16.000000000 +0000
+++ boehm-gc/dyn_load.c
@@ -60,6 +60,7 @@
!defined(HPUX) && !(defined(LINUX) && defined(__ELF__)) && \
!defined(RS6000) && !defined(SCO_ELF) && !defined(DGUX) && \
!(defined(FREEBSD) && defined(__ELF__)) && \
+ !(defined(OPENBSD) && defined(__ELF__)) && \
!(defined(NETBSD) && defined(__ELF__)) && !defined(HURD) && \
!defined(DARWIN)
--> We only know how to find data segments of dynamic libraries for the
@@ -90,9 +91,9 @@
#if defined(LINUX) && defined(__ELF__) || defined(SCO_ELF) || \
(defined(FREEBSD) && defined(__ELF__)) || defined(DGUX) || \
+ (defined(OPENBSD) && defined(__ELF__)) || \
(defined(NETBSD) && defined(__ELF__)) || defined(HURD)
# include <stddef.h>
-# include <elf.h>
# include <link.h>
#endif
@@ -106,7 +107,7 @@
# define ElfW(type) Elf64_##type
# endif
# else
-# ifdef NETBSD
+# if defined(NETBSD) || defined(OPENBSD)
# if ELFSIZE == 32
# define ElfW(type) Elf32_##type
# else
@@ -301,6 +302,7 @@ void GC_register_dynamic_libraries()
#if defined(LINUX) && defined(__ELF__) || defined(SCO_ELF) || \
(defined(FREEBSD) && defined(__ELF__)) || defined(DGUX) || \
+ (defined(OPENBSD) && defined(__ELF__)) || \
(defined(NETBSD) && defined(__ELF__)) || defined(HURD)
@@ -412,6 +414,10 @@ GC_bool GC_register_main_static_data()
#define HAVE_DL_ITERATE_PHDR
#endif
+#if defined(OPENBSD)
+#define HAVE_DL_ITERATE_PHDR
+#endif
+
#if defined(HAVE_DL_ITERATE_PHDR)
static int GC_register_dynlib_callback(info, size, ptr)
$NetBSD: patch-boehm-gc_include_gc__config.h.in,v 1.1 2014/01/25 13:38:48 ryoon Exp $
--- boehm-gc/include/gc_config.h.in.orig 2012-03-02 18:21:41.000000000 +0000
+++ boehm-gc/include/gc_config.h.in
@@ -30,6 +30,9 @@
/* support FreeBSD threads */
#undef GC_FREEBSD_THREADS
+/* support OpenBSD threads */
+#undef GC_OPENBSD_THREADS
+
/* include support for gcj */
#undef GC_GCJ_SUPPORT
$NetBSD: patch-boehm-gc_include_gc__config__macros.h,v 1.1 2014/01/25 13:38:48 ryoon Exp $
--- boehm-gc/include/gc_config_macros.h.orig 2012-02-10 16:32:36.000000000 +0000
+++ boehm-gc/include/gc_config_macros.h
@@ -20,7 +20,7 @@
defined(GC_IRIX_THREADS) || defined(GC_LINUX_THREADS) || \
defined(GC_HPUX_THREADS) || defined(GC_OSF1_THREADS) || \
defined(GC_DGUX386_THREADS) || defined(GC_DARWIN_THREADS) || \
- defined(GC_AIX_THREADS) || \
+ defined(GC_AIX_THREADS) || defined(GC_OPENBSD_THREADS) || \
(defined(GC_WIN32_THREADS) && defined(__CYGWIN32__))
# define GC_PTHREADS
# endif
@@ -55,6 +55,10 @@
# define GC_FREEBSD_THREADS
# define GC_PTHREADS
# endif
+# if !defined(GC_PTHREADS) && defined(__OpenBSD__)
+# define GC_OPENBSD_THREADS
+# define GC_PTHREADS
+# endif
# if defined(DGUX) && (defined(i386) || defined(__i386__))
# define GC_DGUX386_THREADS
# define GC_PTHREADS
$NetBSD: patch-boehm-gc_include_gc__pthread__redirects.h,v 1.1 2014/01/25 13:38:48 ryoon Exp $
--- boehm-gc/include/gc_pthread_redirects.h.orig 2006-08-21 22:07:30.000000000 +0000
+++ boehm-gc/include/gc_pthread_redirects.h
@@ -52,7 +52,7 @@
int GC_pthread_create(pthread_t *new_thread,
const pthread_attr_t *attr,
void *(*start_routine)(void *), void *arg);
-#ifndef GC_DARWIN_THREADS
+#if !defined(GC_DARWIN_THREADS) && !defined(GC_OPENBSD_THREADS)
int GC_pthread_sigmask(int how, const sigset_t *set, sigset_t *oset);
#endif
int GC_pthread_join(pthread_t thread, void **retval);
@@ -72,8 +72,11 @@
# define pthread_join GC_pthread_join
# define pthread_detach GC_pthread_detach
-#ifndef GC_DARWIN_THREADS
+#if !defined(GC_DARWIN_THREADS) && !defined(GC_OPENBSD_THREADS)
# define pthread_sigmask GC_pthread_sigmask
+#endif
+
+#ifndef GC_DARWIN_THREADS
# define dlopen GC_dlopen
#endif
$NetBSD: patch-boehm-gc_include_private_gcconfig.h,v 1.1 2014/01/25 13:38:48 ryoon Exp $
--- boehm-gc/include/private/gcconfig.h.orig 2012-03-02 18:21:41.000000000 +0000
+++ boehm-gc/include/private/gcconfig.h
@@ -62,7 +62,7 @@
/* Determine the machine type: */
# if defined(__arm__) || defined(__thumb__)
# define ARM32
-# if !defined(LINUX) && !defined(NETBSD)
+# if !defined(LINUX) && !defined(NETBSD) && !defined(OPENBSD)
# define NOSYS
# define mach_type_known
# endif
@@ -77,14 +77,18 @@
# define HP
# define mach_type_known
# endif
-# if defined(OPENBSD) && defined(m68k)
-# define M68K
-# define mach_type_known
-# endif
# if defined(OPENBSD) && defined(__sparc__)
# define SPARC
# define mach_type_known
# endif
+# if defined(OPENBSD) && defined(__arm__)
+# define ARM32
+# define mach_type_known
+# endif
+# if defined(OPENBSD) && defined(__sh__)
+# define SH
+# define mach_type_known
+# endif
# if defined(NETBSD) && (defined(m68k) || defined(__m68k__))
# define M68K
# define mach_type_known
@@ -101,7 +105,7 @@
# define SH
# define mach_type_known
# endif
-# if defined(vax)
+# if defined(vax) || defined(__vax__)
# define VAX
# ifdef ultrix
# define ULTRIX
@@ -119,7 +123,7 @@
# if defined(nec_ews) || defined(_nec_ews)
# define EWS4800
# endif
-# if !defined(LINUX) && !defined(EWS4800) && !defined(NETBSD)
+# if !defined(LINUX) && !defined(EWS4800) && !defined(NETBSD) && !defined(OPENBSD)
# if defined(ultrix) || defined(__ultrix)
# define ULTRIX
# else
@@ -210,7 +214,7 @@
# if defined(_PA_RISC1_0) || defined(_PA_RISC1_1) || defined(_PA_RISC2_0) \
|| defined(hppa) || defined(__hppa__)
# define HP_PA
-# if !defined(LINUX) && !defined(HPUX)
+# if !defined(LINUX) && !defined(HPUX) && !defined(OPENBSD)
# define HPUX
# endif
# define mach_type_known
@@ -231,6 +235,10 @@
# define I386
# define mach_type_known
# endif
+# if defined(OPENBSD) && defined(__amd64)
+# define X86_64
+# define mach_type_known
+# endif
# if defined(LINUX) && defined(__x86_64__)
# define X86_64
# define mach_type_known
@@ -302,6 +310,11 @@
# define MACOS
# define mach_type_known
# endif
+# if defined(__OpenBSD__) && defined(__powerpc__)
+# define POWERPC
+# define OPENBSD
+# define mach_type_known
+# endif
# if defined(macosx) || (defined(__APPLE__) && defined(__MACH__))
# define DARWIN
# if defined(__ppc__) || defined(__ppc64__)
@@ -651,18 +664,6 @@
# ifdef M68K
# define MACH_TYPE "M68K"
# define ALIGNMENT 2
-# ifdef OPENBSD
-# define OS_TYPE "OPENBSD"
-# define HEURISTIC2
-# ifdef __ELF__
-# define DATASTART GC_data_start
-# define DYNAMIC_LOADING
-# else
- extern char etext[];
-# define DATASTART ((ptr_t)(etext))
-# endif
-# define USE_GENERIC_PUSH_REGS
-# endif
# ifdef NETBSD
# define OS_TYPE "NETBSD"
# define HEURISTIC2
@@ -836,6 +837,24 @@
should be looked into some more */
# define NO_PTHREAD_TRYLOCK
# endif
+# ifdef OPENBSD
+# define OS_TYPE "OPENBSD"
+# define ALIGNMENT 4
+# define SIG_SUSPEND SIGXFSZ
+# define SIG_THR_RESTART SIGXCPU
+# ifndef GC_OPENBSD_THREADS
+# include <sys/param.h>
+# include <uvm/uvm_extern.h>
+# define STACKBOTTOM USRSTACK
+# endif
+ extern int __data_start[];
+# define DATASTART ((ptr_t)(__data_start))
+ extern char _end[];
+# define DATAEND ((ptr_t)(&_end))
+# define DYNAMIC_LOADING
+# define USE_MMAP
+# define USE_MMAP_ANON
+# endif
# ifdef FREEBSD
# define ALIGNMENT 4
# define OS_TYPE "FREEBSD"
@@ -994,9 +1013,20 @@
# endif
# ifdef OPENBSD
# define OS_TYPE "OPENBSD"
-# define STACKBOTTOM ((ptr_t) 0xf8000000)
- extern int etext[];
-# define DATASTART ((ptr_t)(etext))
+# define SIG_SUSPEND SIGXFSZ
+# define SIG_THR_RESTART SIGXCPU
+# ifndef GC_OPENBSD_THREADS
+# include <sys/param.h>
+# include <uvm/uvm_extern.h>
+# define STACKBOTTOM USRSTACK
+# endif
+ extern int __data_start[];
+# define DATASTART ((ptr_t)(__data_start))
+ extern char _end[];
+# define DATAEND ((ptr_t)(&_end))
+# define DYNAMIC_LOADING
+# define USE_MMAP
+# define USE_MMAP_ANON
# endif
# ifdef NETBSD
# define OS_TYPE "NETBSD"
@@ -1250,6 +1280,20 @@
# endif
# ifdef OPENBSD
# define OS_TYPE "OPENBSD"
+# define SIG_SUSPEND SIGXFSZ
+# define SIG_THR_RESTART SIGXCPU
+# ifndef GC_OPENBSD_THREADS
+# include <sys/param.h>
+# include <uvm/uvm_extern.h>
+# define STACKBOTTOM USRSTACK
+# endif
+ extern int __data_start[];
+# define DATASTART ((ptr_t)(__data_start))
+ extern char _end[];
+# define DATAEND ((ptr_t)(&_end))
+# define DYNAMIC_LOADING
+# define USE_MMAP
+# define USE_MMAP_ANON
# endif
# ifdef FREEBSD
# define OS_TYPE "FREEBSD"
@@ -1285,7 +1329,7 @@
# ifdef BSDI
# define OS_TYPE "BSDI"
# endif
-# if defined(OPENBSD) || defined(NETBSD) \
+# if defined(NETBSD) \
|| defined(THREE86BSD) || defined(BSDI)
# define HEURISTIC2
extern char etext[];
@@ -1475,6 +1519,24 @@
# define STACKBOTTOM ((ptr_t) 0x7ffff000)
# endif /* _ELF_ */
# endif
+# ifdef OPENBSD
+# define OS_TYPE "OPENBSD"
+# define ALIGNMENT 4
+# define SIG_SUSPEND SIGXFSZ
+# define SIG_THR_RESTART SIGXCPU
+# ifndef GC_OPENBSD_THREADS
+# include <sys/param.h>
+# include <uvm/uvm_extern.h>
+# define STACKBOTTOM USRSTACK
+# endif
+ extern int _fdata[];
+# define DATASTART ((ptr_t)(_fdata))
+ extern char _end[];
+# define DATAEND ((ptr_t)(&_end))
+# define DYNAMIC_LOADING
+# define USE_MMAP
+# define USE_MMAP_ANON
+# endif
# endif
# ifdef RS6000
@@ -1522,7 +1584,7 @@
# define ALIGNMENT 4
# define ALIGN_DOUBLE
# endif
-# if !defined(GC_HPUX_THREADS) && !defined(GC_LINUX_THREADS)
+# if !defined(GC_HPUX_THREADS) && !defined(GC_LINUX_THREADS) && !defined(OPENBSD)
# ifndef LINUX /* For now. */
# define MPROTECT_VDB
# endif
@@ -1574,6 +1636,23 @@
extern int _end[];
# define DATAEND (&_end)
# endif /* LINUX */
+# ifdef OPENBSD
+# define OS_TYPE "OPENBSD"
+# define SIG_SUSPEND SIGXFSZ
+# define SIG_THR_RESTART SIGXCPU
+# ifndef GC_OPENBSD_THREADS
+# include <sys/param.h>
+# include <uvm/uvm_extern.h>
+# define STACKBOTTOM USRSTACK
+# endif
+ extern int __data_start[];
+# define DATASTART ((ptr_t)(__data_start))
+ extern char _end[];
+# define DATAEND ((ptr_t)(&_end))
+# define DYNAMIC_LOADING
+# define USE_MMAP
+# define USE_MMAP_ANON
+# endif
# endif /* HP_PA */
# ifdef ALPHA
@@ -1598,15 +1677,21 @@
# endif
# ifdef OPENBSD
# define OS_TYPE "OPENBSD"
-# define HEURISTIC2
-# ifdef __ELF__ /* since OpenBSD/Alpha 2.9 */
-# define DATASTART GC_data_start
-# define ELFCLASS32 32
-# define ELFCLASS64 64
-# define ELF_CLASS ELFCLASS64
-# else /* ECOFF, until OpenBSD/Alpha 2.7 */
-# define DATASTART ((ptr_t) 0x140000000)
-# endif
+# define ELF_CLASS ELFCLASS64
+# define SIG_SUSPEND SIGXFSZ
+# define SIG_THR_RESTART SIGXCPU
+# ifndef GC_OPENBSD_THREADS
+# include <sys/param.h>
+# include <uvm/uvm_extern.h>
+# define STACKBOTTOM USRSTACK
+# endif
+ extern int __data_start[];
+# define DATASTART ((ptr_t)(__data_start))
+ extern char _end[];
+# define DATAEND ((ptr_t)(&_end))
+# define DYNAMIC_LOADING
+# define USE_MMAP
+# define USE_MMAP_ANON
# endif
# ifdef FREEBSD
# define OS_TYPE "FREEBSD"
@@ -1786,6 +1871,7 @@
# ifdef CX_UX
# define OS_TYPE "CX_UX"
# define DATASTART ((((word)etext + 0x3fffff) & ~0x3fffff) + 0x10000)
+# define STACKBOTTOM ((char*)0xf0000000) /* determined empirically */
# endif
# ifdef DGUX
# define OS_TYPE "DGUX"
@@ -1896,6 +1982,24 @@
# define OS_TYPE "MSWINCE"
# define DATAEND /* not needed */
# endif
+# ifdef OPENBSD
+# define ALIGNMENT 4
+# define OS_TYPE "OPENBSD"
+# define SIG_SUSPEND SIGXFSZ
+# define SIG_THR_RESTART SIGXCPU
+# ifndef GC_OPENBSD_THREADS
+# include <sys/param.h>
+# include <uvm/uvm_extern.h>
+# define STACKBOTTOM USRSTACK
+# endif
+ extern int __data_start[];
+# define DATASTART ((ptr_t)(__data_start))
+ extern char _end[];
+# define DATAEND ((ptr_t)(&_end))
+# define DYNAMIC_LOADING
+# define USE_MMAP
+# define USE_MMAP_ANON
+# endif
# ifdef NOSYS
/* __data_start is usually defined in the target linker script. */
extern int __data_start[];
@@ -1943,6 +2047,23 @@
# define USE_GENERIC_PUSH_REGS
# define DYNAMIC_LOADING
# endif
+# ifdef OPENBSD
+# define OS_TYPE "OPENBSD"
+# define SIG_SUSPEND SIGXFSZ
+# define SIG_THR_RESTART SIGXCPU
+# ifndef GC_OPENBSD_THREADS
+# include <sys/param.h>
+# include <uvm/uvm_extern.h>
+# define STACKBOTTOM USRSTACK
+# endif
+ extern int __data_start[];
+# define DATASTART ((ptr_t)(__data_start))
+ extern char _end[];
+# define DATAEND ((ptr_t)(&_end))
+# define DYNAMIC_LOADING
+# define USE_MMAP
+# define USE_MMAP_ANON
+# endif
# endif
# ifdef SH4
@@ -1976,6 +2097,24 @@
# ifndef HBLKSIZE
# define HBLKSIZE 4096
# endif
+# ifdef OPENBSD
+# define OS_TYPE "OPENBSD"
+# define ELF_CLASS ELFCLASS64
+# define SIG_SUSPEND SIGXFSZ
+# define SIG_THR_RESTART SIGXCPU
+# ifndef GC_OPENBSD_THREADS
+# include <sys/param.h>
+# include <uvm/uvm_extern.h>
+# define STACKBOTTOM USRSTACK
+# endif
+ extern int __data_start[];
+# define DATASTART ((ptr_t)(__data_start))
+ extern char _end[];
+# define DATAEND ((ptr_t)(&_end))
+# define DYNAMIC_LOADING
+# define USE_MMAP
+# define USE_MMAP_ANON
+# endif
# define CACHE_LINE_SIZE 64
# define USE_GENERIC_PUSH_REGS
# ifdef LINUX
$NetBSD: patch-boehm-gc_mach__dep.c,v 1.1 2014/01/25 13:38:48 ryoon Exp $
--- boehm-gc/mach_dep.c.orig 2006-01-25 03:03:14.000000000 +0000
+++ boehm-gc/mach_dep.c
@@ -27,7 +27,7 @@
# endif
# endif
-#if defined(RS6000) || defined(POWERPC)
+#if (defined(RS6000) || defined(POWERPC)) && !defined(OPENBSD)
# include <ucontext.h>
#endif
@@ -417,7 +417,7 @@ ptr_t arg;
/* the stack. */
__builtin_unwind_init();
# else /* !HAVE_BUILTIN_UNWIND_INIT */
-# if defined(RS6000) || defined(POWERPC)
+# if (defined(RS6000) || defined(POWERPC)) && !defined(OPENBSD)
/* FIXME: RS6000 means AIX. */
/* This should probably be used in all Posix/non-gcc */
/* settings. We defer that change to minimize risk. */
$NetBSD: patch-boehm-gc_os__dep.c,v 1.1 2014/01/25 13:38:48 ryoon Exp $
--- boehm-gc/os_dep.c.orig 2010-03-21 19:34:19.000000000 +0000
+++ boehm-gc/os_dep.c
@@ -380,7 +380,7 @@ static void *tiny_sbrk(ptrdiff_t increme
#define sbrk tiny_sbrk
# endif /* ECOS */
-#if (defined(NETBSD) || defined(OPENBSD)) && defined(__ELF__)
+#if defined(NETBSD) && defined(__ELF__)
ptr_t GC_data_start;
void GC_init_netbsd_elf()
@@ -393,6 +393,86 @@ static void *tiny_sbrk(ptrdiff_t increme
}
#endif
+#if defined(OPENBSD)
+ static struct sigaction old_segv_act;
+ sigjmp_buf GC_jmp_buf_openbsd;
+
+ /*ARGSUSED*/
+ void GC_fault_handler_openbsd(int sig)
+ {
+ siglongjmp(GC_jmp_buf_openbsd, 1);
+ }
+
+ /* Return the first nonaddressible location > p or bound */
+ /* Requires allocation lock. */
+ ptr_t GC_find_limit_openbsd(ptr_t p, ptr_t bound)
+ {
+ static volatile ptr_t result;
+ /* Safer if static, since otherwise it may not be */
+ /* preserved across the longjmp. Can safely be */
+ /* static since it's only called with the */
+ /* allocation lock held. */
+ struct sigaction act;
+ size_t pgsz = (size_t)sysconf(_SC_PAGESIZE);
+
+ GC_ASSERT(I_HOLD_LOCK());
+
+ act.sa_handler = GC_fault_handler_openbsd;
+ sigemptyset(&act.sa_mask);
+ act.sa_flags = SA_NODEFER | SA_RESTART;
+ sigaction(SIGSEGV, &act, &old_segv_act);
+
+ if (sigsetjmp(GC_jmp_buf_openbsd, 1) == 0) {
+ result = (ptr_t)(((word)(p)) & ~(pgsz-1));
+ for (;;) {
+ result += pgsz;
+ if (result >= bound) {
+ result = bound;
+ break;
+ }
+ GC_noop1((word)(*result));
+ }
+ }
+
+ sigaction(SIGSEGV, &old_segv_act, 0);
+
+ return(result);
+ }
+
+ /* Return first addressable location > p or bound */
+ /* Requires allocation lock. */
+ ptr_t GC_skip_hole_openbsd(ptr_t p, ptr_t bound)
+ {
+ static volatile ptr_t result;
+ struct sigaction act;
+ size_t pgsz = (size_t)sysconf(_SC_PAGESIZE);
+ static volatile int firstpass;
+
+ GC_ASSERT(I_HOLD_LOCK());
+
+ act.sa_handler = GC_fault_handler_openbsd;
+ sigemptyset(&act.sa_mask);
+ act.sa_flags = SA_NODEFER | SA_RESTART;
+ sigaction(SIGSEGV, &act, &old_segv_act);
+
+ firstpass = 1;
+ result = (ptr_t)(((word)(p)) & ~(pgsz-1));
+ if (sigsetjmp(GC_jmp_buf_openbsd, 1) != 0 || firstpass) {
+ firstpass = 0;
+ result += pgsz;
+ if (result >= bound) {
+ result = bound;
+ } else
+ GC_noop1((word)(*result));
+ }
+
+ sigaction(SIGSEGV, &old_segv_act, 0);
+
+ return(result);
+ }
+#endif
+
+
# ifdef OS2
# include <stddef.h>
@@ -1009,7 +1089,8 @@ ptr_t GC_get_stack_base()
#endif /* FREEBSD_STACKBOTTOM */
#if !defined(BEOS) && !defined(AMIGA) && !defined(MSWIN32) \
- && !defined(MSWINCE) && !defined(OS2) && !defined(NOSYS) && !defined(ECOS)
+ && !defined(MSWINCE) && !defined(OS2) && !defined(NOSYS) && !defined(ECOS) \
+ && !defined(GC_OPENBSD_THREADS)
ptr_t GC_get_stack_base()
{
@@ -1069,6 +1150,25 @@ ptr_t GC_get_stack_base()
# endif /* ! AMIGA, !OS 2, ! MS Windows, !BEOS, !NOSYS, !ECOS */
+#if defined(GC_OPENBSD_THREADS)
+
+/* Find the stack using pthread_stackseg_np() */
+
+# include <sys/signal.h>
+# include <pthread.h>
+# include <pthread_np.h>
+
+#define HAVE_GET_STACK_BASE
+
+ptr_t GC_get_stack_base()
+{
+ stack_t stack;
+ pthread_stackseg_np(pthread_self(), &stack);
+ return stack.ss_sp;
+}
+#endif /* GC_OPENBSD_THREADS */
+
+
/*
* Register static data segment(s) as roots.
* If more data segments are added later then they need to be registered
@@ -1440,6 +1540,32 @@ int * etext_addr;
#else /* !OS2 && !Windows && !AMIGA */
+#if defined(OPENBSD)
+
+/*
+ * Depending on arch alignment there can be multiple holes
+ * between DATASTART & DATAEND. Scan from DATASTART - DATAEND
+ * and register each region.
+ */
+void GC_register_data_segments(void)
+{
+ ptr_t region_start, region_end;
+
+ region_start = DATASTART;
+
+ for(;;) {
+ region_end = GC_find_limit_openbsd(region_start, DATAEND);
+ GC_add_roots_inner(region_start, region_end, FALSE);
+ if (region_end < DATAEND)
+ region_start = GC_skip_hole_openbsd(region_end, DATAEND);
+ else
+ break;
+ }
+}
+
+# else /* !OS2 && !Windows && !AMIGA && !OPENBSD */
+
+
void GC_register_data_segments()
{
# if !defined(PCR) && !defined(SRC_M3) && !defined(MACOS)
@@ -1497,6 +1623,7 @@ void GC_register_data_segments()
/* change. */
}
+# endif /* ! OPENBSD */
# endif /* ! AMIGA */
# endif /* ! MSWIN32 && ! MSWINCE*/
# endif /* ! OS2 */
$NetBSD: patch-boehm-gc_pthread__support.c,v 1.1 2014/01/25 13:38:48 ryoon Exp $
--- boehm-gc/pthread_support.c.orig 2010-12-10 10:09:10.000000000 +0000
+++ boehm-gc/pthread_support.c
@@ -118,6 +118,10 @@
# include <fcntl.h>
# include <signal.h>
+#if defined(GC_OPENBSD_THREADS)
+# include <pthread_np.h>
+#endif
+
#if defined(GC_DARWIN_THREADS)
# include "private/darwin_semaphore.h"
#else
@@ -884,7 +888,7 @@ void GC_thr_init()
GC_nprocs = pthread_num_processors_np();
# endif
# if defined(GC_OSF1_THREADS) || defined(GC_AIX_THREADS) \
- || defined(GC_SOLARIS_PTHREADS)
+ || defined(GC_SOLARIS_PTHREADS) || defined(GC_OPENBSD_THREADS)
GC_nprocs = sysconf(_SC_NPROCESSORS_ONLN);
if (GC_nprocs <= 0) GC_nprocs = 1;
# endif
@@ -1156,6 +1160,10 @@ GC_PTR GC_get_thread_stack_base()
return stack_addr;
# endif
+# elif defined(GC_OPENBSD_THREADS)
+ stack_t stack;
+ pthread_stackseg_np(pthread_self(), &stack);
+ return stack.ss_sp;
# else
# ifdef DEBUG_THREADS
GC_printf0("Can not determine stack base for attached thread");
$NetBSD: patch-boehm-gc_tests_test.c,v 1.1 2014/01/25 13:38:48 ryoon Exp $
--- boehm-gc/tests/test.c.orig 2010-12-10 10:09:10.000000000 +0000
+++ boehm-gc/tests/test.c
@@ -1804,7 +1804,8 @@ main()
pthread_attr_init(&attr);
# if defined(GC_IRIX_THREADS) || defined(GC_FREEBSD_THREADS) \
- || defined(GC_DARWIN_THREADS) || defined(GC_AIX_THREADS)
+ || defined(GC_DARWIN_THREADS) || defined(GC_AIX_THREADS) \
+ || defined(GC_OPENBSD_THREADS)
pthread_attr_setstacksize(&attr, 1000000);
# endif
n_tests = 0;
$NetBSD: patch-boehm-gc_threadlibs.c,v 1.1 2014/01/25 13:38:48 ryoon Exp $
--- boehm-gc/threadlibs.c.orig 2006-01-25 03:03:14.000000000 +0000
+++ boehm-gc/threadlibs.c
@@ -15,6 +15,9 @@ int main()
|| defined(GC_DARWIN_THREADS) || defined(GC_AIX_THREADS)
printf("-lpthread\n");
# endif
+# if defined(GC_OPENBSD_THREADS)
+ printf("-pthread\n");
+# endif
# if defined(GC_FREEBSD_THREADS)
# if (__FREEBSD_version >= 500000)
printf("-lpthread\n");
$NetBSD: patch-gcc_common.opt,v 1.1 2014/01/25 13:38:48 ryoon Exp $
--- gcc/common.opt.orig 2013-01-14 16:35:23.000000000 +0000
+++ gcc/common.opt
@@ -546,6 +546,10 @@ Wlarger-than=
Common RejectNegative Joined UInteger Warning
-Wlarger-than=<number> Warn if an object is larger than <number> bytes
+Wstack-larger-than-
+Common RejectNegative Joined UInteger
+-Wstack-larger-than-<number> Warn if a function is using more than <number> bytes of stack space for its local variables.
+
Wunsafe-loop-optimizations
Common Var(warn_unsafe_loop_optimizations) Warning
Warn if the loop cannot be optimized due to nontrivial assumptions.
@@ -619,7 +623,7 @@ Common Var(warn_switch_enum) Warning
Warn about all enumerated switches missing a specific case
Wsystem-headers
-Common Var(warn_system_headers) Warning
+Common Var(warn_system_headers) Init(1) Warning
Do not suppress warnings from system headers
Wtrampolines
@@ -670,6 +674,10 @@ Wunused-variable
Common Var(warn_unused_variable) Init(-1) Warning
Warn when a variable is unused
+Wvariable-decl
+Common Var(warn_variable_decl)
+Warn about variable-sized declarations
+
Wcoverage-mismatch
Common Var(warn_coverage_mismatch) Init(1) Warning
Warn in case profiles in -fprofile-use do not match
@@ -941,7 +949,7 @@ Common Report Var(flag_delayed_branch) O
Attempt to fill delay slots of branch instructions
fdelete-null-pointer-checks
-Common Report Var(flag_delete_null_pointer_checks) Init(1) Optimization
+Common Report Var(flag_delete_null_pointer_checks)
Delete useless null pointer checks
fdevirtualize
@@ -1164,7 +1172,7 @@ Enable guessing of branch probabilities
; On SVR4 targets, it also controls whether or not to emit a
; string identifying the compiler.
fident
-Common Report Var(flag_no_ident,0)
+Common Report Var(flag_no_ident,0) Init(1)
Process #ident directives
fif-conversion
@@ -1492,7 +1500,7 @@ Common Report Var(flag_pic,2)
Generate position-independent code if possible (large mode)
fPIE
-Common Report Var(flag_pie,2)
+Common Report Var(flag_pie,2) Init(PIE_DEFAULT)
Generate position-independent code for executables if possible (large mode)
fpic
@@ -1782,7 +1790,7 @@ Common RejectNegative Joined Var(common_
-fstack-limit-symbol=<name> Trap if the stack goes past symbol <name>
fstack-protector
-Common Report Var(flag_stack_protect, 1)
+Common Report Var(flag_stack_protect, 1) Init(-1)
Use propolice as a stack protection method
fstack-protector-all
$NetBSD: patch-gcc_config.host,v 1.1 2014/01/25 13:38:48 ryoon Exp $
--- gcc/config.host.orig 2011-02-15 09:49:14.000000000 +0000
+++ gcc/config.host
@@ -268,6 +268,10 @@ case ${host} in
out_host_hook_obj=host-solaris.o
host_xmake_file="${host_xmake_file} x-solaris"
;;
+ *-*-openbsd*)
+ out_host_hook_obj=host-openbsd.o
+ host_xmake_file="${host_xmake_file} x-openbsd"
+ ;;
*-*-linux*)
out_host_hook_obj=host-linux.o
host_xmake_file="${host_xmake_file} x-linux"
$NetBSD: patch-gcc_config_exec-stack.h,v 1.1 2014/01/25 13:38:48 ryoon Exp $
--- gcc/config/exec-stack.h.orig 2014-01-25 06:53:23.000000000 +0000
+++ gcc/config/exec-stack.h
@@ -0,0 +1,40 @@
+/* Enable stack execute around trampoline address.
+ Copyright (C) 2002 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 FINALIZE_TRAMPOLINE
+#define FINALIZE_TRAMPOLINE(TRAMP) \
+ emit_library_call(gen_rtx_SYMBOL_REF (Pmode, "__enable_execute_stack"), \
+ 0, VOIDmode, 1, memory_address (SImode, (TRAMP)), Pmode)
+
+#undef TRANSFER_FROM_TRAMPOLINE
+#define TRANSFER_FROM_TRAMPOLINE \
+extern void __enable_execute_stack (void *); \
+void \
+__enable_execute_stack (addr) \
+ void *addr; \
+{ \
+ long size = getpagesize (); \
+ long mask = ~(size-1); \
+ char *page = (char *) (((long) addr) & mask); \
+ char *end = (char *) ((((long) (addr + TRAMPOLINE_SIZE)) & mask) + size); \
+ \
+ if (mprotect (page, end - page, PROT_READ | PROT_WRITE | PROT_EXEC) < 0) \
+ perror ("mprotect of trampoline code"); \
+}
$NetBSD: patch-gcc_config_host-openbsd.c,v 1.1 2014/01/25 13:38:48 ryoon Exp $
--- gcc/config/host-openbsd.c.orig 2014-01-25 06:53:23.000000000 +0000
+++ gcc/config/host-openbsd.c
@@ -0,0 +1,107 @@
+/* OpenBSD host-specific hook definitions.
+ Copyright (C) 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, 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 "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
+
+/* 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)
+{
+ 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;
$NetBSD: patch-gcc_config_i386_openbsd.h,v 1.1 2014/01/25 13:38:48 ryoon Exp $
--- gcc/config/i386/openbsd.h.orig 2007-08-02 10:49:31.000000000 +0000
+++ gcc/config/i386/openbsd.h
@@ -40,10 +40,10 @@ along with GCC; see the file COPYING3.
/* This must agree with <machine/ansi.h> */
#undef SIZE_TYPE
-#define SIZE_TYPE "unsigned int"
+#define SIZE_TYPE "long unsigned int"
#undef PTRDIFF_TYPE
-#define PTRDIFF_TYPE "int"
+#define PTRDIFF_TYPE "long int"
#undef WCHAR_TYPE
#define WCHAR_TYPE "int"
@@ -51,6 +51,9 @@ along with GCC; see the file COPYING3.
#undef WCHAR_TYPE_SIZE
#define WCHAR_TYPE_SIZE 32
+#undef WINT_TYPE
+#define WINT_TYPE "int"
+
/* Assembler format: overall framework. */
#undef ASM_APP_ON
$NetBSD: patch-gcc_config_i386_openbsd64.h,v 1.1 2014/01/25 13:38:48 ryoon Exp $
--- gcc/config/i386/openbsd64.h.orig 2014-01-25 06:53:23.000000000 +0000
+++ gcc/config/i386/openbsd64.h
@@ -0,0 +1,122 @@
+/* Configuration for an OpenBSD x86-64 target.
+
+ Copyright (C) 2003 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 TARGET_VERSION
+#define TARGET_VERSION fprintf (stderr, " (OpenBSD/x86-64 ELF)")
+
+/* This gets defined in tm.h->linux.h->svr4.h, and keeps us from using
+ libraries compiled with the native cc, so undef it. */
+#undef NO_DOLLAR_IN_LABEL
+
+/* Override the default comment-starter of "/". */
+#undef ASM_COMMENT_START
+#define ASM_COMMENT_START "#"
+
+/* Run-time target specifications */
+
+#define TARGET_OS_CPP_BUILTINS() \
+ do \
+ { \
+ OPENBSD_OS_CPP_BUILTINS_ELF(); \
+ if (TARGET_64BIT) \
+ OPENBSD_OS_CPP_BUILTINS_LP64(); \
+ } \
+ 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}"
+
+/* Layout of source language data types. */
+
+/* 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
+
+/* Assembler format: overall framework. */
+
+#undef ASM_APP_ON
+#define ASM_APP_ON "#APP\n"
+
+#undef ASM_APP_OFF
+#define ASM_APP_OFF "#NO_APP\n"
+
+#undef SET_ASM_OP
+#define SET_ASM_OP "\t.set\t"
+
+/* The following macros were originally stolen from i386v4.h.
+ These have to be defined to get PIC code correct. */
+
+/* Assembler format: dispatch tables. */
+
+/* Assembler format: sections. */
+
+/* Stack & calling: aggregate returns. */
+
+/* Don't default to pcc-struct-return, because gcc is the only compiler, and
+ we want to retain compatibility with older gcc versions. */
+#define DEFAULT_PCC_STRUCT_RETURN 0
+
+/* Assembler format: alignment output. */
+
+/* Stack & calling: profiling. */
+
+/* OpenBSD's profiler recovers all information from the stack pointer.
+ The icky part is not here, but in machine/profile.h. */
+#undef FUNCTION_PROFILER
+#define FUNCTION_PROFILER(FILE, LABELNO) \
+ fputs (flag_pic ? "\tcall __mcount@PLT\n": "\tcall __mcount\n", FILE);
+
+/* Assembler format: exception region output. */
+
+/* Assembler format: alignment output. */
+
+/* Note that we pick up ASM_OUTPUT_MAX_SKIP_ALIGN from i386/gas.h */
+
+/* Note that we pick up ASM_OUTPUT_MI_THUNK from unix.h. */
+
+#undef LINK_SPEC
+#define LINK_SPEC \
+ "%{!shared:%{!nostdlib:%{!r*:%{!e*:-e __start}}}} \
+ %{shared:-shared} %{R*} \
+ %{static:-Bstatic} \
+ %{!static:-Bdynamic} \
+ %{rdynamic:-export-dynamic} \
+ %{assert*} \
+ %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so}"
+
+#define OBSD_HAS_CORRECT_SPECS
+
+#undef JUMP_TABLES_IN_TEXT_SECTION
+#define JUMP_TABLES_IN_TEXT_SECTION (flag_pic)
$NetBSD: patch-gcc_config_i386_openbsdelf.h,v 1.1 2014/01/25 13:38:48 ryoon Exp $
--- gcc/config/i386/openbsdelf.h.orig 2010-12-22 12:06:01.000000000 +0000
+++ gcc/config/i386/openbsdelf.h
@@ -113,9 +113,6 @@ along with GCC; see the file COPYING3.
/* Assembler format: exception region output. */
-/* our configuration still doesn't handle dwarf2 correctly */
-#define DWARF2_UNWIND_INFO 0
-
/* Assembler format: alignment output. */
/* Note that we pick up ASM_OUTPUT_MAX_SKIP_ALIGN from i386/gas.h */
@@ -128,7 +125,10 @@ along with GCC; see the file COPYING3.
%{shared:-shared} %{R*} \
%{static:-Bstatic} \
%{!static:-Bdynamic} \
+ %{rdynamic:-export-dynamic} \
%{assert*} \
-dynamic-linker /usr/libexec/ld.so"
#define OBSD_HAS_CORRECT_SPECS
+
+#define SUBTARGET32_DEFAULT_CPU "i486"
$NetBSD: patch-gcc_config_openbsd-libpthread.h,v 1.1 2014/01/25 13:38:48 ryoon Exp $
--- gcc/config/openbsd-libpthread.h.orig 2009-09-27 13:20:23.000000000 +0000
+++ gcc/config/openbsd-libpthread.h
@@ -18,5 +18,5 @@
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
-#define OBSD_LIB_SPEC "%{!shared:%{pthread:-lpthread} -lc}"
+#define OBSD_LIB_SPEC "%{pthread:-lpthread%{!shared:%{p|pg:_p}}} %{!shared:-lc%{p:_p}%{!p:%{pg:_p}}}"
$NetBSD: patch-gcc_config_openbsd.h,v 1.1 2014/01/25 13:38:48 ryoon Exp $
--- gcc/config/openbsd.h.orig 2010-12-22 12:06:01.000000000 +0000
+++ gcc/config/openbsd.h
@@ -109,9 +109,9 @@ while (0)
This two-stage defines makes it easy to pick that for targets that
have subspecs. */
#ifdef CPP_CPU_SPEC
-#define OBSD_CPP_SPEC "%(cpp_cpu) %{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS}"
+#define OBSD_CPP_SPEC "%(cpp_cpu) %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
#else
-#define OBSD_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS}"
+#define OBSD_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
#endif
#undef LIB_SPEC
$NetBSD: patch-gcc_config_t-openbsd,v 1.1 2014/01/25 13:38:48 ryoon Exp $
--- gcc/config/t-openbsd.orig 2003-09-23 18:56:00.000000000 +0000
+++ gcc/config/t-openbsd
@@ -1,2 +1,7 @@
# We don't need GCC's own include files.
-USER_H =
+USER_H = $(EXTRA_HEADERS)
+# Use unwind-dw2-fde-glibc
+LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-openbsd.c \
+ $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
+LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h unwind-dw2-fde.c \
+ unwind-dw2-fde-glibc.c
$NetBSD: patch-gcc_config_x-openbsd,v 1.1 2014/01/25 13:38:48 ryoon Exp $
--- gcc/config/x-openbsd.orig 2014-01-25 06:53:23.000000000 +0000
+++ gcc/config/x-openbsd
@@ -0,0 +1,4 @@
+host-openbsd.o : $(srcdir)/config/host-openbsd.c $(CONFIG_H) $(SYSTEM_H) \
+ coretypes.h hosthooks.h hosthooks-def.h $(HOOKS_H)
+ $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
+ $(srcdir)/config/host-openbsd.c
$NetBSD: patch-gcc_configure,v 1.1 2014/01/25 13:38:48 ryoon Exp $
--- gcc/configure.orig 2013-01-14 16:35:23.000000000 +0000
+++ gcc/configure
@@ -25814,6 +25814,7 @@ else
fi
;;
+ *-*-openbsd*) gcc_cv_libc_provides_ssp=no ;;
*) gcc_cv_libc_provides_ssp=no ;;
esac
fi
$NetBSD: patch-gcc_defaults.h,v 1.1 2014/01/25 13:38:48 ryoon Exp $
--- gcc/defaults.h.orig 2010-11-29 14:09:41.000000000 +0000
+++ gcc/defaults.h
@@ -1337,6 +1337,10 @@ see the files COPYING3 and COPYING.RUNTI
#define SWITCHABLE_TARGET 0
#endif
+#ifndef PIE_DEFAULT
+#define PIE_DEFAULT 0
+#endif
+
#endif /* GCC_INSN_FLAGS_H */
#endif /* ! GCC_DEFAULTS_H */
$NetBSD: patch-gcc_gcc.c,v 1.1 2014/01/25 13:38:48 ryoon Exp $
--- gcc/gcc.c.orig 2013-01-14 16:35:23.000000000 +0000
+++ gcc/gcc.c
@@ -609,7 +609,7 @@ proper position among the other output f
#ifndef LINK_PIE_SPEC
#ifdef HAVE_LD_PIE
-#define LINK_PIE_SPEC "%{pie:-pie} "
+#define LINK_PIE_SPEC "%{pie:-pie} %{p|pg|nopie:-nopie} "
#else
#define LINK_PIE_SPEC "%{pie:} "
#endif
$NetBSD: patch-gcc_lto_lto.c,v 1.1 2014/01/25 13:38:48 ryoon Exp $
--- gcc/lto/lto.c.orig 2012-04-23 12:44:46.000000000 +0000
+++ gcc/lto/lto.c
@@ -2486,4 +2486,10 @@ lto_main (void)
}
}
+const char *
+fname_as_string(int pretty_p)
+{
+ return NULL;
+}
+
#include "gt-lto-lto.h"
$NetBSD: patch-gcc_opts.c,v 1.1 2014/01/25 13:38:48 ryoon Exp $
--- gcc/opts.c.orig 2011-02-17 22:51:57.000000000 +0000
+++ gcc/opts.c
@@ -691,6 +691,8 @@ finish_options (struct gcc_options *opts
if (!opts->x_flag_opts_finished)
{
+ if (opts->x_flag_pic || opts->x_profile_flag)
+ opts->x_flag_pie = 0;
if (opts->x_flag_pie)
opts->x_flag_pic = opts->x_flag_pie;
if (opts->x_flag_pic && !opts->x_flag_pie)
$NetBSD: patch-gcc_unwind-dw2-fde-glibc.c,v 1.1 2014/01/25 13:38:48 ryoon Exp $
--- gcc/unwind-dw2-fde-glibc.c.orig 2010-12-23 12:08:21.000000000 +0000
+++ gcc/unwind-dw2-fde-glibc.c
@@ -33,7 +33,7 @@
#include "tconfig.h"
#include "tsystem.h"
-#ifndef inhibit_libc
+#if !defined(inhibit_libc) && !defined(__OpenBSD__)
#include <elf.h> /* Get DT_CONFIG. */
#endif
#include "coretypes.h"
$NetBSD: patch-gcc_unwind-dw2-fde-openbsd.c,v 1.1 2014/01/25 13:38:48 ryoon Exp $
--- gcc/unwind-dw2-fde-openbsd.c.orig 2014-01-25 06:53:23.000000000 +0000
+++ gcc/unwind-dw2-fde-openbsd.c
@@ -0,0 +1,10 @@
+/* XXX This file provides a few defines such that we can compile the
+ source from unwind-dw2-fde-glibc.c on OpenBSD. Hopefully we can
+ integrate these defines in that file and rename it to something
+ like unwind-de2-fde-phdr.c in the up-stream sources. */
+
+#define ElfW(type) Elf_##type
+
+#define __GLIBC__ 3 /* Fool unwind-dw2-fde-glibc.c. */
+#include "unwind-dw2-fde-glibc.c"
+
$NetBSD: patch-libstdc++-v3_include_std_mutex,v 1.1 2014/01/25 13:38:48 ryoon Exp $
--- libstdc++-v3/include/std/mutex.orig 2012-07-07 18:35:52.000000000 +0000
+++ libstdc++-v3/include/std/mutex
@@ -789,7 +789,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__get_once_mutex();
#endif
- extern "C" void __once_proxy();
+ extern "C" void __once_proxy(void);
/// call_once
template<typename _Callable, typename... _Args>