diff options
author | martin <martin> | 2015-08-06 07:21:29 +0000 |
---|---|---|
committer | martin <martin> | 2015-08-06 07:21:29 +0000 |
commit | b15a7ad90e274e8421a5fef9bdce1d96d30112ac (patch) | |
tree | 0b0ee184bf03bec0e5fb1c36d161d74bb36cef65 /lang/gcc5 | |
parent | 1df4763b0688272c8e61d88c179e987945331834 (diff) | |
download | pkgsrc-b15a7ad90e274e8421a5fef9bdce1d96d30112ac.tar.gz |
Make precompiled headers work on NetBSD hosts
Diffstat (limited to 'lang/gcc5')
-rw-r--r-- | lang/gcc5/distinfo | 4 | ||||
-rw-r--r-- | lang/gcc5/patches/patch-gcc_config.host | 18 | ||||
-rw-r--r-- | lang/gcc5/patches/patch-gcc_config_host-netbsd.c | 93 | ||||
-rw-r--r-- | lang/gcc5/patches/patch-gcc_config_x-netbsd | 2 |
4 files changed, 115 insertions, 2 deletions
diff --git a/lang/gcc5/distinfo b/lang/gcc5/distinfo index 1b1b31d6fdb..65ec65b7ecc 100644 --- a/lang/gcc5/distinfo +++ b/lang/gcc5/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.2 2015/07/25 03:46:02 ryoon Exp $ +$NetBSD: distinfo,v 1.3 2015/08/06 07:21:29 martin Exp $ SHA1 (gcc-5.2.0.tar.bz2) = fe3f5390949d47054b613edc36c557eb1d51c18e RMD160 (gcc-5.2.0.tar.bz2) = eaedd62e7a738f6bdc0e97a0c40fbbd75d35925b @@ -8,6 +8,8 @@ RMD160 (isl-0.14.tar.bz2) = 4c69d026b51561bc1948cb7db79331b78a9d2c39 Size (isl-0.14.tar.bz2) = 1399896 bytes SHA1 (patch-gcc_Makefile.in) = ce366a091960d335ecb022918e2f7bfc4e3fcccf SHA1 (patch-gcc_config.gcc) = bfa3897de6afa573ee44a60973611c4e9024f497 +SHA1 (patch-gcc_config.host) = 1b1e11cd199eb93f49443d51c0063b09b7327858 +SHA1 (patch-gcc_config_host-netbsd.c) = 765295f07edb8a68f1910e3a9b4dd2a7dcd491a5 SHA1 (patch-gcc_config_netbsd-protos.h) = 6d28864b4ccc8c1a63fe28e43601b84b63a00633 SHA1 (patch-gcc_config_netbsd-stdint.h) = 025fc883101a187e84ed4c0772406720d645d550 SHA1 (patch-gcc_config_netbsd.c) = 9d1327f926dece6e753093e759b5c8b707747ae1 diff --git a/lang/gcc5/patches/patch-gcc_config.host b/lang/gcc5/patches/patch-gcc_config.host new file mode 100644 index 00000000000..97fcace2b71 --- /dev/null +++ b/lang/gcc5/patches/patch-gcc_config.host @@ -0,0 +1,18 @@ +$NetBSD: patch-gcc_config.host,v 1.1 2015/08/06 07:21:29 martin Exp $ + +Add host hooks for NetBSD - needed for working precompiled headers. +http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58397 + +--- gcc/config.host.orig 2013-01-10 21:38:27.000000000 +0100 ++++ gcc/config.host 2013-09-10 20:25:36.000000000 +0200 +@@ -271,6 +271,10 @@ + out_host_hook_obj=host-openbsd.o + host_xmake_file="${host_xmake_file} x-openbsd" + ;; ++ *-*-netbsd*) ++ out_host_hook_obj=host-netbsd.o ++ host_xmake_file="${host_xmake_file} x-netbsd" ++ ;; + ia64-*-hpux*) + use_long_long_for_widest_fast_int=yes + out_host_hook_obj=host-hpux.o diff --git a/lang/gcc5/patches/patch-gcc_config_host-netbsd.c b/lang/gcc5/patches/patch-gcc_config_host-netbsd.c new file mode 100644 index 00000000000..daec7ee7dd6 --- /dev/null +++ b/lang/gcc5/patches/patch-gcc_config_host-netbsd.c @@ -0,0 +1,93 @@ +$NetBSD: patch-gcc_config_host-netbsd.c,v 1.1 2015/08/06 07:21:29 martin Exp $ + +Add host hooks for NetBSD - needed for working precompiled headers. +http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58397 + +--- /dev/null 2013-09-11 20:06:51.000000000 +0200 ++++ gcc/config/host-netbsd.c 2013-09-11 20:29:31.000000000 +0200 +@@ -0,0 +1,85 @@ ++/* NetBSD host-specific hook definitions. ++ Copyright (C) 2004-2013 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 3, 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 COPYING3. If not see ++ <http://www.gnu.org/licenses/>. */ ++ ++#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 netbsd_gt_pch_get_address ++#undef HOST_HOOKS_GT_PCH_USE_ADDRESS ++#define HOST_HOOKS_GT_PCH_USE_ADDRESS netbsd_gt_pch_use_address ++ ++/* For various ports, try to guess a fixed spot in the vm space ++ that's probably free. */ ++#if defined(__sparc64__) ++# define TRY_EMPTY_VM_SPACE 0x40000000000 ++#elif defined(_LP64) ++# define TRY_EMPTY_VM_SPACE 0x400000000000 ++#elif defined(__mips__) || defined(__vax__) || defined (__arm__) ++# define TRY_EMPTY_VM_SPACE 0x60000000 ++#else ++# define TRY_EMPTY_VM_SPACE 0xb0000000 ++#endif ++ ++/* Determine a location where we might be able to reliably allocate ++ SIZE bytes. FD is the PCH file, though we should return with the ++ file unmapped. */ ++ ++static void * ++netbsd_gt_pch_get_address (size_t size, int fd) ++{ ++ void *addr; ++ ++ addr = mmap ((void *) TRY_EMPTY_VM_SPACE, size, PROT_READ | PROT_WRITE, ++ MAP_PRIVATE | MAP_FIXED, fd, 0); ++ ++ /* If we failed the map, that means there's *no* free space. */ ++ if (addr == (void *) MAP_FAILED) ++ return NULL; ++ /* Unmap the area before returning. */ ++ munmap (addr, size); ++ ++ return addr; ++} ++ ++/* Map SIZE bytes of FD+OFFSET at BASE. Return 1 if we succeeded at ++ mapping the data at BASE, -1 if we couldn't. */ ++ ++static int ++netbsd_gt_pch_use_address (void *base, size_t size, int fd, size_t offset) ++{ ++ void *addr; ++ ++ /* We're called with size == 0 if we're not planning to load a PCH ++ file at all. This allows the hook to free any static space that ++ we might have allocated at link time. */ ++ if (size == 0) ++ return -1; ++ ++ addr = mmap (base, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, fd, offset); ++ ++ return addr == base ? 1 : -1; ++} ++ ++ ++const struct host_hooks host_hooks = HOST_HOOKS_INITIALIZER; diff --git a/lang/gcc5/patches/patch-gcc_config_x-netbsd b/lang/gcc5/patches/patch-gcc_config_x-netbsd index 6751a7806d9..aa6bafac573 100644 --- a/lang/gcc5/patches/patch-gcc_config_x-netbsd +++ b/lang/gcc5/patches/patch-gcc_config_x-netbsd @@ -1,4 +1,4 @@ -$NetBSD: patch-gcc_config_x-netbsd,v 1.1 2015/07/16 12:03:36 ryoon Exp $ +$NetBSD: patch-gcc_config_x-netbsd,v 1.2 2015/08/06 07:21:29 martin Exp $ Add host hooks for NetBSD - needed for working precompiled headers. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58397 |