Index: head/lang/gcc6-aux/Makefile.common =================================================================== --- head/lang/gcc6-aux/Makefile.common (revision 433327) +++ head/lang/gcc6-aux/Makefile.common (revision 433328) @@ -1,15 +1,13 @@ # $FreeBSD$ .include "Makefile.version" LIB_DEPENDS= libgmp.so:math/gmp LIB_DEPENDS+= libmpfr.so:math/mpfr LIB_DEPENDS+= libmpc.so:math/mpc -ONLY_FOR_ARCHS= i386 amd64 - GNU_CONFIGURE= yes USES= gmake libtool perl5 tar:bzip2 USE_PERL5= build ALL_TARGET= default CFLAGS:= ${CFLAGS:N-march=*} Index: head/lang/gcc6-aux/Makefile.version =================================================================== --- head/lang/gcc6-aux/Makefile.version (revision 433327) +++ head/lang/gcc6-aux/Makefile.version (revision 433328) @@ -1,24 +1,24 @@ # $FreeBSD$ GCC_BRANCH= 6 GCC_POINT= 3.0 GCC_VERSION= ${GCC_BRANCH}.${GCC_POINT} -SNAPSHOT= 20161221 -BUILD_RELEASE= yes +SNAPSHOT= 20170202 +BUILD_RELEASE= no MAIN_PR= 0 UTIL_PR= 0 -ARMV7_PR= 1 -ARM64_PR= 1 -X86_PR= 1 +ARMV7_PR= 0 +ARM64_PR= 0 +X86_PR= 0 .if ${BUILD_RELEASE:Mno} # Snapshot naming pattern IDENTIFICATION= gcc-${GCC_BRANCH}-${SNAPSHOT} MS_SUBDIR= snapshots/${GCC_BRANCH}-${SNAPSHOT} PHASE= snapshot .else # Release naming pattern IDENTIFICATION= gcc-${GCC_VERSION} MS_SUBDIR= releases/gcc-${GCC_VERSION} PHASE= release .endif Index: head/lang/gcc6-aux/distinfo =================================================================== --- head/lang/gcc6-aux/distinfo (revision 433327) +++ head/lang/gcc6-aux/distinfo (revision 433328) @@ -1,9 +1,9 @@ -TIMESTAMP = 1482513153 -SHA256 (gcc-6.3.0.tar.bz2) = f06ae7f3f790fbf0f018f6d40e844451e6bc3b7bc96e128e63b09825c1f8b29f -SIZE (gcc-6.3.0.tar.bz2) = 99903185 +TIMESTAMP = 1486228092 +SHA256 (gcc-6-20170202.tar.bz2) = 339411f9ec780ba1f779417ea2a3206b69ee11de293aea27fff4658d7e56d0c5 +SIZE (gcc-6-20170202.tar.bz2) = 95743873 SHA256 (ada-bootstrap.i386.freebsd.100B.tar.bz2) = 7231209f2600275f554f788ad1d036cf633c4339ebd25bd479a5bb1ddcddedf3 SIZE (ada-bootstrap.i386.freebsd.100B.tar.bz2) = 41229192 SHA256 (ada-bootstrap.x86_64.dragonfly.41.tar.bz2) = eb7785d8b842aee2bb04b43adfb1346b178ee4e83d8775b4e6705fd23f1586f0 SIZE (ada-bootstrap.x86_64.dragonfly.41.tar.bz2) = 44956630 SHA256 (ada-bootstrap.x86_64.freebsd.100B.tar.bz2) = 1066d7c5e71d78b4416de3b73348227678ca07db52488409e270db7b00467f55 SIZE (ada-bootstrap.x86_64.freebsd.100B.tar.bz2) = 42163803 Index: head/lang/gcc6-aux/files/diff-core =================================================================== --- head/lang/gcc6-aux/files/diff-core (revision 433327) +++ head/lang/gcc6-aux/files/diff-core (revision 433328) @@ -1,320 +1,107 @@ --- gcc/config/dragonfly.h.orig +++ gcc/config/dragonfly.h @@ -84,7 +84,7 @@ } \ %{static:-Bstatic} \ } \ - %{!static:--hash-style=gnu} \ + %{!static:--hash-style=gnu -rpath @PREFIX@/@GCCAUX@/lib} \ %{symbolic:-Bsymbolic}" #undef LINK_SPEC ---- /dev/null +--- gcc/config/aarch64/aarch64-freebsd.h.orig +++ gcc/config/aarch64/aarch64-freebsd.h -@@ -0,0 +1,97 @@ -+/* Definitions for AArch64 running FreeBSD -+ Copyright (C) 2016 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 -+ . */ -+ -+#ifndef GCC_AARCH64_FREEBSD_H -+#define GCC_AARCH64_FREEBSD_H -+ -+#undef SUBTARGET_CPP_SPEC -+#define SUBTARGET_CPP_SPEC FBSD_CPP_SPEC -+ -+#if TARGET_BIG_ENDIAN_DEFAULT -+#define TARGET_LINKER_EMULATION "aarch64fbsdb" -+#else -+#define TARGET_LINKER_EMULATION "aarch64fbsd" -+#endif -+ -+#undef SUBTARGET_EXTRA_LINK_SPEC -+#define SUBTARGET_EXTRA_LINK_SPEC " -m" TARGET_LINKER_EMULATION -+ -+#undef FBSD_TARGET_LINK_SPEC -+#define FBSD_TARGET_LINK_SPEC " \ -+ %{p:%nconsider using `-pg' instead of `-p' with gprof (1) } \ -+ %{v:-V} \ -+ %{assert*} %{R*} %{rpath*} %{defsym*} \ -+ %{shared:-Bshareable %{h*} %{soname*}} \ -+ %{symbolic:-Bsymbolic} \ -+ %{static:-Bstatic} \ -+ %{!static: \ -+ %{!static: --hash-style=gnu -rpath @PREFIX@/@GCCAUX@/lib} \ -+ %{rdynamic:-export-dynamic} \ -+ %{!shared:-dynamic-linker " FBSD_DYNAMIC_LINKER " }} \ -+ -X" SUBTARGET_EXTRA_LINK_SPEC " \ -+ %{mbig-endian:-EB} %{mlittle-endian:-EL}" -+ -+#if TARGET_FIX_ERR_A53_835769_DEFAULT -+#define CA53_ERR_835769_SPEC \ -+ " %{!mno-fix-cortex-a53-835769:--fix-cortex-a53-835769}" -+#else -+#define CA53_ERR_835769_SPEC \ -+ " %{mfix-cortex-a53-835769:--fix-cortex-a53-835769}" -+#endif -+ -+#ifdef TARGET_FIX_ERR_A53_843419_DEFAULT -+#define CA53_ERR_843419_SPEC \ -+ " %{!mno-fix-cortex-a53-843419:--fix-cortex-a53-843419}" -+#else -+#define CA53_ERR_843419_SPEC \ -+ " %{mfix-cortex-a53-843419:--fix-cortex-a53-843419}" -+#endif -+ -+#undef LINK_SPEC -+#define LINK_SPEC FBSD_TARGET_LINK_SPEC \ -+ CA53_ERR_835769_SPEC \ -+ CA53_ERR_843419_SPEC -+ -+#define GNU_USER_TARGET_MATHFILE_SPEC \ -+ "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s}" -+ -+#undef ENDFILE_SPEC -+#define ENDFILE_SPEC \ -+ GNU_USER_TARGET_MATHFILE_SPEC " " \ -+ FBSD_ENDFILE_SPEC -+ -+#undef TARGET_OS_CPP_BUILTINS -+#define TARGET_OS_CPP_BUILTINS() \ -+ do \ -+ { \ -+ FBSD_TARGET_OS_CPP_BUILTINS (); \ -+ } \ -+ while (false) -+ -+#define TARGET_ASM_FILE_END file_end_indicate_exec_stack -+ -+/* Uninitialized common symbols in non-PIE executables, even with -+ strong definitions in dependent shared libraries, will resolve -+ to COPY relocated symbol in the executable. See PR65780. */ -+#undef TARGET_BINDS_LOCAL_P -+#define TARGET_BINDS_LOCAL_P default_binds_local_p_2 -+ +@@ -41,6 +41,7 @@ + %{symbolic:-Bsymbolic} \ + %{static:-Bstatic} \ + %{!static: \ ++ %{!static:--hash-style=gnu -rpath @PREFIX@/@GCCAUX@/lib} \ + %{rdynamic:-export-dynamic} \ + %{!shared:-dynamic-linker " FBSD_DYNAMIC_LINKER " }} \ + -X" SUBTARGET_EXTRA_LINK_SPEC " \ +@@ -91,4 +92,6 @@ + #undef TARGET_BINDS_LOCAL_P + #define TARGET_BINDS_LOCAL_P default_binds_local_p_2 + +/* Static stack checking is supported by means of probes. */ +#define STACK_CHECK_STATIC_BUILTIN 1 -+#endif /* GCC_AARCH64_FREEBSD_H */ ---- /dev/null -+++ gcc/config/aarch64/t-aarch64-freebsd -@@ -0,0 +1,21 @@ -+# Machine description for AArch64 architecture. -+# Copyright (C) 2016 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 -+# . -+ -+LIB1ASMSRC = aarch64/lib1funcs.asm -+LIB1ASMFUNCS = _aarch64_sync_cache_range + #endif /* GCC_AARCH64_FREEBSD_H */ --- gcc/config/i386/freebsd.h.orig +++ gcc/config/i386/freebsd.h -@@ -77,6 +77,12 @@ - When the -shared link option is used a final link is not being - done. */ - -+#if FBSD_MAJOR < 10 -+#define ELF_HASH_STYLE "--hash-style=both " -+#else -+#define ELF_HASH_STYLE "--hash-style=gnu " -+#endif -+ - #undef LINK_SPEC - #define LINK_SPEC "\ - %{p:%nconsider using '-pg' instead of '-p' with gprof(1)} \ -@@ -88,6 +94,7 @@ +@@ -88,6 +88,7 @@ %{rdynamic:-export-dynamic} \ -dynamic-linker %(fbsd_dynamic_linker) } \ %{static:-Bstatic}} \ -+ %{!static:" ELF_HASH_STYLE "-rpath @PREFIX@/@GCCAUX@/lib} \ ++ %{!static:--hash-style=gnu -rpath @PREFIX@/@GCCAUX@/lib} \ %{symbolic:-Bsymbolic}" /* A C statement to output to the stdio stream FILE an assembler --- gcc/config/i386/freebsd64.h.orig +++ gcc/config/i386/freebsd64.h @@ -41,4 +41,5 @@ %{rdynamic:-export-dynamic} \ -dynamic-linker %(fbsd_dynamic_linker) } \ %{static:-Bstatic}} \ -+ %{!static:" ELF_HASH_STYLE "-rpath @PREFIX@/@GCCAUX@/lib} \ ++ %{!static:--hash-style=gnu -rpath @PREFIX@/@GCCAUX@/lib} \ %{symbolic:-Bsymbolic}" ---- configure.orig -+++ configure -@@ -3483,6 +3483,9 @@ - *-*-vxworks*) - noconfigdirs="$noconfigdirs ${libgcj}" - ;; -+ aarch64*-*-freebsd*) -+ noconfigdirs="$noconfigdirs target-libffi" -+ ;; - alpha*-*-*vms*) - noconfigdirs="$noconfigdirs ${libgcj}" - ;; --- gcc/Makefile.in.orig +++ gcc/Makefile.in @@ -1185,7 +1185,6 @@ insn-emit.o \ insn-extract.o \ insn-latencytab.o \ - insn-modes.o \ insn-opinit.o \ insn-output.o \ insn-peep.o \ @@ -1557,6 +1556,7 @@ $(OBJS-libcommon-target) main.o c-family/cppspec.o \ $(COLLECT2_OBJS) $(EXTRA_GCC_OBJS) $(GCOV_OBJS) $(GCOV_DUMP_OBJS) \ $(GCOV_TOOL_OBJS) $(GENGTYPE_OBJS) gcc-ar.o gcc-nm.o gcc-ranlib.o \ + insn-modes.o insn-modes-ada.o \ lto-wrapper.o collect-utils.o # This lists all host object files, whether they are included in this @@ -1564,6 +1564,11 @@ ALL_HOST_OBJS = $(ALL_HOST_FRONTEND_OBJS) $(ALL_HOST_BACKEND_OBJS) BACKEND = libbackend.a main.o libcommon-target.a libcommon.a \ + insn-modes.o \ + $(CPPLIB) $(LIBDECNUMBER) + +BACKEND2 = libbackend.a main.o libcommon-target.a libcommon.a \ + insn-modes-ada.o \ $(CPPLIB) $(LIBDECNUMBER) # This is defined to "yes" if Tree checking is enabled, which roughly means @@ -2218,6 +2223,7 @@ insn-modes.c: s-modes; @true insn-modes.h: s-modes-h; @true +insn-modes-ada.c: s-modes-ada; @true min-insn-modes.c: s-modes-m; @true s-modes: build/genmodes$(build_exeext) @@ -2235,6 +2241,12 @@ $(SHELL) $(srcdir)/../move-if-change tmp-min-modes.c min-insn-modes.c $(STAMP) s-modes-m +s-modes-ada: s-modes + $(shell sed -e 's/: TARGET_96_ROUND_53_LONG_DOUBLE \? &ieee_extended_intel_96_round_53_format //' \ + < insn-modes.c > tmp-modes-ada.c) + $(SHELL) $(srcdir)/../move-if-change tmp-modes-ada.c insn-modes-ada.c + $(STAMP) s-modes-ada + insn-preds.c: s-preds; @true tm-preds.h: s-preds-h; @true tm-constrs.h: s-constrs-h; @true @@ -3420,6 +3432,9 @@ ( cd $(DESTDIR)$(bindir) && \ $(LN) $(GCC_INSTALL_NAME)$(exeext) $(FULL_DRIVER_NAME) ); \ fi; \ + if [ -f gnat1$(exeext) ] ; then \ + ( cd $(DESTDIR)$(bindir) && $(LN) $(GCC_INSTALL_NAME)$(exeext) ada$(exeext) ) \ + fi; \ if [ ! -f gcc-cross$(exeext) ] \ && [ "$(GCC_INSTALL_NAME)" != "$(GCC_TARGET_INSTALL_NAME)" ]; then \ rm -f $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-tmp$(exeext); \ ---- gcc/config.gcc.orig -+++ gcc/config.gcc -@@ -941,6 +941,11 @@ - done - TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'` - ;; -+aarch64*-*-freebsd*) -+ tm_file="${tm_file} dbxelf.h elfos.h ${fbsd_tm_file}" -+ tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-freebsd.h" -+ tmake_file="${tmake_file} aarch64/t-aarch64 aarch64/t-aarch64-freebsd" -+ ;; - aarch64*-*-linux*) - tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h" - tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-linux.h" -@@ -1445,12 +1450,16 @@ - 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" - ;; - i[34567]86-*-netbsdelf*) -- tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/netbsd-elf.h" -+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/netbsd-elf.h freebsd-stdint.h" - extra_options="${extra_options} netbsd.opt netbsd-elf.opt" -+ tmake_file="${tmake_file} i386/t-crtstuff" -+ use_gcc_stdint=wrap - ;; - x86_64-*-netbsd*) -- 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" -+ 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 freebsd-stdint.h" - extra_options="${extra_options} netbsd.opt netbsd-elf.opt" -+ tmake_file="${tmake_file} i386/t-crtstuff" -+ use_gcc_stdint=wrap - ;; - i[34567]86-*-openbsd2.*|i[34567]86-*openbsd3.[0123]) - tm_file="i386/i386.h i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h openbsd-oldgas.h openbsd.h i386/openbsd.h" ---- gcc/config.host.orig -+++ gcc/config.host -@@ -99,7 +99,7 @@ - esac - - case ${host} in -- aarch64*-*-linux*) -+ aarch64*-*-freebsd* | aarch64*-*-linux*) - case ${target} in - aarch64*-*-*) - host_extra_gcc_objs="driver-aarch64.o" ---- libgcc/config.host.orig -+++ libgcc/config.host -@@ -242,7 +242,8 @@ - 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" -+ tmake_file="$tmake_file 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. -@@ -333,6 +334,11 @@ - tmake_file="${tmake_file} ${cpu_type}/t-aarch64" - tmake_file="${tmake_file} ${cpu_type}/t-softfp t-softfp t-crtfm" - ;; -+aarch64*-*-freebsd*) -+ 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 -@@ -597,9 +603,12 @@ - md_unwind_header=i386/freebsd-unwind.h - ;; - i[34567]86-*-netbsdelf*) -+ tmake_file="${tmake_file} i386/t-crtstuff" -+ #md_unwind_header=i386/netbsd-unwind.h - ;; - x86_64-*-netbsd*) - tmake_file="${tmake_file} i386/t-crtstuff" -+ #md_unwind_header=i386/netbsd-unwind.h - ;; - i[34567]86-*-openbsd2.*|i[34567]86-*openbsd3.[0123]) - ;; Index: head/lang/gcc6-aux/files/diff-cxx =================================================================== --- head/lang/gcc6-aux/files/diff-cxx (revision 433327) +++ head/lang/gcc6-aux/files/diff-cxx (revision 433328) @@ -1,63 +1,63 @@ --- libstdc++-v3/configure.host.orig +++ libstdc++-v3/configure.host @@ -262,6 +262,9 @@ freebsd*) os_include_dir="os/bsd/freebsd" ;; + linux-android*) + os_include_dir="os/bionic" + ;; linux-musl*) os_include_dir="os/generic" ;; --- libstdc++-v3/config/os/bionic/ctype_base.h.orig +++ libstdc++-v3/config/os/bionic/ctype_base.h @@ -38,6 +38,18 @@ // Non-standard typedefs. typedef const int* __to_type; +#ifdef _CTYPE_U +#define _U _CTYPE_U +#define _L _CTYPE_L +#define _D _CTYPE_D +#define _S _CTYPE_S +#define _P _CTYPE_P +#define _C _CTYPE_C +#define _X _CTYPE_X +#define _B _CTYPE_B +#define _N _CTYPE_D +#endif + // NB: Offsets into ctype::_M_table force a particular size // on the mask type. Because of this, we don't use an enum. typedef char mask; --- libstdc++-v3/src/c++11/futex.cc.orig +++ libstdc++-v3/src/c++11/futex.cc @@ -27,7 +27,11 @@ #if defined(_GLIBCXX_HAVE_LINUX_FUTEX) && ATOMIC_INT_LOCK_FREE > 1 #include #include +#ifdef __ANDROID__ +#include +#else #include +#endif #include #include #include --- libstdc++-v3/src/filesystem/dir.cc.orig +++ libstdc++-v3/src/filesystem/dir.cc -@@ -147,7 +147,13 @@ +@@ -146,7 +146,13 @@ int err = std::exchange(errno, 0); const auto entp = readdir(dirp); +#ifdef __ANDROID__ + int tmperr = errno; + errno = err; + err = tmperr; +#else std::swap(errno, err); +#endif if (entp) {