pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/lang lang/gcc7: add missing patches for precompiled he...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/d92ae78dcd14
branches:  trunk
changeset: 426925:d92ae78dcd14
user:      rhialto <rhialto%pkgsrc.org@localhost>
date:      Wed Apr 08 13:29:54 2020 +0000

description:
lang/gcc7: add missing patches for precompiled headers.

Bump version, also on gcc7-libs.

diffstat:

 lang/gcc7-libs/Makefile                          |   4 +-
 lang/gcc7/Makefile                               |   4 +-
 lang/gcc7/patches/patch-gcc_config.host          |  18 ++++
 lang/gcc7/patches/patch-gcc_config_host-netbsd.c |  93 ++++++++++++++++++++++++
 4 files changed, 115 insertions(+), 4 deletions(-)

diffs (154 lines):

diff -r fd981fa71b1e -r d92ae78dcd14 lang/gcc7-libs/Makefile
--- a/lang/gcc7-libs/Makefile   Wed Apr 08 12:46:40 2020 +0000
+++ b/lang/gcc7-libs/Makefile   Wed Apr 08 13:29:54 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.9 2020/03/13 15:00:36 bacon Exp $
+# $NetBSD: Makefile,v 1.10 2020/04/08 13:29:54 rhialto Exp $
 
 GCC_PKGNAME=   gcc7
 .include       "../../lang/${GCC_PKGNAME}/version.mk"
@@ -9,7 +9,7 @@
 ## The PKGREVISION of this package needs to be at least 1 more than the
 ## PKGREVISION of the lang/gcc7 package so that with the dependence pattern
 ## '{gcc7,gcc7-libs}>=7.5.*' pkg_add will choose gcc7-libs over gcc7.
-PKGREVISION=   2
+PKGREVISION=   3
 
 CATEGORIES=    lang
 MASTER_SITES=  # empty
diff -r fd981fa71b1e -r d92ae78dcd14 lang/gcc7/Makefile
--- a/lang/gcc7/Makefile        Wed Apr 08 12:46:40 2020 +0000
+++ b/lang/gcc7/Makefile        Wed Apr 08 13:29:54 2020 +0000
@@ -1,11 +1,11 @@
-# $NetBSD: Makefile,v 1.31 2020/04/01 14:08:14 wiz Exp $
+# $NetBSD: Makefile,v 1.32 2020/04/08 13:29:54 rhialto Exp $
 
 GCC_PKGNAME=           gcc7
 .include               "version.mk"
 
 DISTNAME=      gcc-${GCC7_DIST_VERSION}
 PKGNAME=       ${GCC_PKGNAME}-${GCC7_DIST_VERSION}
-PKGREVISION=   1
+PKGREVISION=   2
 ## When bumping the PKGREVISION of this package the PKGREVISION of
 ## lang/gcc7-libs needs to be bump to be at least 1 more than the
 ## PKGREVISION of this package!
diff -r fd981fa71b1e -r d92ae78dcd14 lang/gcc7/patches/patch-gcc_config.host
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/gcc7/patches/patch-gcc_config.host   Wed Apr 08 13:29:54 2020 +0000
@@ -0,0 +1,18 @@
+$NetBSD: patch-gcc_config.host,v 1.1 2020/04/08 13:29:54 rhialto 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 -r fd981fa71b1e -r d92ae78dcd14 lang/gcc7/patches/patch-gcc_config_host-netbsd.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/gcc7/patches/patch-gcc_config_host-netbsd.c  Wed Apr 08 13:29:54 2020 +0000
@@ -0,0 +1,93 @@
+$NetBSD: patch-gcc_config_host-netbsd.c,v 1.1 2020/04/08 13:29:54 rhialto 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;



Home | Main Index | Thread Index | Old Index