summaryrefslogtreecommitdiff
path: root/lang/gcc6
diff options
context:
space:
mode:
authorabs <abs@pkgsrc.org>2018-11-23 19:28:30 +0000
committerabs <abs@pkgsrc.org>2018-11-23 19:28:30 +0000
commit9617efee0fb75f96e2925f494ed89bcfa7c808c1 (patch)
tree9df3e17c5d20c14f071e0f9491675c951e75aaee /lang/gcc6
parenta4ba28966469e7a2a95fd45bdd0177758b730e69 (diff)
downloadpkgsrc-9617efee0fb75f96e2925f494ed89bcfa7c808c1.tar.gz
Pull forward patch for host hooks for NetBSD from gcc-5 - needed for working precompiled headers.
Also pull in missing config.hosts changes from gcc-6.5 in netbsd-current Bump PKGREVISION
Diffstat (limited to 'lang/gcc6')
-rw-r--r--lang/gcc6/Makefile4
-rw-r--r--lang/gcc6/distinfo5
-rw-r--r--lang/gcc6/patches/patch-gcc_config.host26
-rw-r--r--lang/gcc6/patches/patch-gcc_config_host-netbsd.c93
-rw-r--r--lang/gcc6/patches/patch-libgcc_config.host167
5 files changed, 292 insertions, 3 deletions
diff --git a/lang/gcc6/Makefile b/lang/gcc6/Makefile
index e3e948803a2..d2e85643289 100644
--- a/lang/gcc6/Makefile
+++ b/lang/gcc6/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.16 2018/11/05 18:59:44 maya Exp $
+# $NetBSD: Makefile,v 1.17 2018/11/23 19:28:30 abs Exp $
GCC_PKGNAME= gcc6
.include "version.mk"
@@ -8,7 +8,7 @@ PKGNAME= ${GCC_PKGNAME}-${GCC6_DIST_VERSION}
## When bumping the PKGREVISION of this package the PKGREVISION of
## lang/gcc6-libs needs to be bump to be at least 1 more than the
## PKGREVISION of this package!
-#PKGREVISION=
+PKGREVISION= 1
CATEGORIES= lang
MASTER_SITES= ${MASTER_SITE_GNU:=gcc/gcc-${GCC6_DIST_VERSION}/}
EXTRACT_SUFX= .tar.xz
diff --git a/lang/gcc6/distinfo b/lang/gcc6/distinfo
index f109cf40cee..fd6c94607d5 100644
--- a/lang/gcc6/distinfo
+++ b/lang/gcc6/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.12 2018/11/05 18:59:44 maya Exp $
+$NetBSD: distinfo,v 1.13 2018/11/23 19:28:30 abs Exp $
SHA1 (gcc-6.5.0.tar.xz) = 368b3f5d294b1a8727b372ac0a77703d8b41968a
RMD160 (gcc-6.5.0.tar.xz) = 66782b17cff89f22e5e8869fa96bd9a8985f5067
@@ -10,7 +10,9 @@ SHA512 (isl-0.14.tar.bz2) = 117c0c6f31d91a9284a8f54a748df6494ca2ac21507a45611e91
Size (isl-0.14.tar.bz2) = 1399896 bytes
SHA1 (patch-gcc_Makefile.in) = 41d45e8988b59e6ffa7adb7833290d39fc1fd0e1
SHA1 (patch-gcc_config.gcc) = 84fedf863c853c40bf81884f5db3617200f0d31d
+SHA1 (patch-gcc_config.host) = 5dd1b72be5d520ebc679c79cbe92317eaf66028f
SHA1 (patch-gcc_config_arm_arm.h) = e69b7f89ba245847f58253675a16749890b9d1ae
+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) = 3c09521e1803633a3643cf396a03f1f433ec869b
@@ -27,6 +29,7 @@ SHA1 (patch-libcilkrts_runtime_os-unix.c) = 653c5e3486d09bddae6a384edc2a3b3f2c95
SHA1 (patch-libdecnumber_decNumber.c) = cec90e49c829bfc6ba1ec605d2fac7daaad62762
SHA1 (patch-libffi_configure) = bcfbfe8abddc378e2de4a39ad0669583b37e0292
SHA1 (patch-libffi_testsuite_libffi.call_float2.c) = 6321dde308579448c27c2b6e1e30633699dd145f
+SHA1 (patch-libgcc_config.host) = 7ef11f83071325ef29b710f40251fce2b62cc9f3
SHA1 (patch-libgcc_crtstuff.c) = d22dd1fb4a79aed2e7c2864f0bb00bcc338b3ab8
SHA1 (patch-libgcc_unwind-dw2-fde-dip.c) = 9c5e1823226521d11900b4d3b92c050d3941a1f6
SHA1 (patch-libgfortran_configure) = 869a60fd08edecf18a42732dcbf226bad1309394
diff --git a/lang/gcc6/patches/patch-gcc_config.host b/lang/gcc6/patches/patch-gcc_config.host
new file mode 100644
index 00000000000..c312b94c076
--- /dev/null
+++ b/lang/gcc6/patches/patch-gcc_config.host
@@ -0,0 +1,26 @@
+$NetBSD: patch-gcc_config.host,v 1.1 2018/11/23 19:28:30 abs Exp $
+
+Add aarch64*-*-netbsd* and generic *-*-netbsd* entries
+
+--- gcc/config.host.orig 2017-01-09 21:01:26.000000000 +0000
++++ gcc/config.host
+@@ -99,7 +99,7 @@ case ${host} in
+ esac
+
+ case ${host} in
+- aarch64*-*-freebsd* | aarch64*-*-linux*)
++ aarch64*-*-freebsd* | aarch64*-*-linux* | aarch64*-*-netbsd*)
+ case ${target} in
+ aarch64*-*-*)
+ host_extra_gcc_objs="driver-aarch64.o"
+@@ -276,6 +276,10 @@ case ${host} in
+ 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/gcc6/patches/patch-gcc_config_host-netbsd.c b/lang/gcc6/patches/patch-gcc_config_host-netbsd.c
new file mode 100644
index 00000000000..5615923e7fe
--- /dev/null
+++ b/lang/gcc6/patches/patch-gcc_config_host-netbsd.c
@@ -0,0 +1,93 @@
+$NetBSD: patch-gcc_config_host-netbsd.c,v 1.1 2018/11/23 19:28:30 abs 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/gcc6/patches/patch-libgcc_config.host b/lang/gcc6/patches/patch-libgcc_config.host
new file mode 100644
index 00000000000..24c51aa5857
--- /dev/null
+++ b/lang/gcc6/patches/patch-libgcc_config.host
@@ -0,0 +1,167 @@
+$NetBSD: patch-libgcc_config.host,v 1.1 2018/11/23 19:28:30 abs Exp $
+
+Sync with NetBSD-current as of 2018-11-23
+
+--- libgcc/config.host.orig 2017-11-21 09:41:34.000000000 +0000
++++ libgcc/config.host
+@@ -164,9 +164,15 @@ nds32*-*)
+ nios2*-*-*)
+ cpu_type=nios2
+ ;;
++or1k-*-* | or1knd-*-*)
++ cpu_type=or1k
++ ;;
+ powerpc*-*-*)
+ cpu_type=rs6000
+ ;;
++riscv*-*-*)
++ cpu_type=riscv
++ ;;
+ rs6000*-*-*)
+ ;;
+ sparc64*-*-*)
+@@ -242,7 +248,7 @@ case ${host} in
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
+ ;;
+ *-*-netbsd*)
+- tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver"
++ tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver"
+ # NetBSD 1.7 and later are set up to use GCC's crtstuff for
+ # ELF configurations. We will clear extra_parts in the
+ # a.out configurations.
+@@ -338,6 +344,11 @@ aarch64*-*-freebsd*)
+ tmake_file="${tmake_file} ${cpu_type}/t-aarch64"
+ tmake_file="${tmake_file} ${cpu_type}/t-softfp t-softfp t-crtfm"
+ ;;
++aarch64*-*-netbsd*)
++ extra_parts="$extra_parts crtfastmath.o"
++ tmake_file="${tmake_file} ${cpu_type}/t-aarch64"
++ tmake_file="${tmake_file} ${cpu_type}/t-softfp t-softfp t-crtfm"
++ ;;
+ aarch64*-*-linux*)
+ extra_parts="$extra_parts crtfastmath.o"
+ md_unwind_header=aarch64/linux-unwind.h
+@@ -389,7 +400,16 @@ arm*-*-freebsd*) # ARM Fr
+ tmake_file="${tmake_file} t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
+ ;;
+ arm*-*-netbsdelf*)
+- tmake_file="$tmake_file arm/t-arm arm/t-netbsd t-slibgcc-gld-nover"
++ tmake_file="$tmake_file arm/t-arm"
++ case ${host} in
++ arm*-*-netbsdelf-*eabi*)
++ tmake_file="${tmake_file} arm/t-netbsd-eabi"
++ unwind_header=config/arm/unwind-arm.h
++ ;;
++ *)
++ tmake_file="${tmake_file} arm/t-netbsd t-slibgcc-gld-nover"
++ ;;
++ esac
+ ;;
+ arm*-*-linux*) # ARM GNU/Linux with ELF
+ tmake_file="${tmake_file} arm/t-arm t-fixedpoint-gnu-prefix t-crtfm"
+@@ -573,6 +593,9 @@ hppa[12]*-*-hpux11*)
+ hppa*-*-openbsd*)
+ tmake_file="$tmake_file pa/t-openbsd"
+ ;;
++hppa*-*-netbsd*)
++ tmake_file="$tmake_file pa/t-netbsd"
++ ;;
+ i[34567]86-*-darwin*)
+ tmake_file="$tmake_file i386/t-crtpc t-crtfm"
+ tm_file="$tm_file i386/darwin-lib.h"
+@@ -775,6 +798,10 @@ ia64*-*-linux*)
+ fi
+ md_unwind_header=ia64/linux-unwind.h
+ ;;
++ia64*-*-netbsd*)
++ extra_parts="${extra_parts} crtfastmath.o"
++ tmake_file="${tmake_file} ia64/t-ia64 ia64/t-ia64-elf t-crtfm ia64/t-softfp t-softfp ia64/t-eh-ia64"
++ ;;
+ ia64*-*-hpux*)
+ tmake_file="ia64/t-ia64 ia64/t-ia64-elf ia64/t-hpux t-slibgcc ia64/t-slibgcc-hpux t-slibgcc-hpux"
+ ;;
+@@ -819,7 +846,10 @@ m32rle-*-linux*)
+ m68k-*-elf* | fido-*-elf)
+ tmake_file="$tmake_file m68k/t-floatlib"
+ ;;
+-m68k*-*-netbsdelf*)
++m5407-*-netbsdelf*)
++ ;;
++m68k*-*-netbsdelf* | m68010-*-netbsdelf*)
++ tmake_file="$tmake_file m68k/t-floatlib"
+ ;;
+ m68k*-*-openbsd*)
+ ;;
+@@ -858,6 +888,17 @@ microblaze*-*-rtems*)
+ extra_parts="$extra_parts crtbeginS.o crtendS.o crtbeginT.o crti.o crtn.o"
+ ;;
+ mips*-*-netbsd*) # NetBSD/mips, either endian.
++ if test "${libgcc_cv_mips_hard_float}" = no; then
++ # Eat soft float stuff added above since the netbsd libc provides it.
++ xtmake_file=
++ for t in ${tmake_file}; do
++ case $t in
++ *softfp*) ;;
++ *) xtmake_file="${xtmake_file} $t";;
++ esac
++ done
++ tmake_file="${xtmake_file}"
++ fi
+ ;;
+ mips*-*-linux*) # Linux MIPS, either endian.
+ extra_parts="$extra_parts crtfastmath.o"
+@@ -951,6 +992,17 @@ msp430*-*-elf)
+ tmake_file="$tm_file t-crtstuff t-fdpbit msp430/t-msp430"
+ extra_parts="$extra_parts libmul_none.a libmul_16.a libmul_32.a libmul_f5.a"
+ ;;
++or1k*-*-linux* | or1k*-*-uclinux*)
++ tmake_file="$tmake_file or1k/t-or1k or1k/t-linux or1k/t-crtstuff t-softfp-sfdf t-softfp"
++ md_unwind_header=or1k/linux-unwind.h
++ ;;
++or1k*-*-netbsd*)
++ tmake_file="$tmake_file or1k/t-or1k"
++ ;;
++or1k*-*-*)
++ tmake_file="$tmake_file or1k/t-or1k or1k/t-linux or1k/t-crtstuff t-softfp-sfdf t-softfp"
++ extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o crti.o crtn.o"
++ ;;
+ nds32*-elf*)
+ # Basic makefile fragment and extra_parts for crt stuff.
+ # We also append c-isr library implementation.
+@@ -1012,8 +1064,8 @@ powerpc*-*-freebsd*)
+ ;;
+ esac
+ ;;
+-powerpc-*-netbsd*)
+- tmake_file="$tmake_file rs6000/t-netbsd rs6000/t-crtstuff"
++powerpc*-*-netbsd*)
++ tmake_file="${tmake_file} rs6000/t-netbsd rs6000/t-crtstuff"
+ ;;
+ powerpc-*-eabispe*)
+ tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-savresfgpr rs6000/t-crtstuff t-crtstuff-pic t-fdpbit"
+@@ -1100,6 +1152,17 @@ powerpcle-*-eabi*)
+ tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-crtstuff t-crtstuff-pic t-fdpbit"
+ extra_parts="$extra_parts crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o ecrti.o ecrtn.o ncrti.o ncrtn.o"
+ ;;
++riscv*-*-linux*)
++ tmake_file="${tmake_file} riscv/t-fpbit riscv/t-dpbit riscv/t-tpbit riscv/t-linux"
++ extra_parts="$extra_parts crtbegin.o crtend.o crti.o crtn.o crtendS.o crtbeginT.o"
++ ;;
++riscv*-*-netbsd*)
++ # nothing needed for NetBSD
++ ;;
++riscv*-*-*)
++ tmake_file="${tmake_file} riscv/t-fpbit riscv/t-dpbit riscv/t-elf"
++ extra_parts="$extra_parts crtbegin.o crtend.o crti.o crtn.o"
++ ;;
+ rs6000-ibm-aix4.[3456789]* | powerpc-ibm-aix4.[3456789]*)
+ md_unwind_header=rs6000/aix-unwind.h
+ tmake_file="t-fdpbit rs6000/t-ppc64-fp rs6000/t-slibgcc-aix rs6000/t-ibm-ldouble"
+@@ -1382,6 +1445,7 @@ i[34567]86-*-darwin* | x86_64-*-darwin*
+ i[34567]86-*-mingw* | x86_64-*-mingw* | \
+ i[34567]86-*-dragonfly* | x86_64-*-dragonfly* | \
+ i[34567]86-*-freebsd* | x86_64-*-freebsd* | \
++ i[34567]86-*-netbsd* | x86_64-*-netbsd* | \
+ i[34567]86-*-openbsd* | x86_64-*-openbsd*)
+ tmake_file="${tmake_file} t-softfp-tf"
+ if test "${host_address}" = 32; then