summaryrefslogtreecommitdiff
path: root/lang
diff options
context:
space:
mode:
authorFrederic Culot <culot@FreeBSD.org>2012-01-12 14:24:37 +0000
committerFrederic Culot <culot@FreeBSD.org>2012-01-12 14:24:37 +0000
commit95b7a19396ec20e377c5aac3a4ce9167c23483e2 (patch)
tree70edf6a8ceb8eec74ab6a182475788727a688e90 /lang
parentRemove the glob from the rmdir line "@unexec rmdir ... || true" are (diff)
- Update to 20111026 (corresponding to gcc 4.6.2)
- Set default options to build all five languages (Ada, C, C++, ObjC, Fortran) Maintainer notes: - Previously GNAT-Aux was built from a custom tarball provided by dragonlace.net. Now real gcc source tarballs are used, and then patched. - The standard patch mechanism is not used. Composite diff files generated and provided by dragonlace.net are applied as needed. - This sets the stage to sync GNAT-Aux with gcc 4.7.0 when its released. PR: ports/163914 Submitted by: John Marino <draco@marino.st> (maintainer)
Notes
Notes: svn path=/head/; revision=289027
Diffstat (limited to 'lang')
-rw-r--r--lang/gnat-aux/Makefile119
-rw-r--r--lang/gnat-aux/distinfo14
-rw-r--r--lang/gnat-aux/files/diff-ada9755
-rw-r--r--lang/gnat-aux/files/diff-ada-testsuite190
-rw-r--r--lang/gnat-aux/files/diff-core1903
-rw-r--r--lang/gnat-aux/files/diff-cxx917
-rw-r--r--lang/gnat-aux/files/diff-cxx-testsuite4547
-rw-r--r--lang/gnat-aux/files/diff-fortran54
-rw-r--r--lang/gnat-aux/files/diff-fortran-testsuite31
-rw-r--r--lang/gnat-aux/files/diff-gcc-testsuite10
-rw-r--r--lang/gnat-aux/files/patch-gcc__ada__adaint.c279
-rw-r--r--lang/gnat-aux/files/patch-gcc__ada__g-trasym-bsd.adb153
-rw-r--r--lang/gnat-aux/files/patch-gcc__ada__gccint__Makefile.in101
-rw-r--r--lang/gnat-aux/pkg-plist37
14 files changed, 17532 insertions, 578 deletions
diff --git a/lang/gnat-aux/Makefile b/lang/gnat-aux/Makefile
index 5622be829edf..6dc86cd6783c 100644
--- a/lang/gnat-aux/Makefile
+++ b/lang/gnat-aux/Makefile
@@ -7,10 +7,12 @@
PORTNAME= gnat-aux
PORTVERSION= ${SNAPSHOT}
-PORTREVISION= 1
CATEGORIES= lang
-MASTER_SITES= http://downloads.dragonlace.net/src/ \
- http://dragonlace.mirrors.ada.cx/src/
+MASTER_SITES= http://downloads.dragonlace.net/src/:boot \
+ http://dragonlace.mirrors.ada.cx/src/:boot \
+ ${MASTER_SITE_GCC}
+MASTER_SITE_SUBDIR= releases/gcc-${GCC_VERSION}
+DISTFILES= gcc-core-${GCC_VERSION}.tar.bz2
MAINTAINER= draco@marino.st
COMMENT= GNAT Ada compiler based on GCC ${GCC_BRANCH}
@@ -25,18 +27,17 @@ GNU_CONFIGURE= yes
USE_GMAKE= yes
USE_BZIP2= yes
USE_ICONV= yes
-USE_BISON= build
USE_PERL5_BUILD= yes
-USE_LDCONFIG= yes
ALL_TARGET= default
MAKE_JOBS_SAFE= yes
-SNAPSHOT= 20110627
+SNAPSHOT= 20111026
GCC_BRANCH= 4.6
-GCC_POINT= 1
+GCC_POINT= 2
+GCC_VERSION= ${GCC_BRANCH}.${GCC_POINT}
LANGS= c
+APPLY_DIFFS= core
-THREAD_MODEL= posix
INTENDED_COMPILER= NATIVE
BOOTSTRAP_COMPILER= NOT_REQUIRED
BOOTSTRAP_TRIPLET= NOT_SET
@@ -44,8 +45,12 @@ FULL_GNATGCC= NOT_SET
OPTIONS= ADA "Build Ada language" on
OPTIONS+= CXX "Build C++ language" on
+OPTIONS+= FORT "Build Fortran language" on
+OPTIONS+= OBJC "Build Objective-C language" on
OPTIONS+= TS_ADA "Enable Ada testsuite" off
OPTIONS+= TS_CXX "Enable C++ testsuite" off
+OPTIONS+= TS_FOR "Enable Fortran testsuite" off
+OPTIONS+= TS_OBC "Enable Objective-C testsuite" off
OPTIONS+= TS_GCC "Enable GCC testsuite" off
.include <bsd.port.pre.mk>
@@ -63,18 +68,18 @@ BOOTSTRAP_TRIPLET= i386-bootstrap-freebsd8.0/4.6.0
BOOTSTRAP_COMPILER= gnat-bootstrap.i386.freebsd.tar.bz2
.endif
PLIST_SUB= GNU_HOST=${BLD_TARGET}
-PLIST_SUB+= GCC_VER=${GCC_BRANCH}.${GCC_POINT}
+PLIST_SUB+= GCC_VER=${GCC_VERSION}
-WRKSRC= ${WRKDIR}/gcc-${GCC_BRANCH}-${SNAPSHOT}
+WRKSRC= ${WRKDIR}/gcc-${GCC_VERSION}
BUILDDIR= ${WRKDIR}/build
CFG_SCRIPT= ${WRKSRC}/configure
REVFILE= ${WRKSRC}/gcc/REVISION
BOOTSTRAP_PREFIX= ${WRKDIR}/bootstrap
PKG_PREFIX= ${PREFIX}
-LPATH= lib/gcc/${BLD_TARGET}/${GCC_BRANCH}.${GCC_POINT}
-LEPATH= libexec/gcc/${BLD_TARGET}/${GCC_BRANCH}.${GCC_POINT}
+LPATH= lib/gcc/${BLD_TARGET}/${GCC_VERSION}
+LEPATH= libexec/gcc/${BLD_TARGET}/${GCC_VERSION}
+USE_LDCONFIG= ${PREFIX}/lib/gcc
MAN1= gnatcpp.1 gnatgcc.1 gnatgcov.1
-MAN7= fsf-funding.7 gfdl.7 gpl.7
MAN1PREFIX= ${PREFIX}/share
MAN7PREFIX= ${PREFIX}/share
NO_MANCOMPRESS= yes
@@ -97,7 +102,7 @@ FULL_PATH=/sbin:/bin:/usr/sbin:/usr/bin:${PREFIX}/bin
INTENDED_COMPILER=BOOTSTRAP
FULL_GNATGCC=${BOOTSTRAP_PREFIX}/bin/gnatgcc
FULL_PATH=${BOOTSTRAP_PREFIX}/bin:/sbin:/bin:/usr/sbin:/usr/bin:${PREFIX}/bin
-DISTFILES=${PORTNAME}-${SNAPSHOT}.tar.bz2 ${BOOTSTRAP_COMPILER}
+DISTFILES+= ${BOOTSTRAP_COMPILER}:boot
.endif
###########
@@ -106,6 +111,11 @@ DISTFILES=${PORTNAME}-${SNAPSHOT}.tar.bz2 ${BOOTSTRAP_COMPILER}
.if defined(WITH_ADA)
LANGS+= ada
+APPLY_DIFFS+= ada
+DISTFILES+= gcc-ada-${GCC_VERSION}.tar.bz2
+PLIST_SUB+= ADA=""
+.else
+PLIST_SUB+= ADA="@comment "
.endif
###########
@@ -114,22 +124,61 @@ LANGS+= ada
.if defined(WITH_CXX)
LANGS+= c++
+APPLY_DIFFS+= cxx
+DISTFILES+= gcc-g++-${GCC_VERSION}.tar.bz2
MAN1+= gnatg++.1
-LCXXPATH= include/c++/${GCC_BRANCH}.${GCC_POINT}
-LSHRPATH= share/gcc-${GCC_BRANCH}.${GCC_POINT}
+LCXXPATH= include/c++/${GCC_VERSION}
+LSHRPATH= share/gcc-${GCC_VERSION}
PLIST_SUB+= CXX=""
.else
PLIST_SUB+= CXX="@comment "
.endif
+###############
+## Fortran ##
+###############
+
+.if defined(WITH_FORT)
+LANGS+= fortran
+APPLY_DIFFS+= fortran
+DISTFILES+= gcc-fortran-${GCC_VERSION}.tar.bz2
+MAN1+= gnatgfortran.1
+QUADOPT= --enable-libquadmath
+PLIST_SUB+= FRT=""
+.else
+QUADOPT= --disable-libquadmath
+PLIST_SUB+= FRT="@comment "
+.endif
+
+###################
+## Objective-C ##
+###################
+
+.if defined(WITH_OBJC)
+LANGS+= objc
+DISTFILES+= gcc-objc-${GCC_VERSION}.tar.bz2
+.endif
+
##################
## Testsuites ##
##################
.if defined(WITH_TS_ADA) \
|| defined(WITH_TS_CXX) \
+ || defined(WITH_TS_FOR) \
+ || defined(WITH_TS_OBC) \
|| defined(WITH_TS_GCC)
BUILD_DEPENDS= dejagnu>=1.4:${PORTSDIR}/misc/dejagnu
+DISTFILES+= gcc-testsuite-${GCC_VERSION}.tar.bz2
+.if defined(WITH_TS_ADA)
+APPLY_DIFFS+= ada-testsuite
+.endif
+.if defined(WITH_TS_CXX)
+APPLY_DIFFS+= cxx-testsuite
+.endif
+.if defined(WITH_TS_GCC)
+APPLY_DIFFS+= gcc-testsuite
+.endif
.endif
# for port maintenance, uncomment to invoke "make makesum"
@@ -155,9 +204,9 @@ CONFIGURE_ARGS+= --with-mpfr=${PKG_PREFIX}
CONFIGURE_ARGS+= --with-mpc=${PKG_PREFIX}
CONFIGURE_ARGS+= --with-libiconv-prefix=${PKG_PREFIX}
CONFIGURE_ARGS+= --enable-shared
-CONFIGURE_ARGS+= --enable-threads=${THREAD_MODEL}
+CONFIGURE_ARGS+= --enable-threads=posix
CONFIGURE_ARGS+= --disable-bootstrap
-CONFIGURE_ARGS+= --disable-libquadmath
+CONFIGURE_ARGS+= ${QUADOPT}
CONFIGURE_ARGS+= --disable-libmudflap
CONFIGURE_ARGS+= --disable-libgomp
CONFIGURE_ARGS+= --disable-libssp
@@ -167,6 +216,18 @@ post-extract:
# Personalize GNAT for each different machine
@${ECHO} "-=> GNAT AUX ${OS_LABEL4VERS}" > ${REVFILE}
+ # Create new directories in preparation of applying diff files
+.if defined(WITH_CXX)
+ ${MKDIR} ${WRKSRC}/libstdc++-v3/config/locale/dragonfly
+ ${MKDIR} ${WRKSRC}/libstdc++-v3/config/os/bsd/dragonfly
+.endif
+
+ # Apply required composite diff files
+.for suffix in ${APPLY_DIFFS}
+ @${ECHO} "Applying composite patch diff-${suffix}"
+ @${PATCH} -d ${WRKSRC} -s -E < ${FILESDIR}/diff-${suffix}
+.endfor
+
.if ${INTENDED_COMPILER} == "BOOTSTRAP"
${MKDIR} ${BOOTSTRAP_PREFIX}
${MV} ${BOOTSTRAP_PREFIX}/../bin ${BOOTSTRAP_PREFIX}
@@ -175,8 +236,6 @@ post-extract:
# Bootstrap compiler has statically linked z, gmp, mpc, mpfr and iconv
# The only shared lib is libc.so.7, so it should work for a long time.
- # if FBSD 9.0 upgrades libc, a compat8x requirement could be added
- # for FreeBSD 7.x and 8.x
.if ${OSVERSION} > 900000
# Since June 7, bootstrap compiler's include-fixed headers have been
@@ -186,11 +245,6 @@ post-extract:
.endif
do-configure:
- #reset timestamps
- cd ${WRKSRC}; contrib/gcc_update --touch
- ${RM} -f ${WRKSRC}/gcc/*/*.info*
- ${TOUCH} ${WRKSRC}/gcc/cstamp-h.in
-
${MKDIR} ${BUILDDIR}
cd ${BUILDDIR} && ${SETENV} ${ADA_CONFIGURE_ENV} \
${CFG_SCRIPT} ${CONFIGURE_ARGS}
@@ -199,13 +253,18 @@ do-build:
cd ${BUILDDIR} && ${SETENV} ${ADA_MAKE_ENV} ${GMAKE} ${_MAKE_JOBS} all
test: build
-.if defined(WITH_TS_ADA)
+.if defined(WITH_ADA) && defined(WITH_TS_ADA)
cd ${BUILDDIR} && ${SETENV} ${ADA_MAKE_ENV} ${GMAKE} -sk check-ada
.endif
-.if defined(WITH_TS_CXX)
- cd ${BUILDDIR} && ${SETENV} ${ADA_MAKE_ENV} ${GMAKE} -sk check-c++
- cd ${BUILDDIR} && ${SETENV} ${ADA_MAKE_ENV} \
- ${GMAKE} -sk check-target-libstdc++-v3
+.if defined(WITH_FORT) && defined(WITH_TS_FOR)
+ cd ${BUILDDIR} && ${SETENV} ${ADA_MAKE_ENV} ${GMAKE} -sk check-fortran
+.endif
+.if defined(WITH_OBJC) && defined(WITH_TS_OBC)
+ cd ${BUILDDIR} && ${SETENV} ${ADA_MAKE_ENV} ${GMAKE} -sk check-objc
+.endif
+.if defined(WITH_CXX) && defined(WITH_TS_CXX)
+ # libstdc++ testsuite will break every time, TRUE used to force continuation
+ cd ${BUILDDIR} && ${SETENV} ${ADA_MAKE_ENV} ${GMAKE} -sk check-c++ || true
.endif
.if defined(WITH_TS_GCC)
cd ${BUILDDIR} && ${SETENV} ${ADA_MAKE_ENV} ${GMAKE} -sk check-c
diff --git a/lang/gnat-aux/distinfo b/lang/gnat-aux/distinfo
index aa1f130715e5..cfb8c8104584 100644
--- a/lang/gnat-aux/distinfo
+++ b/lang/gnat-aux/distinfo
@@ -1,5 +1,15 @@
-SHA256 (gnat-aux-20110627.tar.bz2) = 4eeca0f7ff25eefa8b74e613597c7c0cbae19b9fd64e6d9d4e02c2d2e1624f83
-SIZE (gnat-aux-20110627.tar.bz2) = 26799024
+SHA256 (gcc-core-4.6.2.tar.bz2) = dcbf391f05277b7e09d14d54f3bdaba5515a3a8e7dd1d8af93af3f6f68455e10
+SIZE (gcc-core-4.6.2.tar.bz2) = 30258326
+SHA256 (gcc-ada-4.6.2.tar.bz2) = 9ac26821ad900d02ed251b62e6a0506ee12417b506a7bb9b02ec9f09e5d9c84f
+SIZE (gcc-ada-4.6.2.tar.bz2) = 6064757
+SHA256 (gcc-g++-4.6.2.tar.bz2) = 5470bea8093438cf5840fbbef3546b6dba7b0153ef6a16e142c1fba1fac6e598
+SIZE (gcc-g++-4.6.2.tar.bz2) = 6955594
+SHA256 (gcc-fortran-4.6.2.tar.bz2) = 492becd732662349eaa5e7c4e458ac009df0ccb8904df54ae295d277c4d6be6f
+SIZE (gcc-fortran-4.6.2.tar.bz2) = 1676539
+SHA256 (gcc-objc-4.6.2.tar.bz2) = 74cc0e46c7455f3781c740e0f49e06355d8b04a32cb6f015d2bfde39a9ad1dd4
+SIZE (gcc-objc-4.6.2.tar.bz2) = 342544
+SHA256 (gcc-testsuite-4.6.2.tar.bz2) = 146e2ec50913515989405162e8e861e17d710c3ca1d4d19073527ea24a0ef81e
+SIZE (gcc-testsuite-4.6.2.tar.bz2) = 6309400
SHA256 (gnat-bootstrap.i386.freebsd.tar.bz2) = c38e1c960f651c3f248c1ef540b1df724058fa71c1d046af93ce975483abb645
SIZE (gnat-bootstrap.i386.freebsd.tar.bz2) = 27973176
SHA256 (gnat-bootstrap.x86_64.freebsd.tar.bz2) = c4abd6af1281785d47d99352e28e41b2a1455e25ff347eca0de5791cdede9ed8
diff --git a/lang/gnat-aux/files/diff-ada b/lang/gnat-aux/files/diff-ada
new file mode 100644
index 000000000000..406aebd62fd7
--- /dev/null
+++ b/lang/gnat-aux/files/diff-ada
@@ -0,0 +1,9755 @@
+--- /dev/null
++++ gcc/ada/a-intnam-dragonfly.ads
+@@ -0,0 +1,133 @@
++------------------------------------------------------------------------------
++-- --
++-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
++-- --
++-- A D A . I N T E R R U P T S . N A M E S --
++-- --
++-- S p e c --
++-- --
++-- Copyright (C) 1991-2009, Free Software Foundation, Inc. --
++-- --
++-- GNARL is free software; you can redistribute it and/or modify it under --
++-- terms of the GNU General Public License as published by the Free Soft- --
++-- ware Foundation; either version 3, or (at your option) any later ver- --
++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
++-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
++-- or FITNESS FOR A PARTICULAR PURPOSE. --
++-- --
++-- As a special exception under Section 7 of GPL version 3, you are granted --
++-- additional permissions described in the GCC Runtime Library Exception, --
++-- version 3.1, as published by the Free Software Foundation. --
++-- --
++-- You should have received a copy of the GNU General Public License and --
++-- a copy of the GCC Runtime Library Exception along with this program; --
++-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
++-- <http://www.gnu.org/licenses/>. --
++-- --
++-- GNARL was developed by the GNARL team at Florida State University. --
++-- Extensive contributions were provided by Ada Core Technologies, Inc. --
++-- --
++-- Copyright (C) 2010 John Marino <draco@marino.st> --
++------------------------------------------------------------------------------
++
++-- This is the DragonFly BSD THREADS version of this package
++
++with System.OS_Interface;
++
++package Ada.Interrupts.Names is
++
++ -- Beware that the mapping of names to signals may be many-to-one. There
++ -- may be aliases. Also, for all signal names that are not supported on
++ -- the current system the value of the corresponding constant will be zero.
++
++ SIGHUP : constant Interrupt_ID :=
++ System.OS_Interface.SIGHUP; -- hangup
++
++ SIGINT : constant Interrupt_ID :=
++ System.OS_Interface.SIGINT; -- interrupt (rubout)
++
++ SIGQUIT : constant Interrupt_ID :=
++ System.OS_Interface.SIGQUIT; -- quit (ASCD FS)
++
++ SIGILL : constant Interrupt_ID :=
++ System.OS_Interface.SIGILL; -- illegal instruction (not reset)
++
++ SIGTRAP : constant Interrupt_ID :=
++ System.OS_Interface.SIGTRAP; -- trace trap (not reset)
++
++ SIGIOT : constant Interrupt_ID :=
++ System.OS_Interface.SIGIOT; -- IOT instruction
++
++ SIGABRT : constant Interrupt_ID := -- used by abort,
++ System.OS_Interface.SIGABRT; -- replace SIGIOT in the future
++
++ SIGFPE : constant Interrupt_ID :=
++ System.OS_Interface.SIGFPE; -- floating point exception
++
++ SIGKILL : constant Interrupt_ID :=
++ System.OS_Interface.SIGKILL; -- kill (cannot be caught or ignored)
++
++ SIGBUS : constant Interrupt_ID :=
++ System.OS_Interface.SIGBUS; -- bus error
++
++ SIGSEGV : constant Interrupt_ID :=
++ System.OS_Interface.SIGSEGV; -- segmentation violation
++
++ SIGPIPE : constant Interrupt_ID := -- write on a pipe with
++ System.OS_Interface.SIGPIPE; -- no one to read it
++
++ SIGALRM : constant Interrupt_ID :=
++ System.OS_Interface.SIGALRM; -- alarm clock
++
++ SIGTERM : constant Interrupt_ID :=
++ System.OS_Interface.SIGTERM; -- software termination signal from kill
++
++ SIGURG : constant Interrupt_ID :=
++ System.OS_Interface.SIGURG; -- urgent condition on IO channel
++
++ SIGSTOP : constant Interrupt_ID :=
++ System.OS_Interface.SIGSTOP; -- stop (cannot be caught or ignored)
++
++ SIGTSTP : constant Interrupt_ID :=
++ System.OS_Interface.SIGTSTP; -- user stop requested from tty
++
++ SIGCONT : constant Interrupt_ID :=
++ System.OS_Interface.SIGCONT; -- stopped process has been continued
++
++ SIGCHLD : constant Interrupt_ID :=
++ System.OS_Interface.SIGCHLD; -- 4.3BSD's/POSIX name for SIGCLD
++
++ SIGCLD : constant Interrupt_ID :=
++ System.OS_Interface.SIGCLD; -- child status change
++
++ SIGTTIN : constant Interrupt_ID :=
++ System.OS_Interface.SIGTTIN; -- background tty read attempted
++
++ SIGTTOU : constant Interrupt_ID :=
++ System.OS_Interface.SIGTTOU; -- background tty write attempted
++
++ SIGIO : constant Interrupt_ID := -- input/output possible,
++ System.OS_Interface.SIGIO; -- SIGPOLL alias (Solaris)
++
++ SIGXCPU : constant Interrupt_ID :=
++ System.OS_Interface.SIGXCPU; -- CPU time limit exceeded
++
++ SIGXFSZ : constant Interrupt_ID :=
++ System.OS_Interface.SIGXFSZ; -- filesize limit exceeded
++
++ SIGVTALRM : constant Interrupt_ID :=
++ System.OS_Interface.SIGVTALRM; -- virtual timer expired
++
++ SIGPROF : constant Interrupt_ID :=
++ System.OS_Interface.SIGPROF; -- profiling timer expired
++
++ SIGWINCH : constant Interrupt_ID :=
++ System.OS_Interface.SIGWINCH; -- window size change
++
++ SIGUSR1 : constant Interrupt_ID :=
++ System.OS_Interface.SIGUSR1; -- user defined signal 1
++
++ SIGUSR2 : constant Interrupt_ID :=
++ System.OS_Interface.SIGUSR2; -- user defined signal 2
++
++end Ada.Interrupts.Names;
+--- /dev/null
++++ gcc/ada/a-intnam-netbsd.ads
+@@ -0,0 +1,136 @@
++------------------------------------------------------------------------------
++-- --
++-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
++-- --
++-- A D A . I N T E R R U P T S . N A M E S --
++-- --
++-- S p e c --
++-- --
++-- Copyright (C) 1991-2009, Free Software Foundation, Inc. --
++-- --
++-- GNARL is free software; you can redistribute it and/or modify it under --
++-- terms of the GNU General Public License as published by the Free Soft- --
++-- ware Foundation; either version 3, or (at your option) any later ver- --
++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
++-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
++-- or FITNESS FOR A PARTICULAR PURPOSE. --
++-- --
++-- As a special exception under Section 7 of GPL version 3, you are granted --
++-- additional permissions described in the GCC Runtime Library Exception, --
++-- version 3.1, as published by the Free Software Foundation. --
++-- --
++-- You should have received a copy of the GNU General Public License and --
++-- a copy of the GCC Runtime Library Exception along with this program; --
++-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
++-- <http://www.gnu.org/licenses/>. --
++-- --
++-- GNARL was developed by the GNARL team at Florida State University. --
++-- Extensive contributions were provided by Ada Core Technologies, Inc. --
++-- --
++-- Copyright (C) 2010 John Marino <draco@marino.st> --
++------------------------------------------------------------------------------
++
++-- This is the NetBSD THREADS version of this package
++
++with System.OS_Interface;
++
++package Ada.Interrupts.Names is
++
++ -- Beware that the mapping of names to signals may be many-to-one. There
++ -- may be aliases. Also, for all signal names that are not supported on
++ -- the current system the value of the corresponding constant will be zero.
++
++ SIGHUP : constant Interrupt_ID :=
++ System.OS_Interface.SIGHUP; -- hangup
++
++ SIGINT : constant Interrupt_ID :=
++ System.OS_Interface.SIGINT; -- interrupt (rubout)
++
++ SIGQUIT : constant Interrupt_ID :=
++ System.OS_Interface.SIGQUIT; -- quit (ASCD FS)
++
++ SIGILL : constant Interrupt_ID :=
++ System.OS_Interface.SIGILL; -- illegal instruction (not reset)
++
++ SIGTRAP : constant Interrupt_ID :=
++ System.OS_Interface.SIGTRAP; -- trace trap (not reset)
++
++ SIGIOT : constant Interrupt_ID :=
++ System.OS_Interface.SIGIOT; -- IOT instruction
++
++ SIGABRT : constant Interrupt_ID := -- used by abort,
++ System.OS_Interface.SIGABRT; -- replace SIGIOT in the future
++
++ SIGFPE : constant Interrupt_ID :=
++ System.OS_Interface.SIGFPE; -- floating point exception
++
++ SIGKILL : constant Interrupt_ID :=
++ System.OS_Interface.SIGKILL; -- kill (cannot be caught or ignored)
++
++ SIGBUS : constant Interrupt_ID :=
++ System.OS_Interface.SIGBUS; -- bus error
++
++ SIGSEGV : constant Interrupt_ID :=
++ System.OS_Interface.SIGSEGV; -- segmentation violation
++
++ SIGPIPE : constant Interrupt_ID := -- write on a pipe with
++ System.OS_Interface.SIGPIPE; -- no one to read it
++
++ SIGALRM : constant Interrupt_ID :=
++ System.OS_Interface.SIGALRM; -- alarm clock
++
++ SIGTERM : constant Interrupt_ID :=
++ System.OS_Interface.SIGTERM; -- software termination signal from kill
++
++ SIGURG : constant Interrupt_ID :=
++ System.OS_Interface.SIGURG; -- urgent condition on IO channel
++
++ SIGSTOP : constant Interrupt_ID :=
++ System.OS_Interface.SIGSTOP; -- stop (cannot be caught or ignored)
++
++ SIGTSTP : constant Interrupt_ID :=
++ System.OS_Interface.SIGTSTP; -- user stop requested from tty
++
++ SIGCONT : constant Interrupt_ID :=
++ System.OS_Interface.SIGCONT; -- stopped process has been continued
++
++ SIGCHLD : constant Interrupt_ID :=
++ System.OS_Interface.SIGCHLD; -- 4.3BSD's/POSIX name for SIGCLD
++
++ SIGCLD : constant Interrupt_ID :=
++ System.OS_Interface.SIGCLD; -- child status change
++
++ SIGTTIN : constant Interrupt_ID :=
++ System.OS_Interface.SIGTTIN; -- background tty read attempted
++
++ SIGTTOU : constant Interrupt_ID :=
++ System.OS_Interface.SIGTTOU; -- background tty write attempted
++
++ SIGIO : constant Interrupt_ID := -- input/output possible,
++ System.OS_Interface.SIGIO; -- SIGPOLL alias (Solaris)
++
++ SIGXCPU : constant Interrupt_ID :=
++ System.OS_Interface.SIGXCPU; -- CPU time limit exceeded
++
++ SIGXFSZ : constant Interrupt_ID :=
++ System.OS_Interface.SIGXFSZ; -- filesize limit exceeded
++
++ SIGVTALRM : constant Interrupt_ID :=
++ System.OS_Interface.SIGVTALRM; -- virtual timer expired
++
++ SIGPROF : constant Interrupt_ID :=
++ System.OS_Interface.SIGPROF; -- profiling timer expired
++
++ SIGWINCH : constant Interrupt_ID :=
++ System.OS_Interface.SIGWINCH; -- window size change
++
++ SIGUSR1 : constant Interrupt_ID :=
++ System.OS_Interface.SIGUSR1; -- user defined signal 1
++
++ SIGUSR2 : constant Interrupt_ID :=
++ System.OS_Interface.SIGUSR2; -- user defined signal 2
++
++ SIGPWR : constant Interrupt_ID :=
++ System.OS_Interface.SIGPWR; -- power fail/restart
++
++end Ada.Interrupts.Names;
+--- /dev/null
++++ gcc/ada/a-intnam-openbsd.ads
+@@ -0,0 +1,133 @@
++------------------------------------------------------------------------------
++-- --
++-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
++-- --
++-- A D A . I N T E R R U P T S . N A M E S --
++-- --
++-- S p e c --
++-- --
++-- Copyright (C) 1991-2009, Free Software Foundation, Inc. --
++-- --
++-- GNARL is free software; you can redistribute it and/or modify it under --
++-- terms of the GNU General Public License as published by the Free Soft- --
++-- ware Foundation; either version 3, or (at your option) any later ver- --
++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
++-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
++-- or FITNESS FOR A PARTICULAR PURPOSE. --
++-- --
++-- As a special exception under Section 7 of GPL version 3, you are granted --
++-- additional permissions described in the GCC Runtime Library Exception, --
++-- version 3.1, as published by the Free Software Foundation. --
++-- --
++-- You should have received a copy of the GNU General Public License and --
++-- a copy of the GCC Runtime Library Exception along with this program; --
++-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
++-- <http://www.gnu.org/licenses/>. --
++-- --
++-- GNARL was developed by the GNARL team at Florida State University. --
++-- Extensive contributions were provided by Ada Core Technologies, Inc. --
++-- --
++-- Copyright (C) 2010 John Marino <draco@marino.st> --
++------------------------------------------------------------------------------
++
++-- This is the OpenBSD THREADS version of this package
++
++with System.OS_Interface;
++
++package Ada.Interrupts.Names is
++
++ -- Beware that the mapping of names to signals may be many-to-one. There
++ -- may be aliases. Also, for all signal names that are not supported on
++ -- the current system the value of the corresponding constant will be zero.
++
++ SIGHUP : constant Interrupt_ID :=
++ System.OS_Interface.SIGHUP; -- hangup
++
++ SIGINT : constant Interrupt_ID :=
++ System.OS_Interface.SIGINT; -- interrupt (rubout)
++
++ SIGQUIT : constant Interrupt_ID :=
++ System.OS_Interface.SIGQUIT; -- quit (ASCD FS)
++
++ SIGILL : constant Interrupt_ID :=
++ System.OS_Interface.SIGILL; -- illegal instruction (not reset)
++
++ SIGTRAP : constant Interrupt_ID :=
++ System.OS_Interface.SIGTRAP; -- trace trap (not reset)
++
++ SIGIOT : constant Interrupt_ID :=
++ System.OS_Interface.SIGIOT; -- IOT instruction
++
++ SIGABRT : constant Interrupt_ID := -- used by abort,
++ System.OS_Interface.SIGABRT; -- replace SIGIOT in the future
++
++ SIGFPE : constant Interrupt_ID :=
++ System.OS_Interface.SIGFPE; -- floating point exception
++
++ SIGKILL : constant Interrupt_ID :=
++ System.OS_Interface.SIGKILL; -- kill (cannot be caught or ignored)
++
++ SIGBUS : constant Interrupt_ID :=
++ System.OS_Interface.SIGBUS; -- bus error
++
++ SIGSEGV : constant Interrupt_ID :=
++ System.OS_Interface.SIGSEGV; -- segmentation violation
++
++ SIGPIPE : constant Interrupt_ID := -- write on a pipe with
++ System.OS_Interface.SIGPIPE; -- no one to read it
++
++ SIGALRM : constant Interrupt_ID :=
++ System.OS_Interface.SIGALRM; -- alarm clock
++
++ SIGTERM : constant Interrupt_ID :=
++ System.OS_Interface.SIGTERM; -- software termination signal from kill
++
++ SIGURG : constant Interrupt_ID :=
++ System.OS_Interface.SIGURG; -- urgent condition on IO channel
++
++ SIGSTOP : constant Interrupt_ID :=
++ System.OS_Interface.SIGSTOP; -- stop (cannot be caught or ignored)
++
++ SIGTSTP : constant Interrupt_ID :=
++ System.OS_Interface.SIGTSTP; -- user stop requested from tty
++
++ SIGCONT : constant Interrupt_ID :=
++ System.OS_Interface.SIGCONT; -- stopped process has been continued
++
++ SIGCHLD : constant Interrupt_ID :=
++ System.OS_Interface.SIGCHLD; -- 4.3BSD's/POSIX name for SIGCLD
++
++ SIGCLD : constant Interrupt_ID :=
++ System.OS_Interface.SIGCLD; -- child status change
++
++ SIGTTIN : constant Interrupt_ID :=
++ System.OS_Interface.SIGTTIN; -- background tty read attempted
++
++ SIGTTOU : constant Interrupt_ID :=
++ System.OS_Interface.SIGTTOU; -- background tty write attempted
++
++ SIGIO : constant Interrupt_ID := -- input/output possible,
++ System.OS_Interface.SIGIO; -- SIGPOLL alias (Solaris)
++
++ SIGXCPU : constant Interrupt_ID :=
++ System.OS_Interface.SIGXCPU; -- CPU time limit exceeded
++
++ SIGXFSZ : constant Interrupt_ID :=
++ System.OS_Interface.SIGXFSZ; -- filesize limit exceeded
++
++ SIGVTALRM : constant Interrupt_ID :=
++ System.OS_Interface.SIGVTALRM; -- virtual timer expired
++
++ SIGPROF : constant Interrupt_ID :=
++ System.OS_Interface.SIGPROF; -- profiling timer expired
++
++ SIGWINCH : constant Interrupt_ID :=
++ System.OS_Interface.SIGWINCH; -- window size change
++
++ SIGUSR1 : constant Interrupt_ID :=
++ System.OS_Interface.SIGUSR1; -- user defined signal 1
++
++ SIGUSR2 : constant Interrupt_ID :=
++ System.OS_Interface.SIGUSR2; -- user defined signal 2
++
++end Ada.Interrupts.Names;
+--- gcc/ada/adaint.c.orig
++++ gcc/ada/adaint.c
+@@ -27,6 +27,7 @@
+ * GNAT was originally developed by the GNAT team at New York University. *
+ * Extensive contributions were provided by Ada Core Technologies Inc. *
+ * *
++ * Copyright (C) 2010 John Marino <www.dragonlace.net> *
+ ****************************************************************************/
+
+ /* This file contains those routines named by Import pragmas in
+@@ -400,7 +401,11 @@
+ __gnat_current_time
+ (void)
+ {
++#if defined(__NetBSD__) && (__NetBSD__ > 5)
++ time_t res = __time50 (NULL);
++#else
+ time_t res = time (NULL);
++#endif
+ return (OS_Time) res;
+ }
+
+@@ -1047,6 +1052,7 @@
+ strcpy (path, "GNAT-XXXXXX");
+
+ #if (defined (__FreeBSD__) || defined (__NetBSD__) || defined (__OpenBSD__) \
++ || defined (__DragonFly__) \
+ || defined (linux) || defined(__GLIBC__)) && !defined (__vxworks)
+ return mkstemp (path);
+ #elif defined (__Lynx__)
+@@ -1195,7 +1201,49 @@
+ free (pname);
+ }
+
++#elif defined (__ANDROID__)
++
++ /*
++ * ext2 /ext3/ext4/fat16/fat32 have no path limits
++ * /data/local/tmp normally requires rooted devices, if it even exists
++ * /sdcard is the standard location for external storage. Nativeactivity
++ * manifest needs to authorize its use, otherwise it might not have the
++ * proper permissions.
++ */
++
++ int testfd;
++ char *datadir = getenv ("ANDROID_DATA");
++
++ if (datadir == NULL)
++ strcpy (tmp_filename, "/data/local/tmp/gnat-XXXXXX");
++ else
++ sprintf (tmp_filename, "%s/local/tmp/gnat-XXXXXX", datadir);
++
++ testfd = mkstemp (tmp_filename);
++ if (testfd != -1)
++ {
++ close (testfd);
++ return;
++ }
++
++ char *sdcard = getenv ("EXTERNAL_STORAGE");
++
++ if (sdcard == NULL)
++ strcpy (tmp_filename, "/sdcard/gnat-XXXXXX");
++ else
++ sprintf (tmp_filename, "%s/gnat-XXXXXX", sdcard);
++
++ testfd = mkstemp (tmp_filename);
++ if (testfd != -1)
++ {
++ close (testfd);
++ return;
++ }
++
++ tmpnam (tmp_filename);
++
+ #elif defined (linux) || defined (__FreeBSD__) || defined (__NetBSD__) \
++ || defined (__DragonFly__) \
+ || defined (__OpenBSD__) || defined(__GLIBC__)
+ #define MAX_SAFE_PATH 1000
+ char *tmpdir = getenv ("TMPDIR");
+@@ -1617,9 +1665,12 @@
+ /* Set access time to now in local time. */
+ t = time ((time_t) 0);
+ utimbuf.actime = mktime (localtime (&t));
+-
++#if defined(__NetBSD__) && (__NetBSD__ > 5)
++ __utime50 (name, &utimbuf);
++#else
+ utime (name, &utimbuf);
+ #endif
++#endif
+ }
+
+ /* Get the list of installed standard libraries from the
+@@ -2384,6 +2435,8 @@
+ int cores = 1;
+
+ #if defined (linux) || defined (sun) || defined (AIX) \
++ || defined (__FreeBSD__) || defined (__DragonFly__) \
++ || defined (__OpenBSD__) || defined (__NetBSD__) \
+ || (defined (__alpha__) && defined (_osf_)) || defined (__APPLE__)
+ cores = (int) sysconf (_SC_NPROCESSORS_ONLN);
+
+@@ -3421,25 +3474,214 @@
+ }
+ #endif
+
+-#if defined (IS_CROSS) \
+- || (! ((defined (sparc) || defined (i386)) && defined (sun) \
+- && defined (__SVR4)) \
+- && ! (defined (linux) && (defined (i386) || defined (__x86_64__))) \
+- && ! (defined (linux) && defined (__ia64__)) \
+- && ! (defined (linux) && defined (powerpc)) \
+- && ! defined (__FreeBSD__) \
+- && ! defined (__Lynx__) \
+- && ! defined (__hpux__) \
+- && ! defined (__APPLE__) \
+- && ! defined (_AIX) \
+- && ! (defined (__alpha__) && defined (__osf__)) \
+- && ! defined (VMS) \
+- && ! defined (__MINGW32__) \
+- && ! (defined (__mips) && defined (__sgi)))
+-
+-/* Dummy function to satisfy g-trasym.o. See the preprocessor conditional
+- just above for a list of native platforms that provide a non-dummy
+- version of this procedure in libaddr2line.a. */
++/* run-time symbolic traceback support */
++#if defined (__DragonFly__) \
++ || defined (__FreeBSD__) \
++ || defined (__OpenBSD__) \
++ || defined (__NetBSD__) \
++ || (defined (__sun__) && defined (__i386__) && defined (__SVR4))
++
++/* The above platforms use the external program /usr/bin/addr2line */
++#define EXTERNAL_SYMTRACE
++
++#elif defined (VMS) \
++ || defined (_AIX) \
++ || defined (__Lynx__) \
++ || defined (__hpux__) \
++ || defined (__APPLE__) \
++ || defined (__MINGW32__) \
++ || (defined (__mips) && defined (__sgi)) \
++ || (defined (__alpha__) && defined (__osf__)) \
++ || (defined (linux) && defined (i386)) \
++ || (defined (linux) && defined (powerpc)) \
++ || (defined (linux) && defined (__ia64__)) \
++ || (defined (linux) && defined (__x86_64__)) \
++ || (defined (__SVR4) && defined (__sun__) && defined (sparc))
++
++/* The above platforms use the system library libaddr2line.a */
++#define NATIVE_SYMTRACE
++#endif
++
++#if defined (EXTERNAL_SYMTRACE) && !defined (IS_CROSS)
++
++/*
++ Copyright (C) 1999 by Juergen Pfeifer <juergen.pfeifer@gmx.net>
++ Ada for Linux Team (ALT)
++ Heavily modified by John Marino <http://www.dragonlace.net>
++
++ Permission is hereby granted, free of charge, to any person obtaining a
++ copy of this software and associated documentation files (the
++ "Software"), to deal in the Software without restriction, including
++ without limitation the rights to use, copy, modify, merge, publish,
++ distribute, distribute with modifications, sublicense, and/or sell
++ copies of the Software, and to permit persons to whom the Software is
++ furnished to do so, subject to the following conditions:
++
++ The above copyright notice and this permission notice shall be included
++ in all copies or substantial portions of the Software.
++
++ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
++ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
++ IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
++ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
++ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
++ THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++
++ Except as contained in this notice, the name(s) of the above copyright
++ holders shall not be used in advertising or otherwise to promote the
++ sale, use or other dealings in this Software without prior written
++ authorization.
++*/
++
++#include <sys/types.h>
++#include <stdlib.h>
++#include <unistd.h>
++#include <string.h>
++#include <signal.h>
++
++#define CLOSE_SENDPIPE close(sendpipe[0]); close(sendpipe[1])
++#define CLOSE_READPIPE close(readpipe[0]); close(readpipe[1])
++#define DUP2CLOSE(oldfd, newfd) dup2(oldfd, newfd); close(oldfd);
++#define RESTSIG sigaction(SIGPIPE,&oact,NULL)
++
++#define MAX_LINE 1024
++#define PARENT_READ readpipe[0]
++#define CHILD_WRITE readpipe[1]
++#define CHILD_READ sendpipe[0]
++#define PARENT_WRITE sendpipe[1]
++
++#if defined (__sun__)
++#define ADDR2LINE_PROG "/usr/gnu/bin/addr2line"
++#else
++#define ADDR2LINE_PROG "/usr/bin/addr2line"
++#endif
++
++void
++convert_addresses (const char *file_name,
++ void *addrs,
++ int n_addr,
++ void *buf,
++ int *len)
++{
++ int max_len = *len;
++ pid_t childpid;
++
++ struct sigaction act, oact;
++
++ int sendpipe[2] = {-1,-1}, /* parent -> child */
++ readpipe[2] = {-1,-1}; /* parent <- child */
++
++ *len = 0;
++ act.sa_handler = SIG_IGN;
++ sigemptyset(&act.sa_mask);
++ act.sa_flags = 0;
++ if (sigaction(SIGPIPE,&act,&oact) < 0)
++ return;
++
++ if (pipe(sendpipe) < 0) { RESTSIG; return; }
++ if (pipe(readpipe) < 0) { CLOSE_SENDPIPE; RESTSIG; return; }
++ if ((childpid = fork()) < 0) {
++ CLOSE_READPIPE;
++ CLOSE_SENDPIPE;
++ RESTSIG;
++ return;
++ }
++
++ if (childpid == 0) { /* child process */
++ close(PARENT_WRITE);
++ close(PARENT_READ);
++ if ((CHILD_READ != STDIN_FILENO) && (CHILD_WRITE != STDOUT_FILENO)) {
++ if ((CHILD_READ == STDOUT_FILENO) && (CHILD_WRITE == STDIN_FILENO)) {
++ const int temp_fd = dup(CHILD_WRITE);
++ close (CHILD_WRITE);
++ DUP2CLOSE (CHILD_READ, STDIN_FILENO);
++ DUP2CLOSE (temp_fd, STDOUT_FILENO);
++ }
++ else if ((CHILD_READ == STDIN_FILENO) && (CHILD_WRITE > 1)) {
++ DUP2CLOSE (CHILD_WRITE, STDOUT_FILENO);
++ }
++ else if ((CHILD_READ > 1) && (CHILD_WRITE == STDOUT_FILENO)) {
++ DUP2CLOSE (CHILD_READ, STDIN_FILENO);
++ }
++ else if ((CHILD_READ > 1) && (CHILD_WRITE == STDIN_FILENO)) {
++ DUP2CLOSE (CHILD_WRITE, STDOUT_FILENO);
++ DUP2CLOSE (CHILD_READ, STDIN_FILENO);
++ }
++ else {
++ /* CHILD_READ >= 1 and CHILD_WRITE > 1 */
++ DUP2CLOSE (CHILD_READ, STDIN_FILENO);
++ DUP2CLOSE (CHILD_WRITE, STDOUT_FILENO);
++ }
++ }
++ /* As pointed out by Florian Weimer to JP, it is a security threat to call
++ the script with a user defined environment and using the path. That
++ would be Trojans pleasure. Therefore the absolute path to addr2line
++ and an empty environment is used. That should be safe.
++ */
++ char *const argv[] = { "addr2line",
++ "-e", file_name,
++ "--demangle=gnat",
++ "--functions",
++ "--basenames",
++ NULL };
++ char *const envp[] = { NULL };
++ if (execve(ADDR2LINE_PROG, argv, envp) < 0) {
++ close (CHILD_WRITE);
++ close (CHILD_READ);
++ RESTSIG;
++ exit (1);
++ }
++ }
++
++ /* Below this line is parent process */
++ int i, n;
++ char hex[16];
++ char line[MAX_LINE + 1];
++ char *p;
++ char *s = buf;
++ long *trace_address = addrs;
++
++ close(CHILD_WRITE);
++ close(CHILD_READ);
++
++ for(i=0; i < n_addr; i++) {
++ snprintf(hex,sizeof(hex),"%#lx\n",*trace_address);
++ write(PARENT_WRITE,hex,strlen(hex));
++ n = read(PARENT_READ,line,MAX_LINE);
++ if (n<=0)
++ break;
++
++ line[n]=0;
++ /* We have approx. 16 additional chars for "%#lx in " clause.
++ We use this info to prevent a buffer overrun. */
++ if (n + 16 + (*len) > max_len)
++ break;
++
++ p = strchr(line,'\n');
++ if (p) {
++ if (*(p+1)) {
++ *p = 0;
++ *len += snprintf(s, (max_len - (*len)), "%#lx in %s at %s",
++ *trace_address, line, p+1);
++ }
++ else {
++ *len += snprintf(s, (max_len - (*len)), "%#lx at %s",
++ *trace_address, line);
++ }
++ s = buf + (*len);
++ }
++ trace_address += 1;
++ }
++ close (PARENT_WRITE);
++ close (PARENT_READ);
++ RESTSIG;
++}
++
++#elif defined (IS_CROSS) || !defined (NATIVE_SYMTRACE)
++
++/* run-time symbolic traceback support
++ Dummy function to satisfy g-trasym.o. */
+
+ void
+ convert_addresses (const char *file_name ATTRIBUTE_UNUSED,
+@@ -3686,3 +3928,110 @@
+ return (void *) syscall (__NR_gettid);
+ }
+ #endif
++
++
++
++
++#ifdef MARINO_DISABLED_THIS
++/* JRM 31 OCT 2010: For some reason, gnatmake wouldn't function correct when
++ strcpy or sprintf & friends were replaced. I had to back out the patches.
++ I'll leave the BSD routines here in case we ever want to try again. */
++
++
++/*
++ * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
++ *
++ * Permission to use, copy, modify, and distribute this software for any
++ * purpose with or without fee is hereby granted, provided that the above
++ * copyright notice and this permission notice appear in all copies.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
++ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
++ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ */
++
++/*
++ * original function name: strlcpy
++ * Copy src to string dst of size siz. At most siz-1 characters
++ * will be copied. Always NUL terminates (unless siz == 0).
++ * Returns strlen(src); if retval >= siz, truncation occurred.
++ *
++ * $OpenBSD: strlcpy.c,v 1.11 2006/05/05 15:27:38 millert Exp $
++ * $FreeBSD: /tmp/pcvs/ports/lang/gnat-aux/files/diff-ada,v 1.1 2012-01-12 14:24:37 culot Exp $
++ * $DragonFly: src/lib/libc/string/strlcpy.c,v 1.4 2005/09/18 asmodai Exp $
++ */
++
++size_t
++bsd_strlcpy(char *dst, const char *src, size_t siz)
++{
++ char *d = dst;
++ const char *s = src;
++ size_t n = siz;
++
++ /* Copy as many bytes as will fit */
++ if (n != 0) {
++ while (--n != 0) {
++ if ((*d++ = *s++) == '\0')
++ break;
++ }
++ }
++
++ /* Not enough room in dst, add NUL and traverse rest of src */
++ if (n == 0) {
++ if (siz != 0)
++ *d = '\0'; /* NUL-terminate dst */
++ while (*s++)
++ ;
++ }
++
++ return(s - src - 1); /* count does not include NUL */
++}
++
++
++
++/*
++ * Original function name: strlcat
++ * Appends src to string dst of size siz (unlike strncat, siz is the
++ * full size of dst, not space left). At most siz-1 characters
++ * will be copied. Always NUL terminates (unless siz <= strlen(dst)).
++ * Returns strlen(src) + MIN(siz, strlen(initial dst)).
++ * If retval >= siz, truncation occurred.
++ *
++ * $OpenBSD: strlcat.c,v 1.13 2005/08/08 08:05:37 espie Exp $
++ * $FreeBSD: /tmp/pcvs/ports/lang/gnat-aux/files/diff-ada,v 1.1 2012-01-12 14:24:37 culot Exp $
++ * $DragonFly: src/lib/libc/string/strlcat.c,v 1.4 2004/12/18 asmodai Exp $
++ */
++
++size_t
++bsd_strlcat(char *dst, const char *src, size_t siz)
++{
++ char *d = dst;
++ const char *s = src;
++ size_t n = siz;
++ size_t dlen;
++
++ /* Find the end of dst and adjust bytes left but don't go past end */
++ while (n-- != 0 && *d != '\0')
++ d++;
++ dlen = d - dst;
++ n = siz - dlen;
++
++ if (n == 0)
++ return(dlen + strlen(s));
++ while (*s != '\0') {
++ if (n != 1) {
++ *d++ = *s;
++ n--;
++ }
++ s++;
++ }
++ *d = '\0';
++
++ return(dlen + (s - src)); /* count does not include NUL */
++}
++#endif
++
+--- gcc/ada/cio.c.orig
++++ gcc/ada/cio.c
+@@ -27,6 +27,7 @@
+ * GNAT was originally developed by the GNAT team at New York University. *
+ * Extensive contributions were provided by Ada Core Technologies Inc. *
+ * *
++ * Copyright (C) 2011 John Marino <www.dragonlace.net> *
+ ****************************************************************************/
+
+ #ifdef IN_RTS
+@@ -42,7 +43,8 @@
+
+ /* Don't use macros on GNU/Linux since they cause incompatible changes between
+ glibc 2.0 and 2.1 */
+-#ifdef linux
++/* Android is The exception because it uses the BIONIC library */
++#if defined(linux) && !defined(__ANDROID__)
+ #undef putchar
+ #undef getchar
+ #undef fputc
+--- gcc/ada/cstreams.c.orig
++++ gcc/ada/cstreams.c
+@@ -27,6 +27,7 @@
+ * GNAT was originally developed by the GNAT team at New York University. *
+ * Extensive contributions were provided by Ada Core Technologies Inc. *
+ * *
++ * Copyright (C) 2010 John Marino <draco@marino.st> *
+ ****************************************************************************/
+
+ /* Routines required for implementing routines in Interfaces.C.Streams */
+@@ -50,9 +51,10 @@
+ #include <unixlib.h>
+ #endif
+
+-#ifdef linux
++#if defined(linux) && !defined(__ANDROID__)
+ /* Don't use macros on GNU/Linux since they cause incompatible changes between
+ glibc 2.0 and 2.1 */
++/* Android is The exception because it uses the BIONIC library */
+
+ #ifdef stderr
+ # undef stderr
+@@ -173,7 +175,9 @@
+ *p = '\\';
+ }
+
+-#elif defined (sgi) || defined (__FreeBSD__)
++#elif defined (sgi) || defined (__FreeBSD__) \
++ || defined (__DragonFly__) \
++ || defined (__OpenBSD__)
+
+ /* Use realpath function which resolves links and references to . and ..
+ on those Unix systems that support it. Note that GNU/Linux provides it but
+--- gcc/ada/env.c.orig
++++ gcc/ada/env.c
+@@ -27,6 +27,7 @@
+ * GNAT was originally developed by the GNAT team at New York University. *
+ * Extensive contributions were provided by Ada Core Technologies Inc. *
+ * *
++ * Copyright (C) 2010 John Marino <draco@marino.st> *
+ ****************************************************************************/
+
+ /* Tru64 UNIX V4.0F <stdlib.h> declares unsetenv() only if AES_SOURCE (which
+@@ -172,7 +173,8 @@
+ LIB$SIGNAL (status);
+ }
+
+-#elif (defined (__vxworks) && defined (__RTP__)) || defined (__APPLE__)
++#elif (defined (__vxworks) && defined (__RTP__)) || defined (__APPLE__) \
++ || defined (__OpenBSD__)
+ setenv (name, value, 1);
+
+ #else
+@@ -299,6 +301,7 @@
+ }
+ #elif defined (__MINGW32__) || defined (__FreeBSD__) || defined (__APPLE__) \
+ || (defined (__vxworks) && defined (__RTP__)) || defined (__CYGWIN__) \
++ || defined (__DragonFly__) \
+ || defined (__NetBSD__) || defined (__OpenBSD__) || defined (__rtems__)
+ /* On Windows, FreeBSD and MacOS there is no function to clean all the
+ environment but there is a "clean" way to unset a variable. So go
+--- gcc/ada/errno.c.orig
++++ gcc/ada/errno.c
+@@ -27,6 +27,7 @@
+ * GNAT was originally developed by the GNAT team at New York University. *
+ * Extensive contributions were provided by Ada Core Technologies Inc. *
+ * *
++ * Copyright (C) 2011 John Marino <www.dragonlace.net> *
+ ****************************************************************************/
+
+ /* This file provides access to the C-language errno to the Ada interface
+@@ -39,6 +40,7 @@
+ #define _REENTRANT
+ #define _THREAD_SAFE
+ #define _SGI_MP_SOURCE
++#define GNAT_SET_ERRNO
+
+ #ifdef MaRTE
+
+@@ -52,6 +54,17 @@
+
+ #endif
+
++#ifdef __ANDROID__
++
++/* The ANDROID errno.h file also defines __set_errno as an external variable
++ for use with syscalls. It should not be referenced directly, but we are
++ going to do it anyway because the alternative solution is to rename all
++ uses of __set_errno in GNAT. */
++
++#undef GNAT_SET_ERRNO
++#endif
++
++
+ #include <errno.h>
+ int
+ __get_errno(void)
+@@ -59,8 +72,10 @@
+ return errno;
+ }
+
++#ifdef GNAT_SET_ERRNO
+ void
+ __set_errno(int err)
+ {
+ errno = err;
+ }
++#endif
+--- gcc/ada/g-comlin.adb.orig
++++ gcc/ada/g-comlin.adb
+@@ -27,6 +27,7 @@
+ -- GNAT was originally developed by the GNAT team at New York University. --
+ -- Extensive contributions were provided by Ada Core Technologies Inc. --
+ -- --
++-- Copyright (C) 2010 John Marino <draco@marino.st> --
+ ------------------------------------------------------------------------------
+
+ with Ada.Characters.Handling; use Ada.Characters.Handling;
+@@ -512,6 +513,7 @@
+ begin
+ Index_In_Switches := 0;
+ Switch_Length := 0;
++ Param := Parameter_None;
+
+ -- Remove all leading spaces first to make sure that Index points
+ -- at the start of the first switch.
+--- gcc/ada/g-expect.adb.orig
++++ gcc/ada/g-expect.adb
+@@ -29,6 +29,7 @@
+ -- GNAT was originally developed by the GNAT team at New York University. --
+ -- Extensive contributions were provided by Ada Core Technologies Inc. --
+ -- --
++-- Copyright (C) 2010 John Marino <draco@marino.st> --
+ ------------------------------------------------------------------------------
+
+ with System; use System;
+@@ -1333,15 +1334,21 @@
+
+ -- The following commands are not executed on Unix systems, and are only
+ -- required for Windows systems. We are now in the parent process.
++ -- Although the if-statement is redundant, it's here so the compiler
++ -- doesn't complain about uninitialized variables.
+
+- -- Restore the old descriptors
++ if No_Fork_On_Target then
++
++ -- Restore the old descriptors
++
++ Dup2 (Input, GNAT.OS_Lib.Standin);
++ Dup2 (Output, GNAT.OS_Lib.Standout);
++ Dup2 (Error, GNAT.OS_Lib.Standerr);
++ Close (Input);
++ Close (Output);
++ Close (Error);
++ end if;
+
+- Dup2 (Input, GNAT.OS_Lib.Standin);
+- Dup2 (Output, GNAT.OS_Lib.Standout);
+- Dup2 (Error, GNAT.OS_Lib.Standerr);
+- Close (Input);
+- Close (Output);
+- Close (Error);
+ end Set_Up_Child_Communications;
+
+ ---------------------------
+--- /dev/null
++++ gcc/ada/g-socthi-bsd.adb
+@@ -0,0 +1,379 @@
++------------------------------------------------------------------------------
++-- --
++-- GNAT COMPILER COMPONENTS --
++-- --
++-- G N A T . S O C K E T S . T H I N --
++-- --
++-- B o d y --
++-- --
++-- Copyright (C) 2001-2009, AdaCore --
++-- --
++-- GNAT is free software; you can redistribute it and/or modify it under --
++-- terms of the GNU General Public License as published by the Free Soft- --
++-- ware Foundation; either version 2, or (at your option) any later ver- --
++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
++-- OUT 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 distributed with GNAT; see file COPYING. If not, write --
++-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
++-- Boston, MA 02110-1301, USA. --
++-- --
++-- As a special exception, if other files instantiate generics from this --
++-- unit, or you link this unit with other files to produce an executable, --
++-- this unit does not by itself cause the resulting executable to be --
++-- covered by the GNU General Public License. This exception does not --
++-- however invalidate any other reasons why the executable file might be --
++-- covered by the GNU Public License. --
++-- --
++-- GNAT was originally developed by the GNAT team at New York University. --
++-- Extensive contributions were provided by Ada Core Technologies Inc. --
++-- --
++-- Copyright (C) 2010 John Marino <draco@marino.st> --
++------------------------------------------------------------------------------
++
++-- This package provides a target dependent thin interface to the sockets
++-- layer for use by the GNAT.Sockets package (g-socket.ads). This package
++-- should not be directly with'ed by an applications program.
++
++-- This is the *BSD version which uses fcntl rather than ioctl
++-- The constant SCON.Thread_Blocking_IO is always true (for all platforms, not
++-- just *BSD), so this binding is significantly simpler than the standard
++-- one it replaces.
++
++with GNAT.OS_Lib; use GNAT.OS_Lib;
++
++with Interfaces.C; use Interfaces.C;
++
++package body GNAT.Sockets.Thin is
++
++ Unknown_System_Error : constant C.Strings.chars_ptr :=
++ C.Strings.New_String ("Unknown system error");
++
++ function Syscall_Accept
++ (S : C.int;
++ Addr : System.Address;
++ Addrlen : not null access C.int) return C.int;
++ pragma Import (C, Syscall_Accept, "accept");
++ -- The accept() function accepts a connection on a socket. An incoming
++ -- connection is acknowledged and associated with an immediately created
++ -- socket. The original socket is returned to the listening state.
++
++ function Syscall_Connect
++ (S : C.int;
++ Name : System.Address;
++ Namelen : C.int) return C.int;
++ pragma Import (C, Syscall_Connect, "connect");
++ -- The connect() system call initiates a connection on a socket. If the
++ -- parameter S is of type SOCK_DGRAM then connect() permanently specifies
++ -- the peer to which datagrams are to be sent. If S is type SOCK_STREAM
++ -- then connect() attempts to make a connection with another socket, which
++ -- is identified by the parameter Name.
++
++ function Syscall_Recv
++ (S : C.int;
++ Msg : System.Address;
++ Len : C.int;
++ Flags : C.int) return C.int;
++ pragma Import (C, Syscall_Recv, "recv");
++ -- The recv() function receives a message from a socket. The call can be
++ -- used on a connection mode socket or a bound, connectionless socket. If
++ -- no messages are available at the socket, the recv() call waits for a
++ -- message to arrive unless the socket is non-blocking. If a socket is
++ -- non-blocking, the call returns a -1 and ERRNO is set to EWOULDBLOCK.
++
++ function Syscall_Recvfrom
++ (S : C.int;
++ Msg : System.Address;
++ Len : C.int;
++ Flags : C.int;
++ From : System.Address;
++ Fromlen : not null access C.int) return C.int;
++ pragma Import (C, Syscall_Recvfrom, "recvfrom");
++ -- The recvfrom() system call receives a message from a socket and captures
++ -- the address from which the data was sent. It can be used to receive
++ -- data on an unconnected socket as well. If no messages are available,
++ -- the call waits for a message to arrive on blocking sockets. For
++ -- non-blocking sockets without messages, -1 is returned and ERRNO is set
++ -- to EAGAIN or EWOULDBLOCK.
++
++ function Syscall_Recvmsg
++ (S : C.int;
++ Msg : System.Address;
++ Flags : C.int) return System.CRTL.ssize_t;
++ pragma Import (C, Syscall_Recvmsg, "recvmsg");
++ -- The recvmsg call receives a message from a socket, and can be used to
++ -- receive data on an unconnected socket as well. If no messages are
++ -- available, the call waits for a message to arrive on blocking sockets.
++ -- For non-blocking sockets without messages, -1 is returned and ERRNO is
++ -- set to EAGAIN or EWOULDBLOCK.
++
++ function Syscall_Sendmsg
++ (S : C.int;
++ Msg : System.Address;
++ Flags : C.int) return System.CRTL.ssize_t;
++ pragma Import (C, Syscall_Sendmsg, "sendmsg");
++ -- The sendmsg() function sends a message to a socket, and can be used with
++ -- unconnected sockets as well (the msg is ignored in this case). The
++ -- function returns the number of bytes sent when successful, otherwise it
++ -- returns -1 and ERRNO is set (many possible values).
++
++ function Syscall_Sendto
++ (S : C.int;
++ Msg : System.Address;
++ Len : C.int;
++ Flags : C.int;
++ To : System.Address;
++ Tolen : C.int) return C.int;
++ pragma Import (C, Syscall_Sendto, "sendto");
++ -- The sendto() function only works for connected sockets and it initiates
++ -- the transmission of a message. A successful call returns the numbers of
++ -- bytes sent, and a failure returns a -1 and ERRNO is set.
++
++ function Syscall_Socket
++ (Domain : C.int;
++ Typ : C.int;
++ Protocol : C.int) return C.int;
++ pragma Import (C, Syscall_Socket, "socket");
++ -- The socket() function is used to create an unbound socket and returns a
++ -- file descriptor that can be used with other socket functions. Upon
++ -- failure, a -1 is returned and ERRNO is set.
++
++ procedure Disable_SIGPIPE (S : C.int);
++ pragma Import (C, Disable_SIGPIPE, "__gnat_disable_sigpipe");
++
++ procedure Disable_All_SIGPIPEs;
++ pragma Import (C, Disable_All_SIGPIPEs, "__gnat_disable_all_sigpipes");
++ -- Sets the process to ignore all SIGPIPE signals on platforms that
++ -- don't support Disable_SIGPIPE for particular streams.
++
++ function C_Fcntl
++ (Fd : C.int;
++ Cmd : C.int;
++ Val : C.int) return C.int;
++ pragma Import (C, C_Fcntl, "fcntl");
++ -- The ioctl of 64-bit DragonFlyBSD, OpenBSD, and NetBSD does not support
++ -- setting a socket in non-blocking mode. fcntl must be used instead.
++
++ --------------
++ -- C_Accept --
++ --------------
++
++ function C_Accept
++ (S : C.int;
++ Addr : System.Address;
++ Addrlen : not null access C.int) return C.int
++ is
++ Res : constant C.int := Syscall_Accept (S, Addr, Addrlen);
++ begin
++
++ Disable_SIGPIPE (Res);
++ return Res;
++
++ end C_Accept;
++
++ ---------------
++ -- C_Connect --
++ ---------------
++
++ function C_Connect
++ (S : C.int;
++ Name : System.Address;
++ Namelen : C.int) return C.int
++ is
++ begin
++
++ return Syscall_Connect (S, Name, Namelen);
++
++ end C_Connect;
++
++ ------------------
++ -- Socket_Ioctl --
++ ------------------
++
++ function Socket_Ioctl
++ (S : C.int;
++ Req : C.int;
++ Arg : access C.int) return C.int
++ is
++ -- Currently all requests are of the FIONBIO type, so always calc flags
++ use Interfaces;
++ flags : constant Unsigned_32 :=
++ Unsigned_32 (C_Fcntl (S, SOSC.F_GETFL, 0));
++ nonblock : constant Unsigned_32 := Unsigned_32 (SOSC.FNDELAY);
++ enabled : constant Boolean := Arg.all = 1;
++ newval : C.int;
++ begin
++ if Req = SOSC.FIONBIO then
++ if enabled then
++ newval := C.int (flags or nonblock);
++ elsif (flags and nonblock) > 0 then
++ newval := C.int (flags - nonblock);
++ else
++ newval := C.int (flags);
++ end if;
++ return C_Fcntl (Fd => S, Cmd => SOSC.F_SETFL, Val => newval);
++ else
++ return C_Ioctl (Fd => S, Req => Req, Arg => Arg);
++ end if;
++ end Socket_Ioctl;
++
++ ------------
++ -- C_Recv --
++ ------------
++
++ function C_Recv
++ (S : C.int;
++ Msg : System.Address;
++ Len : C.int;
++ Flags : C.int) return C.int
++ is
++ begin
++
++ return Syscall_Recv (S, Msg, Len, Flags);
++
++ end C_Recv;
++
++ ----------------
++ -- C_Recvfrom --
++ ----------------
++
++ function C_Recvfrom
++ (S : C.int;
++ Msg : System.Address;
++ Len : C.int;
++ Flags : C.int;
++ From : System.Address;
++ Fromlen : not null access C.int) return C.int
++ is
++ begin
++
++ return Syscall_Recvfrom (S, Msg, Len, Flags, From, Fromlen);
++
++ end C_Recvfrom;
++
++ ---------------
++ -- C_Recvmsg --
++ ---------------
++
++ function C_Recvmsg
++ (S : C.int;
++ Msg : System.Address;
++ Flags : C.int) return System.CRTL.ssize_t
++ is
++ begin
++
++ return Syscall_Recvmsg (S, Msg, Flags);
++
++ end C_Recvmsg;
++
++ ---------------
++ -- C_Sendmsg --
++ ---------------
++
++ function C_Sendmsg
++ (S : C.int;
++ Msg : System.Address;
++ Flags : C.int) return System.CRTL.ssize_t
++ is
++ begin
++
++ return Syscall_Sendmsg (S, Msg, Flags);
++
++ end C_Sendmsg;
++
++ --------------
++ -- C_Sendto --
++ --------------
++
++ function C_Sendto
++ (S : C.int;
++ Msg : System.Address;
++ Len : C.int;
++ Flags : C.int;
++ To : System.Address;
++ Tolen : C.int) return C.int
++ is
++ begin
++
++ return Syscall_Sendto (S, Msg, Len, Flags, To, Tolen);
++
++ end C_Sendto;
++
++ --------------
++ -- C_Socket --
++ --------------
++
++ function C_Socket
++ (Domain : C.int;
++ Typ : C.int;
++ Protocol : C.int) return C.int
++ is
++ Res : constant C.int := Syscall_Socket (Domain, Typ, Protocol);
++ begin
++
++ Disable_SIGPIPE (Res);
++ return Res;
++
++ end C_Socket;
++
++ --------------
++ -- Finalize --
++ --------------
++
++ procedure Finalize is
++ begin
++ null;
++ end Finalize;
++
++ -------------------------
++ -- Host_Error_Messages --
++ -------------------------
++
++ package body Host_Error_Messages is separate;
++
++ ----------------
++ -- Initialize --
++ ----------------
++
++ procedure Initialize is
++ begin
++ Disable_All_SIGPIPEs;
++ end Initialize;
++
++ --------------------
++ -- Signalling_Fds --
++ --------------------
++
++ package body Signalling_Fds is
++
++ -- In this default implementation, we use a C version of these
++ -- subprograms provided by socket.c.
++
++ function C_Create (Fds : not null access Fd_Pair) return C.int;
++ function C_Read (Rsig : C.int) return C.int;
++ function C_Write (Wsig : C.int) return C.int;
++ procedure C_Close (Sig : C.int);
++
++ pragma Import (C, C_Create, "__gnat_create_signalling_fds");
++ pragma Import (C, C_Read, "__gnat_read_signalling_fd");
++ pragma Import (C, C_Write, "__gnat_write_signalling_fd");
++ pragma Import (C, C_Close, "__gnat_close_signalling_fd");
++
++ function Create
++ (Fds : not null access Fd_Pair) return C.int renames C_Create;
++ function Read (Rsig : C.int) return C.int renames C_Read;
++ function Write (Wsig : C.int) return C.int renames C_Write;
++ procedure Close (Sig : C.int) renames C_Close;
++
++ end Signalling_Fds;
++
++ --------------------------
++ -- Socket_Error_Message --
++ --------------------------
++
++ function Socket_Error_Message
++ (Errno : Integer) return C.Strings.chars_ptr
++ is separate;
++
++end GNAT.Sockets.Thin;
+--- /dev/null
++++ gcc/ada/g-socthi-netbsd.adb
+@@ -0,0 +1,381 @@
++------------------------------------------------------------------------------
++-- --
++-- GNAT COMPILER COMPONENTS --
++-- --
++-- G N A T . S O C K E T S . T H I N --
++-- --
++-- B o d y --
++-- --
++-- Copyright (C) 2001-2009, AdaCore --
++-- --
++-- GNAT is free software; you can redistribute it and/or modify it under --
++-- terms of the GNU General Public License as published by the Free Soft- --
++-- ware Foundation; either version 2, or (at your option) any later ver- --
++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
++-- OUT 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 distributed with GNAT; see file COPYING. If not, write --
++-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
++-- Boston, MA 02110-1301, USA. --
++-- --
++-- As a special exception, if other files instantiate generics from this --
++-- unit, or you link this unit with other files to produce an executable, --
++-- this unit does not by itself cause the resulting executable to be --
++-- covered by the GNU General Public License. This exception does not --
++-- however invalidate any other reasons why the executable file might be --
++-- covered by the GNU Public License. --
++-- --
++-- GNAT was originally developed by the GNAT team at New York University. --
++-- Extensive contributions were provided by Ada Core Technologies Inc. --
++-- --
++-- Copyright (C) 2010, 2011 John Marino <www.dragonlace.net> --
++------------------------------------------------------------------------------
++
++-- This package provides a target dependent thin interface to the sockets
++-- layer for use by the GNAT.Sockets package (g-socket.ads). This package
++-- should not be directly with'ed by an applications program.
++
++-- This is the NetBSD version which uses fcntl rather than ioctl
++-- The constant SCON.Thread_Blocking_IO is always true (for all platforms, not
++-- just *BSD), so this binding is significantly simpler than the standard
++-- one it replaces.
++-- NetBSD uses binary compatibility functions that are forcing the use of
++-- their own files rather than sharing the *BSD versions.
++
++with GNAT.OS_Lib; use GNAT.OS_Lib;
++
++with Interfaces.C; use Interfaces.C;
++
++package body GNAT.Sockets.Thin is
++
++ Unknown_System_Error : constant C.Strings.chars_ptr :=
++ C.Strings.New_String ("Unknown system error");
++
++ function Syscall_Accept
++ (S : C.int;
++ Addr : System.Address;
++ Addrlen : not null access C.int) return C.int;
++ pragma Import (C, Syscall_Accept, "accept");
++ -- The accept() function accepts a connection on a socket. An incoming
++ -- connection is acknowledged and associated with an immediately created
++ -- socket. The original socket is returned to the listening state.
++
++ function Syscall_Connect
++ (S : C.int;
++ Name : System.Address;
++ Namelen : C.int) return C.int;
++ pragma Import (C, Syscall_Connect, "connect");
++ -- The connect() system call initiates a connection on a socket. If the
++ -- parameter S is of type SOCK_DGRAM then connect() permanently specifies
++ -- the peer to which datagrams are to be sent. If S is type SOCK_STREAM
++ -- then connect() attempts to make a connection with another socket, which
++ -- is identified by the parameter Name.
++
++ function Syscall_Recv
++ (S : C.int;
++ Msg : System.Address;
++ Len : C.int;
++ Flags : C.int) return C.int;
++ pragma Import (C, Syscall_Recv, "recv");
++ -- The recv() function receives a message from a socket. The call can be
++ -- used on a connection mode socket or a bound, connectionless socket. If
++ -- no messages are available at the socket, the recv() call waits for a
++ -- message to arrive unless the socket is non-blocking. If a socket is
++ -- non-blocking, the call returns a -1 and ERRNO is set to EWOULDBLOCK.
++
++ function Syscall_Recvfrom
++ (S : C.int;
++ Msg : System.Address;
++ Len : C.int;
++ Flags : C.int;
++ From : System.Address;
++ Fromlen : not null access C.int) return C.int;
++ pragma Import (C, Syscall_Recvfrom, "recvfrom");
++ -- The recvfrom() system call receives a message from a socket and captures
++ -- the address from which the data was sent. It can be used to receive
++ -- data on an unconnected socket as well. If no messages are available,
++ -- the call waits for a message to arrive on blocking sockets. For
++ -- non-blocking sockets without messages, -1 is returned and ERRNO is set
++ -- to EAGAIN or EWOULDBLOCK.
++
++ function Syscall_Recvmsg
++ (S : C.int;
++ Msg : System.Address;
++ Flags : C.int) return System.CRTL.ssize_t;
++ pragma Import (C, Syscall_Recvmsg, "recvmsg");
++ -- The recvmsg call receives a message from a socket, and can be used to
++ -- receive data on an unconnected socket as well. If no messages are
++ -- available, the call waits for a message to arrive on blocking sockets.
++ -- For non-blocking sockets without messages, -1 is returned and ERRNO is
++ -- set to EAGAIN or EWOULDBLOCK.
++
++ function Syscall_Sendmsg
++ (S : C.int;
++ Msg : System.Address;
++ Flags : C.int) return System.CRTL.ssize_t;
++ pragma Import (C, Syscall_Sendmsg, "sendmsg");
++ -- The sendmsg() function sends a message to a socket, and can be used with
++ -- unconnected sockets as well (the msg is ignored in this case). The
++ -- function returns the number of bytes sent when successful, otherwise it
++ -- returns -1 and ERRNO is set (many possible values).
++
++ function Syscall_Sendto
++ (S : C.int;
++ Msg : System.Address;
++ Len : C.int;
++ Flags : C.int;
++ To : System.Address;
++ Tolen : C.int) return C.int;
++ pragma Import (C, Syscall_Sendto, "sendto");
++ -- The sendto() function only works for connected sockets and it initiates
++ -- the transmission of a message. A successful call returns the numbers of
++ -- bytes sent, and a failure returns a -1 and ERRNO is set.
++
++ function Syscall_Socket
++ (Domain : C.int;
++ Typ : C.int;
++ Protocol : C.int) return C.int;
++ pragma Import (C, Syscall_Socket, "__socket30");
++ -- The socket() function is used to create an unbound socket and returns a
++ -- file descriptor that can be used with other socket functions. Upon
++ -- failure, a -1 is returned and ERRNO is set.
++
++ procedure Disable_SIGPIPE (S : C.int);
++ pragma Import (C, Disable_SIGPIPE, "__gnat_disable_sigpipe");
++
++ procedure Disable_All_SIGPIPEs;
++ pragma Import (C, Disable_All_SIGPIPEs, "__gnat_disable_all_sigpipes");
++ -- Sets the process to ignore all SIGPIPE signals on platforms that
++ -- don't support Disable_SIGPIPE for particular streams.
++
++ function C_Fcntl
++ (Fd : C.int;
++ Cmd : C.int;
++ Val : C.int) return C.int;
++ pragma Import (C, C_Fcntl, "fcntl");
++ -- The ioctl of 64-bit DragonFlyBSD, OpenBSD, and NetBSD does not support
++ -- setting a socket in non-blocking mode. fcntl must be used instead.
++
++ --------------
++ -- C_Accept --
++ --------------
++
++ function C_Accept
++ (S : C.int;
++ Addr : System.Address;
++ Addrlen : not null access C.int) return C.int
++ is
++ Res : constant C.int := Syscall_Accept (S, Addr, Addrlen);
++ begin
++
++ Disable_SIGPIPE (Res);
++ return Res;
++
++ end C_Accept;
++
++ ---------------
++ -- C_Connect --
++ ---------------
++
++ function C_Connect
++ (S : C.int;
++ Name : System.Address;
++ Namelen : C.int) return C.int
++ is
++ begin
++
++ return Syscall_Connect (S, Name, Namelen);
++
++ end C_Connect;
++
++ ------------------
++ -- Socket_Ioctl --
++ ------------------
++
++ function Socket_Ioctl
++ (S : C.int;
++ Req : C.int;
++ Arg : access C.int) return C.int
++ is
++ -- Currently all requests are of the FIONBIO type, so always calc flags
++ use Interfaces;
++ flags : constant Unsigned_32 :=
++ Unsigned_32 (C_Fcntl (S, SOSC.F_GETFL, 0));
++ nonblock : constant Unsigned_32 := Unsigned_32 (SOSC.FNDELAY);
++ enabled : constant Boolean := Arg.all = 1;
++ newval : C.int;
++ begin
++ if Req = SOSC.FIONBIO then
++ if enabled then
++ newval := C.int (flags or nonblock);
++ elsif (flags and nonblock) > 0 then
++ newval := C.int (flags - nonblock);
++ else
++ newval := C.int (flags);
++ end if;
++ return C_Fcntl (Fd => S, Cmd => SOSC.F_SETFL, Val => newval);
++ else
++ return C_Ioctl (Fd => S, Req => Req, Arg => Arg);
++ end if;
++ end Socket_Ioctl;
++
++ ------------
++ -- C_Recv --
++ ------------
++
++ function C_Recv
++ (S : C.int;
++ Msg : System.Address;
++ Len : C.int;
++ Flags : C.int) return C.int
++ is
++ begin
++
++ return Syscall_Recv (S, Msg, Len, Flags);
++
++ end C_Recv;
++
++ ----------------
++ -- C_Recvfrom --
++ ----------------
++
++ function C_Recvfrom
++ (S : C.int;
++ Msg : System.Address;
++ Len : C.int;
++ Flags : C.int;
++ From : System.Address;
++ Fromlen : not null access C.int) return C.int
++ is
++ begin
++
++ return Syscall_Recvfrom (S, Msg, Len, Flags, From, Fromlen);
++
++ end C_Recvfrom;
++
++ ---------------
++ -- C_Recvmsg --
++ ---------------
++
++ function C_Recvmsg
++ (S : C.int;
++ Msg : System.Address;
++ Flags : C.int) return System.CRTL.ssize_t
++ is
++ begin
++
++ return Syscall_Recvmsg (S, Msg, Flags);
++
++ end C_Recvmsg;
++
++ ---------------
++ -- C_Sendmsg --
++ ---------------
++
++ function C_Sendmsg
++ (S : C.int;
++ Msg : System.Address;
++ Flags : C.int) return System.CRTL.ssize_t
++ is
++ begin
++
++ return Syscall_Sendmsg (S, Msg, Flags);
++
++ end C_Sendmsg;
++
++ --------------
++ -- C_Sendto --
++ --------------
++
++ function C_Sendto
++ (S : C.int;
++ Msg : System.Address;
++ Len : C.int;
++ Flags : C.int;
++ To : System.Address;
++ Tolen : C.int) return C.int
++ is
++ begin
++
++ return Syscall_Sendto (S, Msg, Len, Flags, To, Tolen);
++
++ end C_Sendto;
++
++ --------------
++ -- C_Socket --
++ --------------
++
++ function C_Socket
++ (Domain : C.int;
++ Typ : C.int;
++ Protocol : C.int) return C.int
++ is
++ Res : constant C.int := Syscall_Socket (Domain, Typ, Protocol);
++ begin
++
++ Disable_SIGPIPE (Res);
++ return Res;
++
++ end C_Socket;
++
++ --------------
++ -- Finalize --
++ --------------
++
++ procedure Finalize is
++ begin
++ null;
++ end Finalize;
++
++ -------------------------
++ -- Host_Error_Messages --
++ -------------------------
++
++ package body Host_Error_Messages is separate;
++
++ ----------------
++ -- Initialize --
++ ----------------
++
++ procedure Initialize is
++ begin
++ Disable_All_SIGPIPEs;
++ end Initialize;
++
++ --------------------
++ -- Signalling_Fds --
++ --------------------
++
++ package body Signalling_Fds is
++
++ -- In this default implementation, we use a C version of these
++ -- subprograms provided by socket.c.
++
++ function C_Create (Fds : not null access Fd_Pair) return C.int;
++ function C_Read (Rsig : C.int) return C.int;
++ function C_Write (Wsig : C.int) return C.int;
++ procedure C_Close (Sig : C.int);
++
++ pragma Import (C, C_Create, "__gnat_create_signalling_fds");
++ pragma Import (C, C_Read, "__gnat_read_signalling_fd");
++ pragma Import (C, C_Write, "__gnat_write_signalling_fd");
++ pragma Import (C, C_Close, "__gnat_close_signalling_fd");
++
++ function Create
++ (Fds : not null access Fd_Pair) return C.int renames C_Create;
++ function Read (Rsig : C.int) return C.int renames C_Read;
++ function Write (Wsig : C.int) return C.int renames C_Write;
++ procedure Close (Sig : C.int) renames C_Close;
++
++ end Signalling_Fds;
++
++ --------------------------
++ -- Socket_Error_Message --
++ --------------------------
++
++ function Socket_Error_Message
++ (Errno : Integer) return C.Strings.chars_ptr
++ is separate;
++
++end GNAT.Sockets.Thin;
+--- /dev/null
++++ gcc/ada/g-socthi-netbsd6.ads
+@@ -0,0 +1,263 @@
++------------------------------------------------------------------------------
++-- --
++-- GNAT COMPILER COMPONENTS --
++-- --
++-- G N A T . S O C K E T S . T H I N --
++-- --
++-- S p e c --
++-- --
++-- Copyright (C) 2001-2009, AdaCore --
++-- --
++-- GNAT is free software; you can redistribute it and/or modify it under --
++-- terms of the GNU General Public License as published by the Free Soft- --
++-- ware Foundation; either version 2, or (at your option) any later ver- --
++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
++-- OUT 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 distributed with GNAT; see file COPYING. If not, write --
++-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
++-- Boston, MA 02110-1301, USA. --
++-- --
++-- As a special exception, if other files instantiate generics from this --
++-- unit, or you link this unit with other files to produce an executable, --
++-- this unit does not by itself cause the resulting executable to be --
++-- covered by the GNU General Public License. This exception does not --
++-- however invalidate any other reasons why the executable file might be --
++-- covered by the GNU Public License. --
++-- --
++-- GNAT was originally developed by the GNAT team at New York University. --
++-- Extensive contributions were provided by Ada Core Technologies Inc. --
++-- --
++-- Copyright (C) 2011 John Marino <www.dragonlace.net> --
++------------------------------------------------------------------------------
++
++-- This package provides a target dependent thin interface to the sockets
++-- layer for use by the GNAT.Sockets package (g-socket.ads). This package
++-- should not be directly with'ed by an applications program.
++
++-- This is the NetBSD 6+ version
++
++with Interfaces.C.Strings;
++
++with GNAT.OS_Lib;
++with GNAT.Sockets.Thin_Common;
++
++with System;
++with System.CRTL;
++
++package GNAT.Sockets.Thin is
++
++ -- This package is intended for hosts implementing BSD sockets with a
++ -- standard interface. It will be used as a default for all the platforms
++ -- that do not have a specific version of this file.
++
++ use Thin_Common;
++
++ package C renames Interfaces.C;
++
++ use type System.CRTL.ssize_t;
++
++ function Socket_Errno return Integer renames GNAT.OS_Lib.Errno;
++ -- Returns last socket error number
++
++ function Socket_Error_Message (Errno : Integer) return C.Strings.chars_ptr;
++ -- Returns the error message string for the error number Errno. If Errno is
++ -- not known, returns "Unknown system error".
++
++ function Host_Errno return Integer;
++ pragma Import (C, Host_Errno, "__gnat_get_h_errno");
++ -- Returns last host error number
++
++ package Host_Error_Messages is
++
++ function Host_Error_Message
++ (H_Errno : Integer) return C.Strings.chars_ptr;
++ -- Returns the error message string for the host error number H_Errno.
++ -- If H_Errno is not known, returns "Unknown system error".
++
++ end Host_Error_Messages;
++
++ --------------------------------
++ -- Standard library functions --
++ --------------------------------
++
++ function C_Accept
++ (S : C.int;
++ Addr : System.Address;
++ Addrlen : not null access C.int) return C.int;
++
++ function C_Bind
++ (S : C.int;
++ Name : System.Address;
++ Namelen : C.int) return C.int;
++
++ function C_Close
++ (Fd : C.int) return C.int;
++
++ function C_Connect
++ (S : C.int;
++ Name : System.Address;
++ Namelen : C.int) return C.int;
++
++ function C_Gethostname
++ (Name : System.Address;
++ Namelen : C.int) return C.int;
++
++ function C_Getpeername
++ (S : C.int;
++ Name : System.Address;
++ Namelen : not null access C.int) return C.int;
++
++ function C_Getsockname
++ (S : C.int;
++ Name : System.Address;
++ Namelen : not null access C.int) return C.int;
++
++ function C_Getsockopt
++ (S : C.int;
++ Level : C.int;
++ Optname : C.int;
++ Optval : System.Address;
++ Optlen : not null access C.int) return C.int;
++
++ function Socket_Ioctl
++ (S : C.int;
++ Req : C.int;
++ Arg : access C.int) return C.int;
++
++ function C_Listen
++ (S : C.int;
++ Backlog : C.int) return C.int;
++
++ function C_Recv
++ (S : C.int;
++ Msg : System.Address;
++ Len : C.int;
++ Flags : C.int) return C.int;
++
++ function C_Recvfrom
++ (S : C.int;
++ Msg : System.Address;
++ Len : C.int;
++ Flags : C.int;
++ From : System.Address;
++ Fromlen : not null access C.int) return C.int;
++
++ function C_Recvmsg
++ (S : C.int;
++ Msg : System.Address;
++ Flags : C.int) return System.CRTL.ssize_t;
++
++ function C_Select
++ (Nfds : C.int;
++ Readfds : access Fd_Set;
++ Writefds : access Fd_Set;
++ Exceptfds : access Fd_Set;
++ Timeout : Timeval_Access) return C.int;
++
++ function C_Sendmsg
++ (S : C.int;
++ Msg : System.Address;
++ Flags : C.int) return System.CRTL.ssize_t;
++
++ function C_Sendto
++ (S : C.int;
++ Msg : System.Address;
++ Len : C.int;
++ Flags : C.int;
++ To : System.Address;
++ Tolen : C.int) return C.int;
++
++ function C_Setsockopt
++ (S : C.int;
++ Level : C.int;
++ Optname : C.int;
++ Optval : System.Address;
++ Optlen : C.int) return C.int;
++
++ function C_Shutdown
++ (S : C.int;
++ How : C.int) return C.int;
++
++ function C_Socket
++ (Domain : C.int;
++ Typ : C.int;
++ Protocol : C.int) return C.int;
++
++ function C_System
++ (Command : System.Address) return C.int;
++
++ -------------------------------------------------------
++ -- Signalling file descriptors for selector abortion --
++ -------------------------------------------------------
++
++ package Signalling_Fds is
++
++ function Create (Fds : not null access Fd_Pair) return C.int;
++ pragma Convention (C, Create);
++ -- Create a pair of connected descriptors suitable for use with C_Select
++ -- (used for signalling in Selector objects).
++
++ function Read (Rsig : C.int) return C.int;
++ pragma Convention (C, Read);
++ -- Read one byte of data from rsig, the read end of a pair of signalling
++ -- fds created by Create_Signalling_Fds.
++
++ function Write (Wsig : C.int) return C.int;
++ pragma Convention (C, Write);
++ -- Write one byte of data to wsig, the write end of a pair of signalling
++ -- fds created by Create_Signalling_Fds.
++
++ procedure Close (Sig : C.int);
++ pragma Convention (C, Close);
++ -- Close one end of a pair of signalling fds (ignoring any error)
++
++ end Signalling_Fds;
++
++ -------------------------------------------
++ -- Nonreentrant network databases access --
++ -------------------------------------------
++
++ -- The following are used only on systems that have nonreentrant
++ -- getXXXbyYYY functions, and do NOT have corresponding getXXXbyYYY_
++ -- functions. Currently, LynxOS is the only such system.
++
++ function Nonreentrant_Gethostbyname
++ (Name : C.char_array) return Hostent_Access;
++
++ function Nonreentrant_Gethostbyaddr
++ (Addr : System.Address;
++ Addr_Len : C.int;
++ Addr_Type : C.int) return Hostent_Access;
++
++ function Nonreentrant_Getservbyname
++ (Name : C.char_array;
++ Proto : C.char_array) return Servent_Access;
++
++ function Nonreentrant_Getservbyport
++ (Port : C.int;
++ Proto : C.char_array) return Servent_Access;
++
++ procedure Initialize;
++ procedure Finalize;
++
++private
++ pragma Import (C, C_Bind, "bind");
++ pragma Import (C, C_Close, "close");
++ pragma Import (C, C_Gethostname, "gethostname");
++ pragma Import (C, C_Getpeername, "getpeername");
++ pragma Import (C, C_Getsockname, "getsockname");
++ pragma Import (C, C_Getsockopt, "getsockopt");
++ pragma Import (C, C_Listen, "listen");
++ pragma Import (C, C_Select, "__select50");
++ pragma Import (C, C_Setsockopt, "setsockopt");
++ pragma Import (C, C_Shutdown, "shutdown");
++ pragma Import (C, C_System, "system");
++
++ pragma Import (C, Nonreentrant_Gethostbyname, "gethostbyname");
++ pragma Import (C, Nonreentrant_Gethostbyaddr, "gethostbyaddr");
++ pragma Import (C, Nonreentrant_Getservbyname, "getservbyname");
++ pragma Import (C, Nonreentrant_Getservbyport, "getservbyport");
++
++end GNAT.Sockets.Thin;
+--- /dev/null
++++ gcc/ada/g-trasym-bsd.adb
+@@ -0,0 +1,150 @@
++------------------------------------------------------------------------------
++-- --
++-- GNAT RUN-TIME COMPONENTS --
++-- --
++-- G N A T . T R A C E B A C K . S Y M B O L I C --
++-- --
++-- B o d y --
++-- --
++-- Copyright (C) 1999-2009, AdaCore --
++-- --
++-- GNAT is free software; you can redistribute it and/or modify it under --
++-- terms of the GNU General Public License as published by the Free Soft- --
++-- ware Foundation; either version 2, or (at your option) any later ver- --
++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
++-- OUT 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 distributed with GNAT; see file COPYING. If not, write --
++-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
++-- Boston, MA 02110-1301, USA. --
++-- --
++-- As a special exception, if other files instantiate generics from this --
++-- unit, or you link this unit with other files to produce an executable, --
++-- this unit does not by itself cause the resulting executable to be --
++-- covered by the GNU General Public License. This exception does not --
++-- however invalidate any other reasons why the executable file might be --
++-- covered by the GNU Public License. --
++-- --
++-- GNAT was originally developed by the GNAT team at New York University. --
++-- Extensive contributions were provided by Ada Core Technologies Inc. --
++-- --
++------------------------------------------------------------------------------
++
++-- Run-time symbolic traceback support
++-- This file is based on the work by Juergen Pfiefer which is still used
++-- today to provide symbolic traceback support for gnu/kFreeBSD.
++-- Incorporated in GNAT-AUX by John Marino <http://www.dragonlace.net>
++
++with System.Soft_Links;
++with Ada.Exceptions.Traceback; use Ada.Exceptions.Traceback;
++
++package body GNAT.Traceback.Symbolic is
++
++ package TSL renames System.Soft_Links;
++
++ -- To perform the raw addresses to symbolic form translation we rely on a
++ -- libaddr2line symbolizer which examines debug info from a provided
++ -- executable file name, and an absolute path is needed to ensure the file
++ -- is always found. This is "__gnat_locate_exec_on_path (gnat_argv [0])"
++ -- for our executable file, a fairly heavy operation so we cache the
++ -- result.
++
++ Exename : System.Address;
++ -- Pointer to the name of the executable file to be used on all
++ -- invocations of the libaddr2line symbolization service.
++
++ Exename_Resolved : Boolean := False;
++ -- Flag to indicate whether we have performed the executable file name
++ -- resolution already. Relying on a not null Exename for this purpose
++ -- would be potentially inefficient as this is what we will get if the
++ -- resolution attempt fails.
++
++ ------------------------
++ -- Symbolic_Traceback --
++ ------------------------
++
++ function Symbolic_Traceback (Traceback : Tracebacks_Array) return String is
++
++ procedure convert_addresses
++ (filename : System.Address;
++ addrs : System.Address;
++ n_addrs : Integer;
++ buf : System.Address;
++ len : System.Address);
++ pragma Import (C, convert_addresses, "convert_addresses");
++ -- This is the procedure version of the Ada-aware addr2line. It places
++ -- in BUF a string representing the symbolic translation of the N_ADDRS
++ -- raw addresses provided in ADDRS, looked up in debug information from
++ -- FILENAME. LEN points to an integer which contains the size of the
++ -- BUF buffer at input and the result length at output.
++ --
++ -- Note that this procedure is *not* thread-safe.
++
++ type Argv_Array is array (0 .. 0) of System.Address;
++ gnat_argv : access Argv_Array;
++ pragma Import (C, gnat_argv, "gnat_argv");
++
++ function locate_exec_on_path
++ (c_exename : System.Address) return System.Address;
++ pragma Import (C, locate_exec_on_path, "__gnat_locate_exec_on_path");
++
++ B_Size : constant Integer := 256 * Traceback'Length;
++ Len : Integer := B_Size;
++ Res : String (1 .. B_Size);
++
++ use type System.Address;
++
++ begin
++ -- The symbolic translation of an empty set of addresses is an empty
++ -- string.
++
++ if Traceback'Length = 0 then
++ return "";
++ end if;
++
++ -- If our input set of raw addresses is not empty, resort to the
++ -- libaddr2line service to symbolize it all.
++
++ -- Compute, cache and provide the absolute path to our executable file
++ -- name as the binary file where the relevant debug information is to be
++ -- found. If the executable file name resolution fails, we have no
++ -- sensible basis to invoke the symbolizer at all.
++
++ -- Protect all this against concurrent accesses explicitly, as the
++ -- underlying services are potentially thread unsafe.
++
++ TSL.Lock_Task.all;
++
++ if not Exename_Resolved then
++ Exename := locate_exec_on_path (gnat_argv (0));
++ Exename_Resolved := True;
++ end if;
++
++ if Exename /= System.Null_Address then
++ Len := Res'Length;
++ convert_addresses
++ (Exename, Traceback'Address, Traceback'Length,
++ Res (1)'Address, Len'Address);
++ end if;
++
++ TSL.Unlock_Task.all;
++
++ -- Return what the addr2line symbolizer has produced if we have called
++ -- it (the executable name resolution succeeded), or an empty string
++ -- otherwise.
++
++ if Exename /= System.Null_Address then
++ return Res (1 .. Len);
++ else
++ return "";
++ end if;
++
++ end Symbolic_Traceback;
++
++ function Symbolic_Traceback (E : Exception_Occurrence) return String is
++ begin
++ return Symbolic_Traceback (Tracebacks (E));
++ end Symbolic_Traceback;
++
++end GNAT.Traceback.Symbolic;
+--- gcc/ada/gnatchop.adb.orig
++++ gcc/ada/gnatchop.adb
+@@ -21,6 +21,7 @@
+ -- GNAT was originally developed by the GNAT team at New York University. --
+ -- Extensive contributions were provided by Ada Core Technologies Inc. --
+ -- --
++-- Copyright (C) 2010 John Marino <draco@marino.st> --
+ ------------------------------------------------------------------------------
+
+ with Ada.Characters.Conversions; use Ada.Characters.Conversions;
+@@ -45,7 +46,7 @@
+ Config_File_Name : constant String_Access := new String'("gnat.adc");
+ -- The name of the file holding the GNAT configuration pragmas
+
+- Gcc : String_Access := new String'("gcc");
++ Gcc : String_Access := new String'("gnatgcc");
+ -- May be modified by switch --GCC=
+
+ Gcc_Set : Boolean := False;
+--- gcc/ada/gnatlink.adb.orig
++++ gcc/ada/gnatlink.adb
+@@ -21,6 +21,7 @@
+ -- GNAT was originally developed by the GNAT team at New York University. --
+ -- Extensive contributions were provided by Ada Core Technologies Inc. --
+ -- --
++-- Copyright (C) 2010 John Marino <draco@marino.st> --
+ ------------------------------------------------------------------------------
+
+ -- Gnatlink usage: please consult the gnat documentation
+@@ -137,7 +138,7 @@
+ -- This table collects the arguments to be passed to compile the binder
+ -- generated file.
+
+- Gcc : String_Access := Program_Name ("gcc", "gnatlink");
++ Gcc : String_Access := Program_Name ("gnatgcc", "gnatlink");
+
+ Read_Mode : constant String := "r" & ASCII.NUL;
+
+--- gcc/ada/gnatvsn.ads.orig
++++ gcc/ada/gnatvsn.ads
+@@ -27,6 +27,7 @@
+ -- GNAT was originally developed by the GNAT team at New York University. --
+ -- Extensive contributions were provided by Ada Core Technologies Inc. --
+ -- --
++-- Copyright (C) 2010 John Marino <draco@marino.st> --
+ ------------------------------------------------------------------------------
+
+ -- This package spec holds version information for the GNAT tools.
+@@ -34,7 +35,7 @@
+
+ package Gnatvsn is
+
+- Gnat_Static_Version_String : constant String := "GNU Ada";
++ Gnat_Static_Version_String : constant String := "GNAT AUX";
+ -- Static string identifying this version, that can be used as an argument
+ -- to e.g. pragma Ident.
+
+--- gcc/ada/gsocket.h.orig
++++ gcc/ada/gsocket.h
+@@ -27,6 +27,7 @@
+ * GNAT was originally developed by the GNAT team at New York University. *
+ * Extensive contributions were provided by Ada Core Technologies Inc. *
+ * *
++ * Copyright (C) 2010 John Marino <draco@marino.st> *
+ ****************************************************************************/
+
+ #if defined(__nucleus__) || defined(VTHREADS)
+@@ -194,7 +195,14 @@
+ #include <netdb.h>
+ #endif
+
++#if defined(__ANDROID__)
++#include <sys/select.h>
++#endif
++
+ #if defined (_AIX) || defined (__FreeBSD__) || defined (__hpux__) || \
++ defined (__OpenBSD__) || \
++ defined (__NetBSD__) || \
++ defined (__DragonFly__) || \
+ defined (__osf__) || defined (_WIN32) || defined (__APPLE__)
+ # define HAVE_THREAD_SAFE_GETxxxBYyyy 1
+
+@@ -227,7 +235,13 @@
+ # endif
+ #endif
+
+-#if defined (__FreeBSD__) || defined (__vxworks) || defined(__rtems__)
++#if defined (__FreeBSD__) \
++ || defined (__DragonFly__) \
++ || defined (__OpenBSD__) \
++ || defined (__NetBSD__) \
++ || defined (__ANDROID__) \
++ || defined (__vxworks) \
++ || defined(__rtems__)
+ # define Has_Sockaddr_Len 1
+ #else
+ # define Has_Sockaddr_Len 0
+--- gcc/ada/init.c.orig
++++ gcc/ada/init.c
+@@ -27,6 +27,7 @@
+ * GNAT was originally developed by the GNAT team at New York University. *
+ * Extensive contributions were provided by Ada Core Technologies Inc. *
+ * *
++ * Copyright (C) 2010, 2011 John Marino <www.dragonlace.net> *
+ ****************************************************************************/
+
+ /* This unit contains initialization circuits that are system dependent.
+@@ -519,7 +520,7 @@
+ /* GNU/Linux Section */
+ /*********************/
+
+-#elif defined (linux)
++#elif defined (linux) && !defined(__ANDROID__)
+
+ #include <signal.h>
+
+@@ -1724,7 +1725,7 @@
+ /* FreeBSD Section */
+ /*******************/
+
+-#elif defined (__FreeBSD__)
++#elif defined (__FreeBSD__) || defined (__DragonFly__)
+
+ #include <signal.h>
+ #include <sys/ucontext.h>
+@@ -1769,7 +1770,7 @@
+ }
+
+ void
+-__gnat_install_handler ()
++__gnat_install_handler (void)
+ {
+ struct sigaction act;
+
+@@ -1791,6 +1792,77 @@
+ }
+
+ /*******************/
++/* Android Section */
++/*******************/
++
++#elif defined(__ANDROID__)
++
++#include <signal.h>
++
++static void
++__gnat_error_handler (int sig,
++ struct siginfo *si ATTRIBUTE_UNUSED,
++ void *ucontext ATTRIBUTE_UNUSED)
++{
++ struct Exception_Data *exception;
++ const char *msg;
++
++ switch (sig)
++ {
++ case SIGFPE:
++ exception = &constraint_error;
++ msg = "SIGFPE";
++ break;
++
++ case SIGILL:
++ exception = &constraint_error;
++ msg = "SIGILL";
++ break;
++
++ case SIGSEGV:
++ exception = &storage_error;
++ msg = "stack overflow or erroneous memory access";
++ break;
++
++ case SIGBUS:
++ exception = &constraint_error;
++ msg = "SIGBUS";
++ break;
++
++ default:
++ exception = &program_error;
++ msg = "unhandled signal";
++ }
++
++ Raise_From_Signal_Handler (exception, msg);
++}
++
++void
++__gnat_install_handler (void)
++{
++ struct sigaction act;
++
++ act.sa_sigaction = __gnat_error_handler;
++ act.sa_flags = SA_NODEFER | SA_RESTART | SA_SIGINFO;
++ sigemptyset (&act.sa_mask);
++
++ /* Do not install handlers if interrupt state is "System". */
++ if (__gnat_get_interrupt_state (SIGABRT) != 's')
++ sigaction (SIGABRT, &act, NULL);
++ if (__gnat_get_interrupt_state (SIGFPE) != 's')
++ sigaction (SIGFPE, &act, NULL);
++ if (__gnat_get_interrupt_state (SIGILL) != 's')
++ sigaction (SIGILL, &act, NULL);
++ if (__gnat_get_interrupt_state (SIGBUS) != 's')
++ sigaction (SIGBUS, &act, NULL);
++ if (__gnat_get_interrupt_state (SIGSEGV) != 's')
++ sigaction (SIGSEGV, &act, NULL);
++
++ __gnat_handler_installed = 1;
++}
++
++
++/*******************/
+ /* VxWorks Section */
+ /*******************/
+
+@@ -2320,6 +2392,7 @@
+
+ #if defined (_WIN32) || defined (__INTERIX) \
+ || defined (__Lynx__) || defined(__NetBSD__) || defined(__FreeBSD__) \
++ || defined (__DragonFly__) \
+ || defined (__OpenBSD__)
+
+ #define HAVE_GNAT_INIT_FLOAT
+--- gcc/ada/initialize.c.orig
++++ gcc/ada/initialize.c
+@@ -27,6 +27,7 @@
+ * GNAT was originally developed by the GNAT team at New York University. *
+ * Extensive contributions were provided by Ada Core Technologies Inc. *
+ * *
++ * Copyright (C) 2010 John Marino <draco@marino.st> *
+ ****************************************************************************/
+
+ /* This unit provides default implementation for __gnat_initialize ()
+@@ -255,6 +256,7 @@
+ /******************************************/
+
+ #elif defined (__Lynx__) || defined (__FreeBSD__) || defined(__NetBSD__) \
++ || defined (__DragonFly__) \
+ || defined (__OpenBSD__)
+
+ extern void __gnat_init_float (void);
+--- gcc/ada/link.c.orig
++++ gcc/ada/link.c
+@@ -27,6 +27,7 @@
+ * GNAT was originally developed by the GNAT team at New York University. *
+ * Extensive contributions were provided by Ada Core Technologies Inc. *
+ * *
++ * Copyright (C) 2010, 2011 John Marino <www.dragonlace.net> *
+ ****************************************************************************/
+
+ /* This file contains host-specific parameters describing the behavior */
+@@ -187,7 +188,10 @@
+ const char *__gnat_default_libgcc_subdir = "lib";
+ #endif
+
+-#elif defined (__FreeBSD__)
++#elif defined (__FreeBSD__) \
++ || defined (__OpenBSD__) \
++ || defined (__NetBSD__) \
++ || defined (__DragonFly__)
+ const char *__gnat_object_file_option = "";
+ const char *__gnat_run_path_option = "-Wl,-rpath,";
+ char __gnat_shared_libgnat_default = STATIC;
+--- gcc/ada/make.adb.orig
++++ gcc/ada/make.adb
+@@ -21,6 +21,7 @@
+ -- GNAT was originally developed by the GNAT team at New York University. --
+ -- Extensive contributions were provided by Ada Core Technologies Inc. --
+ -- --
++-- Copyright (C) 2010 John Marino <draco@marino.st> --
+ ------------------------------------------------------------------------------
+
+ with ALI; use ALI;
+@@ -652,7 +653,7 @@
+ -- Compiler, Binder & Linker Data and Subprograms --
+ ----------------------------------------------------
+
+- Gcc : String_Access := Program_Name ("gcc", "gnatmake");
++ Gcc : String_Access := Program_Name ("gnatgcc", "gnatmake");
+ Gnatbind : String_Access := Program_Name ("gnatbind", "gnatmake");
+ Gnatlink : String_Access := Program_Name ("gnatlink", "gnatmake");
+ -- Default compiler, binder, linker programs
+--- gcc/ada/mlib-prj.adb.orig
++++ gcc/ada/mlib-prj.adb
+@@ -341,6 +341,11 @@
+
+ Foreign_Sources : Boolean;
+
++ Rpath_Disabled : Boolean := False;
++ -- If -R is passed through the library options for the linker, it will
++ -- prevent the implemented libraries portion of the rpath switch from
++ -- being built, even if the linker is capable of supporting rpath.
++
+ Rpath : String_Access := null;
+ -- Allocated only if Path Option is supported
+
+@@ -790,7 +795,7 @@
+ Opts.Table (Opts.Last) :=
+ new String'("-L" & Name_Buffer (1 .. Name_Len));
+
+- if Path_Option /= null then
++ if not Rpath_Disabled and then Path_Option /= null then
+ Add_Rpath (Name_Buffer (1 .. Name_Len));
+ end if;
+
+@@ -1285,6 +1290,9 @@
+ Opts.Increment_Last;
+ Opts.Table (Opts.Last) :=
+ new String'(Name_Buffer (1 .. Name_Len));
++ if Name_Len = 2 and then Name_Buffer (1 .. 2) = "-R" then
++ Rpath_Disabled := True;
++ end if;
+ end if;
+
+ Current := Element.Next;
+--- gcc/ada/mlib-utl.adb.orig
++++ gcc/ada/mlib-utl.adb
+@@ -21,6 +21,7 @@
+ -- GNAT was originally developed by the GNAT team at New York University. --
+ -- Extensive contributions were provided by Ada Core Technologies Inc. --
+ -- --
++-- Copyright (C) 2010 John Marino <draco@marino.st> --
+ ------------------------------------------------------------------------------
+
+ with MLib.Fil; use MLib.Fil;
+@@ -412,7 +413,7 @@
+ if Driver_Name = No_Name then
+ if Gcc_Exec = null then
+ if Gcc_Name = null then
+- Gcc_Name := Osint.Program_Name ("gcc", "gnatmake");
++ Gcc_Name := Osint.Program_Name ("gnatgcc", "gnatmake");
+ end if;
+
+ Gcc_Exec := Locate_Exec_On_Path (Gcc_Name.all);
+--- gcc/ada/prj-makr.adb.orig
++++ gcc/ada/prj-makr.adb
+@@ -21,6 +21,7 @@
+ -- GNAT was originally developed by the GNAT team at New York University. --
+ -- Extensive contributions were provided by Ada Core Technologies Inc. --
+ -- --
++-- Copyright (C) 2010 John Marino <draco@marino.st> --
+ ------------------------------------------------------------------------------
+
+ with Csets;
+@@ -110,7 +111,7 @@
+
+ procedure Dup2 (Old_Fd, New_Fd : File_Descriptor);
+
+- Gcc : constant String := "gcc";
++ Gcc : constant String := "gnatgcc";
+ Gcc_Path : String_Access := null;
+
+ Non_Empty_Node : constant Project_Node_Id := 1;
+--- gcc/ada/s-fileio.adb.orig
++++ gcc/ada/s-fileio.adb
+@@ -231,7 +231,7 @@
+ Close_Status : int := 0;
+ Dup_Strm : Boolean := False;
+ File : AFCB_Ptr renames File_Ptr.all;
+- Errno : Integer;
++ Errno : Integer := 0;
+
+ begin
+ -- Take a task lock, to protect the global data value Open_Files
+--- /dev/null
++++ gcc/ada/s-osinte-android.ads
+@@ -0,0 +1,566 @@
++------------------------------------------------------------------------------
++-- --
++-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
++-- --
++-- S Y S T E M . O S _ I N T E R F A C E --
++-- --
++-- S p e c --
++-- --
++-- Copyright (C) 1991-1994, Florida State University --
++-- Copyright (C) 1995-2010, Free Software Foundation, Inc. --
++-- --
++-- GNARL is free software; you can redistribute it and/or modify it under --
++-- terms of the GNU General Public License as published by the Free Soft- --
++-- ware Foundation; either version 2, or (at your option) any later ver- --
++-- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
++-- OUT 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 distributed with GNARL; see file COPYING. If not, write --
++-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
++-- Boston, MA 02110-1301, USA. --
++-- --
++-- As a special exception, if other files instantiate generics from this --
++-- unit, or you link this unit with other files to produce an executable, --
++-- this unit does not by itself cause the resulting executable to be --
++-- covered by the GNU General Public License. This exception does not --
++-- however invalidate any other reasons why the executable file might be --
++-- covered by the GNU Public License. --
++-- --
++-- GNARL was developed by the GNARL team at Florida State University. --
++-- Extensive contributions were provided by Ada Core Technologies, Inc. --
++-- --
++------------------------------------------------------------------------------
++
++-- This is a GNU/Linux (GNU/LinuxThreads) version of this package
++
++-- This package encapsulates all direct interfaces to OS services
++-- that are needed by the tasking run-time (libgnarl).
++
++-- PLEASE DO NOT add any with-clauses to this package or remove the pragma
++-- Preelaborate. This package is designed to be a bottom-level (leaf) package.
++
++with Ada.Unchecked_Conversion;
++with Interfaces.C;
++with System.Linux;
++
++package System.OS_Interface is
++ pragma Preelaborate;
++
++ subtype int is Interfaces.C.int;
++ subtype char is Interfaces.C.char;
++ subtype short is Interfaces.C.short;
++ subtype long is Interfaces.C.long;
++ subtype unsigned is Interfaces.C.unsigned;
++ subtype unsigned_short is Interfaces.C.unsigned_short;
++ subtype unsigned_long is Interfaces.C.unsigned_long;
++ subtype unsigned_char is Interfaces.C.unsigned_char;
++ subtype plain_char is Interfaces.C.plain_char;
++ subtype size_t is Interfaces.C.size_t;
++
++ -----------
++ -- Errno --
++ -----------
++
++ function errno return int;
++ pragma Import (C, errno, "__get_errno");
++
++ EAGAIN : constant := System.Linux.EAGAIN;
++ EINTR : constant := System.Linux.EINTR;
++ EINVAL : constant := System.Linux.EINVAL;
++ ENOMEM : constant := System.Linux.ENOMEM;
++ EPERM : constant := System.Linux.EPERM;
++ ETIMEDOUT : constant := System.Linux.ETIMEDOUT;
++
++ -------------
++ -- Signals --
++ -------------
++
++ Max_Interrupt : constant := 63;
++ type Signal is new int range 0 .. Max_Interrupt;
++ for Signal'Size use int'Size;
++
++ SIGHUP : constant := System.Linux.SIGHUP;
++ SIGINT : constant := System.Linux.SIGINT;
++ SIGQUIT : constant := System.Linux.SIGQUIT;
++ SIGILL : constant := System.Linux.SIGILL;
++ SIGTRAP : constant := System.Linux.SIGTRAP;
++ SIGIOT : constant := System.Linux.SIGIOT;
++ SIGABRT : constant := System.Linux.SIGABRT;
++ SIGFPE : constant := System.Linux.SIGFPE;
++ SIGKILL : constant := System.Linux.SIGKILL;
++ SIGBUS : constant := System.Linux.SIGBUS;
++ SIGSEGV : constant := System.Linux.SIGSEGV;
++ SIGPIPE : constant := System.Linux.SIGPIPE;
++ SIGALRM : constant := System.Linux.SIGALRM;
++ SIGTERM : constant := System.Linux.SIGTERM;
++ SIGUSR1 : constant := System.Linux.SIGUSR1;
++ SIGUSR2 : constant := System.Linux.SIGUSR2;
++ SIGCLD : constant := System.Linux.SIGCLD;
++ SIGCHLD : constant := System.Linux.SIGCHLD;
++ SIGPWR : constant := System.Linux.SIGPWR;
++ SIGWINCH : constant := System.Linux.SIGWINCH;
++ SIGURG : constant := System.Linux.SIGURG;
++ SIGPOLL : constant := System.Linux.SIGPOLL;
++ SIGIO : constant := System.Linux.SIGIO;
++ SIGLOST : constant := System.Linux.SIGLOST;
++ SIGSTOP : constant := System.Linux.SIGSTOP;
++ SIGTSTP : constant := System.Linux.SIGTSTP;
++ SIGCONT : constant := System.Linux.SIGCONT;
++ SIGTTIN : constant := System.Linux.SIGTTIN;
++ SIGTTOU : constant := System.Linux.SIGTTOU;
++ SIGVTALRM : constant := System.Linux.SIGVTALRM;
++ SIGPROF : constant := System.Linux.SIGPROF;
++ SIGXCPU : constant := System.Linux.SIGXCPU;
++ SIGXFSZ : constant := System.Linux.SIGXFSZ;
++ SIGUNUSED : constant := System.Linux.SIGUNUSED;
++ SIGSTKFLT : constant := System.Linux.SIGSTKFLT;
++ SIGLTHRRES : constant := System.Linux.SIGLTHRRES;
++ SIGLTHRCAN : constant := System.Linux.SIGLTHRCAN;
++ SIGLTHRDBG : constant := System.Linux.SIGLTHRDBG;
++
++ SIGADAABORT : constant := SIGABRT;
++ -- Change this if you want to use another signal for task abort.
++ -- SIGTERM might be a good one.
++
++ type Signal_Set is array (Natural range <>) of Signal;
++
++ Unmasked : constant Signal_Set := (
++ SIGTRAP,
++ -- To enable debugging on multithreaded applications, mark SIGTRAP to
++ -- be kept unmasked.
++
++ SIGBUS,
++
++ SIGTTIN, SIGTTOU, SIGTSTP,
++ -- Keep these three signals unmasked so that background processes
++ -- and IO behaves as normal "C" applications
++
++ SIGPROF,
++ -- To avoid confusing the profiler
++
++ SIGKILL, SIGSTOP,
++ -- These two signals actually cannot be masked;
++ -- POSIX simply won't allow it.
++
++ SIGLTHRRES, SIGLTHRCAN, SIGLTHRDBG);
++ -- These three signals are used by GNU/LinuxThreads starting from
++ -- glibc 2.1 (future 2.2).
++
++ Reserved : constant Signal_Set :=
++ -- I am not sure why the following two signals are reserved.
++ -- I guess they are not supported by this version of GNU/Linux.
++ (SIGVTALRM, SIGUNUSED);
++
++ type sigset_t is private;
++
++ function sigaddset (set : access sigset_t; sig : Signal) return int;
++ pragma Import (C, sigaddset, "sigaddset");
++
++ function sigdelset (set : access sigset_t; sig : Signal) return int;
++ pragma Import (C, sigdelset, "sigdelset");
++
++ function sigfillset (set : access sigset_t) return int;
++ pragma Import (C, sigfillset, "sigfillset");
++
++ function sigismember (set : access sigset_t; sig : Signal) return int;
++ pragma Import (C, sigismember, "sigismember");
++
++ function sigemptyset (set : access sigset_t) return int;
++ pragma Import (C, sigemptyset, "sigemptyset");
++
++ type union_type_3 is new String (1 .. 116);
++ type siginfo_t is record
++ si_signo : int;
++ si_code : int;
++ si_errno : int;
++ X_data : union_type_3;
++ end record;
++ pragma Convention (C, siginfo_t);
++
++ type struct_sigaction is record
++ sa_handler : System.Address;
++ sa_mask : sigset_t;
++ sa_flags : Interfaces.C.unsigned_long;
++ sa_restorer : System.Address;
++ end record;
++ pragma Convention (C, struct_sigaction);
++
++ type struct_sigaction_ptr is access all struct_sigaction;
++
++ type Machine_State is record
++ eip : unsigned_long;
++ ebx : unsigned_long;
++ esp : unsigned_long;
++ ebp : unsigned_long;
++ esi : unsigned_long;
++ edi : unsigned_long;
++ end record;
++ type Machine_State_Ptr is access all Machine_State;
++
++ SA_SIGINFO : constant := System.Linux.SA_SIGINFO;
++ SA_ONSTACK : constant := System.Linux.SA_ONSTACK;
++
++ SIG_BLOCK : constant := 0;
++ SIG_UNBLOCK : constant := 1;
++ SIG_SETMASK : constant := 2;
++
++ SIG_DFL : constant := 0;
++ SIG_IGN : constant := 1;
++
++ function sigaction
++ (sig : Signal;
++ act : struct_sigaction_ptr;
++ oact : struct_sigaction_ptr) return int;
++ pragma Import (C, sigaction, "sigaction");
++
++ ----------
++ -- Time --
++ ----------
++
++ type timespec is private;
++
++ function To_Duration (TS : timespec) return Duration;
++ pragma Inline (To_Duration);
++
++ function To_Timespec (D : Duration) return timespec;
++ pragma Inline (To_Timespec);
++
++ function sysconf (name : int) return long;
++ pragma Import (C, sysconf);
++
++ SC_CLK_TCK : constant := 2;
++ SC_NPROCESSORS_ONLN : constant := 84;
++
++ -------------------------
++ -- Priority Scheduling --
++ -------------------------
++
++ SCHED_OTHER : constant := 0;
++ SCHED_FIFO : constant := 1;
++ SCHED_RR : constant := 2;
++
++ function To_Target_Priority
++ (Prio : System.Any_Priority) return Interfaces.C.int;
++ -- Maps System.Any_Priority to a POSIX priority
++
++ -------------
++ -- Process --
++ -------------
++
++ type pid_t is private;
++
++ function kill (pid : pid_t; sig : Signal) return int;
++ pragma Import (C, kill, "kill");
++
++ function getpid return pid_t;
++ pragma Import (C, getpid, "getpid");
++
++ -------------
++ -- Threads --
++ -------------
++
++ type Thread_Body is access
++ function (arg : System.Address) return System.Address;
++ pragma Convention (C, Thread_Body);
++
++ function Thread_Body_Access is new
++ Ada.Unchecked_Conversion (System.Address, Thread_Body);
++
++ type pthread_t is new unsigned_long;
++ subtype Thread_Id is pthread_t;
++
++ function To_pthread_t is new Ada.Unchecked_Conversion
++ (unsigned_long, pthread_t);
++
++ type pthread_mutex_t is limited private;
++ type pthread_cond_t is limited private;
++ type pthread_attr_t is limited private;
++ type pthread_mutexattr_t is limited private;
++ type pthread_condattr_t is limited private;
++ type pthread_key_t is private;
++
++ PTHREAD_CREATE_DETACHED : constant := 1;
++
++ -----------
++ -- Stack --
++ -----------
++
++ type stack_t is record
++ ss_sp : System.Address;
++ ss_flags : int;
++ ss_size : size_t;
++ end record;
++ pragma Convention (C, stack_t);
++
++ function sigaltstack
++ (ss : not null access stack_t;
++ oss : access stack_t) return int;
++ pragma Import (C, sigaltstack, "sigaltstack");
++
++ Alternate_Stack : aliased System.Address;
++ pragma Import (C, Alternate_Stack, "__gnat_alternate_stack");
++ -- The alternate signal stack for stack overflows
++
++ Alternate_Stack_Size : constant := 16 * 1024;
++ -- This must be in keeping with init.c:__gnat_alternate_stack
++
++ function Get_Stack_Base (thread : pthread_t) return Address;
++ pragma Inline (Get_Stack_Base);
++ -- This is a dummy procedure to share some GNULLI files
++
++ ---------------------------------------
++ -- Nonstandard Thread Initialization --
++ ---------------------------------------
++
++ procedure pthread_init;
++ pragma Inline (pthread_init);
++ -- This is a dummy procedure to share some GNULLI files
++
++ -------------------------
++ -- POSIX.1c Section 3 --
++ -------------------------
++
++ function sigwait (set : access sigset_t; sig : access Signal) return int;
++ pragma Import (C, sigwait, "sigwait");
++
++ function pthread_kill (thread : pthread_t; sig : Signal) return int;
++ pragma Import (C, pthread_kill, "pthread_kill");
++
++ function pthread_sigmask
++ (how : int;
++ set : access sigset_t;
++ oset : access sigset_t) return int;
++ pragma Import (C, pthread_sigmask, "pthread_sigmask");
++
++ --------------------------
++ -- POSIX.1c Section 11 --
++ --------------------------
++
++ function pthread_mutexattr_init
++ (attr : access pthread_mutexattr_t) return int;
++ pragma Import (C, pthread_mutexattr_init, "pthread_mutexattr_init");
++
++ function pthread_mutexattr_destroy
++ (attr : access pthread_mutexattr_t) return int;
++ pragma Import (C, pthread_mutexattr_destroy, "pthread_mutexattr_destroy");
++
++ function pthread_mutex_init
++ (mutex : access pthread_mutex_t;
++ attr : access pthread_mutexattr_t) return int;
++ pragma Import (C, pthread_mutex_init, "pthread_mutex_init");
++
++ function pthread_mutex_destroy (mutex : access pthread_mutex_t) return int;
++ pragma Import (C, pthread_mutex_destroy, "pthread_mutex_destroy");
++
++ function pthread_mutex_lock (mutex : access pthread_mutex_t) return int;
++ pragma Import (C, pthread_mutex_lock, "pthread_mutex_lock");
++
++ function pthread_mutex_unlock (mutex : access pthread_mutex_t) return int;
++ pragma Import (C, pthread_mutex_unlock, "pthread_mutex_unlock");
++
++ function pthread_condattr_init
++ (attr : access pthread_condattr_t) return int;
++ pragma Import (C, pthread_condattr_init, "pthread_condattr_init");
++
++ function pthread_condattr_destroy
++ (attr : access pthread_condattr_t) return int;
++ pragma Import (C, pthread_condattr_destroy, "pthread_condattr_destroy");
++
++ function pthread_cond_init
++ (cond : access pthread_cond_t;
++ attr : access pthread_condattr_t) return int;
++ pragma Import (C, pthread_cond_init, "pthread_cond_init");
++
++ function pthread_cond_destroy (cond : access pthread_cond_t) return int;
++ pragma Import (C, pthread_cond_destroy, "pthread_cond_destroy");
++
++ function pthread_cond_signal (cond : access pthread_cond_t) return int;
++ pragma Import (C, pthread_cond_signal, "pthread_cond_signal");
++
++ function pthread_cond_wait
++ (cond : access pthread_cond_t;
++ mutex : access pthread_mutex_t) return int;
++ pragma Import (C, pthread_cond_wait, "pthread_cond_wait");
++
++ function pthread_cond_timedwait
++ (cond : access pthread_cond_t;
++ mutex : access pthread_mutex_t;
++ abstime : access timespec) return int;
++ pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait");
++
++ --------------------------
++ -- POSIX.1c Section 13 --
++ --------------------------
++
++ type struct_sched_param is record
++ sched_priority : int; -- scheduling priority
++ end record;
++ pragma Convention (C, struct_sched_param);
++
++ function pthread_setschedparam
++ (thread : pthread_t;
++ policy : int;
++ param : access struct_sched_param) return int;
++ pragma Import (C, pthread_setschedparam, "pthread_setschedparam");
++
++ function pthread_attr_setschedpolicy
++ (attr : access pthread_attr_t;
++ policy : int) return int;
++ pragma Import
++ (C, pthread_attr_setschedpolicy, "pthread_attr_setschedpolicy");
++
++ function sched_yield return int;
++ pragma Import (C, sched_yield, "sched_yield");
++
++ ---------------------------
++ -- P1003.1c - Section 16 --
++ ---------------------------
++
++ function pthread_attr_init
++ (attributes : access pthread_attr_t) return int;
++ pragma Import (C, pthread_attr_init, "pthread_attr_init");
++
++ function pthread_attr_destroy
++ (attributes : access pthread_attr_t) return int;
++ pragma Import (C, pthread_attr_destroy, "pthread_attr_destroy");
++
++ function pthread_attr_setdetachstate
++ (attr : access pthread_attr_t;
++ detachstate : int) return int;
++ pragma Import
++ (C, pthread_attr_setdetachstate, "pthread_attr_setdetachstate");
++
++ function pthread_attr_setstacksize
++ (attr : access pthread_attr_t;
++ stacksize : size_t) return int;
++ pragma Import (C, pthread_attr_setstacksize, "pthread_attr_setstacksize");
++
++ function pthread_create
++ (thread : access pthread_t;
++ attributes : access pthread_attr_t;
++ start_routine : Thread_Body;
++ arg : System.Address) return int;
++ pragma Import (C, pthread_create, "pthread_create");
++
++ procedure pthread_exit (status : System.Address);
++ pragma Import (C, pthread_exit, "pthread_exit");
++
++ function pthread_self return pthread_t;
++ pragma Import (C, pthread_self, "pthread_self");
++
++ function lwp_self return System.Address;
++ pragma Import (C, lwp_self, "__gnat_lwp_self");
++
++ --------------------------
++ -- POSIX.1c Section 17 --
++ --------------------------
++
++ function pthread_setspecific
++ (key : pthread_key_t;
++ value : System.Address) return int;
++ pragma Import (C, pthread_setspecific, "pthread_setspecific");
++
++ function pthread_getspecific (key : pthread_key_t) return System.Address;
++ pragma Import (C, pthread_getspecific, "pthread_getspecific");
++
++ type destructor_pointer is access procedure (arg : System.Address);
++ pragma Convention (C, destructor_pointer);
++
++ function pthread_key_create
++ (key : access pthread_key_t;
++ destructor : destructor_pointer) return int;
++ pragma Import (C, pthread_key_create, "pthread_key_create");
++
++ CPU_SETSIZE : constant := 1_024;
++
++ type bit_field is array (1 .. CPU_SETSIZE) of Boolean;
++ for bit_field'Size use CPU_SETSIZE;
++ pragma Pack (bit_field);
++ pragma Convention (C, bit_field);
++
++ type cpu_set_t is record
++ bits : bit_field;
++ end record;
++ pragma Convention (C, cpu_set_t);
++
++ function pthread_setaffinity_np
++ (thread : pthread_t;
++ cpusetsize : size_t;
++ cpuset : access cpu_set_t) return int;
++ pragma Import (C, pthread_setaffinity_np, "pthread_setaffinity_np");
++ pragma Weak_External (pthread_setaffinity_np);
++ -- Use a weak symbol because this function may be available or not,
++ -- depending on the version of the system.
++
++ function pthread_attr_setaffinity_np
++ (attr : access pthread_attr_t;
++ cpusetsize : size_t;
++ cpuset : access cpu_set_t) return int;
++ pragma Import (C, pthread_attr_setaffinity_np,
++ "pthread_attr_setaffinity_np");
++ pragma Weak_External (pthread_attr_setaffinity_np);
++ -- Use a weak symbol because this function may be available or not,
++ -- depending on the version of the system.
++
++private
++
++ type sigset_t is array (0 .. 127) of unsigned_char;
++ pragma Convention (C, sigset_t);
++ for sigset_t'Alignment use Interfaces.C.unsigned_long'Alignment;
++
++ pragma Warnings (Off);
++ for struct_sigaction use record
++ sa_handler at Linux.sa_handler_pos range 0 .. Standard'Address_Size - 1;
++ sa_mask at Linux.sa_mask_pos range 0 .. 1023;
++ sa_flags at Linux.sa_flags_pos range 0 .. Standard'Address_Size - 1;
++ end record;
++ -- We intentionally leave sa_restorer unspecified and let the compiler
++ -- append it after the last field, so disable corresponding warning.
++ pragma Warnings (On);
++
++ type pid_t is new int;
++
++ type time_t is new long;
++
++ type timespec is record
++ tv_sec : time_t;
++ tv_nsec : long;
++ end record;
++ pragma Convention (C, timespec);
++
++ type pthread_attr_t is record
++ detachstate : int;
++ schedpolicy : int;
++ schedparam : struct_sched_param;
++ inheritsched : int;
++ scope : int;
++ guardsize : size_t;
++ stackaddr_set : int;
++ stackaddr : System.Address;
++ stacksize : size_t;
++ end record;
++ pragma Convention (C, pthread_attr_t);
++
++ type pthread_condattr_t is record
++ dummy : int;
++ end record;
++ pragma Convention (C, pthread_condattr_t);
++
++ type pthread_mutexattr_t is record
++ mutexkind : int;
++ end record;
++ pragma Convention (C, pthread_mutexattr_t);
++
++ type pthread_mutex_t is new System.Linux.pthread_mutex_t;
++
++ type unsigned_long_long_t is mod 2 ** 64;
++ -- Interfaces.C.Extensions isn't preelaborated so cannot be with-ed
++
++ type pthread_cond_t is array (0 .. 47) of unsigned_char;
++ pragma Convention (C, pthread_cond_t);
++ for pthread_cond_t'Alignment use unsigned_long_long_t'Alignment;
++
++ type pthread_key_t is new unsigned;
++
++end System.OS_Interface;
+--- /dev/null
++++ gcc/ada/s-osinte-dragonfly.adb
+@@ -0,0 +1,117 @@
++------------------------------------------------------------------------------
++-- --
++-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
++-- --
++-- S Y S T E M . O S _ I N T E R F A C E --
++-- --
++-- B o d y --
++-- --
++-- Copyright (C) 1991-2009, Free Software Foundation, Inc. --
++-- --
++-- GNARL is free software; you can redistribute it and/or modify it under --
++-- terms of the GNU General Public License as published by the Free Soft- --
++-- ware Foundation; either version 3, or (at your option) any later ver- --
++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
++-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
++-- or FITNESS FOR A PARTICULAR PURPOSE. --
++-- --
++-- As a special exception under Section 7 of GPL version 3, you are granted --
++-- additional permissions described in the GCC Runtime Library Exception, --
++-- version 3.1, as published by the Free Software Foundation. --
++-- --
++-- You should have received a copy of the GNU General Public License and --
++-- a copy of the GCC Runtime Library Exception along with this program; --
++-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
++-- <http://www.gnu.org/licenses/>. --
++-- --
++-- GNARL was developed by the GNARL team at Florida State University. It is --
++-- now maintained by Ada Core Technologies Inc. in cooperation with Florida --
++-- State University (http://www.gnat.com). --
++-- --
++-- Copyright (C) 2010 John Marino <draco@marino.st> --
++------------------------------------------------------------------------------
++
++-- This is the DragonFly THREADS version of this package
++
++with Interfaces.C; use Interfaces.C;
++
++package body System.OS_Interface is
++
++ -----------
++ -- Errno --
++ -----------
++
++ function Errno return int is
++ type int_ptr is access all int;
++
++ function internal_errno return int_ptr;
++ pragma Import (C, internal_errno, "__get_errno");
++
++ begin
++ return (internal_errno.all);
++ end Errno;
++
++ --------------------
++ -- Get_Stack_Base --
++ --------------------
++
++ function Get_Stack_Base (thread : pthread_t) return Address is
++ pragma Unreferenced (thread);
++ begin
++ return Null_Address;
++ end Get_Stack_Base;
++
++ ------------------
++ -- pthread_init --
++ ------------------
++
++ procedure pthread_init is
++ begin
++ null;
++ end pthread_init;
++
++ -----------------
++ -- To_Duration --
++ -----------------
++
++ function To_Duration (TS : timespec) return Duration is
++ begin
++ return Duration (TS.tv_sec) + Duration (TS.tv_nsec) / 10#1#E9;
++ end To_Duration;
++
++ ------------------------
++ -- To_Target_Priority --
++ ------------------------
++
++ function To_Target_Priority
++ (Prio : System.Any_Priority) return Interfaces.C.int
++ is
++ begin
++ return Interfaces.C.int (Prio);
++ end To_Target_Priority;
++
++ -----------------
++ -- To_Timespec --
++ -----------------
++
++ function To_Timespec (D : Duration) return timespec is
++ S : time_t;
++ F : Duration;
++
++ begin
++ S := time_t (Long_Long_Integer (D));
++ F := D - Duration (S);
++
++ -- If F has negative value due to a round-up, adjust for positive F
++ -- value.
++
++ if F < 0.0 then
++ S := S - 1;
++ F := F + 1.0;
++ end if;
++
++ return timespec'(tv_sec => S,
++ tv_nsec => long (Long_Long_Integer (F * 10#1#E9)));
++ end To_Timespec;
++
++end System.OS_Interface;
+--- /dev/null
++++ gcc/ada/s-osinte-dragonfly.ads
+@@ -0,0 +1,648 @@
++------------------------------------------------------------------------------
++-- --
++-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
++-- --
++-- S Y S T E M . O S _ I N T E R F A C E --
++-- --
++-- S p e c --
++-- --
++-- Copyright (C) 1991-1994, Florida State University --
++-- Copyright (C) 1995-2009, Free Software Foundation, Inc. --
++-- --
++-- GNARL is free software; you can redistribute it and/or modify it under --
++-- terms of the GNU General Public License as published by the Free Soft- --
++-- ware Foundation; either version 2, or (at your option) any later ver- --
++-- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
++-- OUT 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 distributed with GNARL; see file COPYING. If not, write --
++-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
++-- Boston, MA 02110-1301, USA. --
++-- --
++-- As a special exception, if other files instantiate generics from this --
++-- unit, or you link this unit with other files to produce an executable, --
++-- this unit does not by itself cause the resulting executable to be --
++-- covered by the GNU General Public License. This exception does not --
++-- however invalidate any other reasons why the executable file might be --
++-- covered by the GNU Public License. --
++-- --
++-- GNARL was developed by the GNARL team at Florida State University. It is --
++-- now maintained by Ada Core Technologies Inc. in cooperation with Florida --
++-- State University (http://www.gnat.com). --
++-- --
++-- Copyright (C) 2010 John Marino <draco@marino.st> --
++------------------------------------------------------------------------------
++
++-- This is the DragonFly BSD PTHREADS version of this package
++
++-- This package encapsulates all direct interfaces to OS services
++-- that are needed by the tasking run-time (libgnarl).
++
++-- PLEASE DO NOT add any with-clauses to this package or remove the pragma
++-- Preelaborate. This package is designed to be a bottom-level (leaf) package.
++
++with Ada.Unchecked_Conversion;
++
++with Interfaces.C;
++
++package System.OS_Interface is
++ pragma Preelaborate;
++
++ pragma Linker_Options ("-pthread");
++
++ subtype int is Interfaces.C.int;
++ subtype short is Interfaces.C.short;
++ subtype long is Interfaces.C.long;
++ subtype unsigned is Interfaces.C.unsigned;
++ subtype unsigned_short is Interfaces.C.unsigned_short;
++ subtype unsigned_long is Interfaces.C.unsigned_long;
++ subtype unsigned_char is Interfaces.C.unsigned_char;
++ subtype plain_char is Interfaces.C.plain_char;
++ subtype size_t is Interfaces.C.size_t;
++
++ -----------
++ -- Errno --
++ -----------
++
++ function Errno return int;
++ pragma Inline (Errno);
++
++ EAGAIN : constant := 35;
++ EINTR : constant := 4;
++ EINVAL : constant := 22;
++ ENOMEM : constant := 12;
++ ETIMEDOUT : constant := 60;
++
++ -------------
++ -- Signals --
++ -------------
++
++ Max_Interrupt : constant := 31;
++ type Signal is new int range 0 .. Max_Interrupt;
++ for Signal'Size use int'Size;
++
++ SIGHUP : constant := 1; -- hangup
++ SIGINT : constant := 2; -- interrupt (rubout)
++ SIGQUIT : constant := 3; -- quit (ASCD FS)
++ SIGILL : constant := 4; -- illegal instruction (not reset)
++ SIGTRAP : constant := 5; -- trace trap (not reset)
++ SIGIOT : constant := 6; -- IOT instruction
++ SIGABRT : constant := 6; -- used by abort, replace SIGIOT in the future
++ SIGEMT : constant := 7; -- EMT instruction
++ SIGFPE : constant := 8; -- floating point exception
++ SIGKILL : constant := 9; -- kill (cannot be caught or ignored)
++ SIGBUS : constant := 10; -- bus error
++ SIGSEGV : constant := 11; -- segmentation violation
++ SIGSYS : constant := 12; -- bad argument to system call
++ SIGPIPE : constant := 13; -- write on a pipe with no one to read it
++ SIGALRM : constant := 14; -- alarm clock
++ SIGTERM : constant := 15; -- software termination signal from kill
++ SIGURG : constant := 16; -- urgent condition on IO channel
++ SIGSTOP : constant := 17; -- stop (cannot be caught or ignored)
++ SIGTSTP : constant := 18; -- user stop requested from tty
++ SIGCONT : constant := 19; -- stopped process has been continued
++ SIGCLD : constant := 20; -- alias for SIGCHLD
++ SIGCHLD : constant := 20; -- child status change
++ SIGTTIN : constant := 21; -- background tty read attempted
++ SIGTTOU : constant := 22; -- background tty write attempted
++ SIGIO : constant := 23; -- I/O possible (Solaris SIGPOLL alias)
++ SIGXCPU : constant := 24; -- CPU time limit exceeded
++ SIGXFSZ : constant := 25; -- filesize limit exceeded
++ SIGVTALRM : constant := 26; -- virtual timer expired
++ SIGPROF : constant := 27; -- profiling timer expired
++ SIGWINCH : constant := 28; -- window size change
++ SIGINFO : constant := 29; -- information request (BSD)
++ SIGUSR1 : constant := 30; -- user defined signal 1
++ SIGUSR2 : constant := 31; -- user defined signal 2
++
++ SIGADAABORT : constant := SIGABRT;
++ -- Change this if you want to use another signal for task abort.
++ -- SIGTERM might be a good one.
++
++ type Signal_Set is array (Natural range <>) of Signal;
++
++ -- Interrupts that must be unmasked at all times. DragonFlyBSD
++ -- pthreads will not allow an application to mask out any
++ -- interrupt needed by the threads library.
++ Unmasked : constant Signal_Set :=
++ (SIGTRAP, SIGBUS, SIGTTIN, SIGTTOU, SIGTSTP);
++
++ -- DragonFlyBSD will uses SIGPROF for timing. Do not allow a
++ -- handler to attach to this signal.
++ Reserved : constant Signal_Set := (0 .. 0 => SIGPROF);
++
++ type sigset_t is private;
++
++ function sigaddset
++ (set : access sigset_t;
++ sig : Signal) return int;
++ pragma Import (C, sigaddset, "sigaddset");
++
++ function sigdelset
++ (set : access sigset_t;
++ sig : Signal) return int;
++ pragma Import (C, sigdelset, "sigdelset");
++
++ function sigfillset (set : access sigset_t) return int;
++ pragma Import (C, sigfillset, "sigfillset");
++
++ function sigismember
++ (set : access sigset_t;
++ sig : Signal) return int;
++ pragma Import (C, sigismember, "sigismember");
++
++ function sigemptyset (set : access sigset_t) return int;
++ pragma Import (C, sigemptyset, "sigemptyset");
++
++ -- sigcontext is architecture dependent, so define it private
++ type struct_sigcontext is private;
++
++ type old_struct_sigaction is record
++ sa_handler : System.Address;
++ sa_mask : sigset_t;
++ sa_flags : int;
++ end record;
++ pragma Convention (C, old_struct_sigaction);
++
++ type new_struct_sigaction is record
++ sa_handler : System.Address;
++ sa_flags : int;
++ sa_mask : sigset_t;
++ end record;
++ pragma Convention (C, new_struct_sigaction);
++
++ subtype struct_sigaction is new_struct_sigaction;
++ type struct_sigaction_ptr is access all struct_sigaction;
++
++ SIG_BLOCK : constant := 1;
++ SIG_UNBLOCK : constant := 2;
++ SIG_SETMASK : constant := 3;
++
++ SIG_DFL : constant := 0;
++ SIG_IGN : constant := 1;
++
++ SA_SIGINFO : constant := 16#0040#;
++ SA_ONSTACK : constant := 16#0001#;
++
++ function sigaction
++ (sig : Signal;
++ act : struct_sigaction_ptr;
++ oact : struct_sigaction_ptr) return int;
++ pragma Import (C, sigaction, "sigaction");
++
++ ----------
++ -- Time --
++ ----------
++
++ Time_Slice_Supported : constant Boolean := True;
++ -- Indicates whether time slicing is supported (i.e SCHED_RR is supported)
++
++ type timespec is private;
++
++ function nanosleep (rqtp, rmtp : access timespec) return int;
++ pragma Import (C, nanosleep, "nanosleep");
++
++ type clockid_t is private;
++
++ CLOCK_REALTIME : constant clockid_t;
++
++ function clock_gettime
++ (clock_id : clockid_t;
++ tp : access timespec)
++ return int;
++ pragma Import (C, clock_gettime, "clock_gettime");
++
++ function To_Duration (TS : timespec) return Duration;
++ pragma Inline (To_Duration);
++
++ function To_Timespec (D : Duration) return timespec;
++ pragma Inline (To_Timespec);
++
++ type struct_timezone is record
++ tz_minuteswest : int;
++ tz_dsttime : int;
++ end record;
++ pragma Convention (C, struct_timezone);
++
++ procedure usleep (useconds : unsigned_long);
++ pragma Import (C, usleep, "usleep");
++
++ -------------------------
++ -- Priority Scheduling --
++ -------------------------
++
++ SCHED_FIFO : constant := 1;
++ SCHED_OTHER : constant := 2;
++ SCHED_RR : constant := 3;
++
++ function To_Target_Priority
++ (Prio : System.Any_Priority) return Interfaces.C.int;
++ -- Maps System.Any_Priority to a POSIX priority
++
++ -------------
++ -- Process --
++ -------------
++
++ type pid_t is private;
++
++ function kill (pid : pid_t; sig : Signal) return int;
++ pragma Import (C, kill, "kill");
++
++ function getpid return pid_t;
++ pragma Import (C, getpid, "getpid");
++
++ ---------
++ -- LWP --
++ ---------
++
++ function lwp_self return System.Address;
++ -- lwp_self does not exist on this thread library, revert to pthread_self
++ -- which is the closest approximation (with getpid). This function is
++ -- needed to share 7staprop.adb across POSIX-like targets.
++ pragma Import (C, lwp_self, "pthread_self");
++
++ -------------
++ -- Threads --
++ -------------
++
++ type Thread_Body is access
++ function (arg : System.Address) return System.Address;
++ pragma Convention (C, Thread_Body);
++
++ function Thread_Body_Access is new
++ Ada.Unchecked_Conversion (System.Address, Thread_Body);
++
++ type pthread_t is private;
++ subtype Thread_Id is pthread_t;
++
++ type pthread_mutex_t is limited private;
++ type pthread_cond_t is limited private;
++ type pthread_attr_t is limited private;
++ type pthread_mutexattr_t is limited private;
++ type pthread_condattr_t is limited private;
++ type pthread_key_t is private;
++
++ PTHREAD_CREATE_DETACHED : constant := 1;
++ PTHREAD_CREATE_JOINABLE : constant := 0;
++
++ PTHREAD_SCOPE_PROCESS : constant := 0;
++ PTHREAD_SCOPE_SYSTEM : constant := 2;
++
++ -----------
++ -- Stack --
++ -----------
++
++ type stack_t is record
++ ss_sp : System.Address;
++ ss_size : size_t;
++ ss_flags : int;
++ end record;
++ pragma Convention (C, stack_t);
++
++ function sigaltstack
++ (ss : not null access stack_t;
++ oss : access stack_t) return int;
++ pragma Import (C, sigaltstack, "sigaltstack");
++
++ Alternate_Stack : aliased System.Address;
++ -- This is a dummy definition, never used (Alternate_Stack_Size is null)
++
++ Alternate_Stack_Size : constant := 0;
++ -- No alternate signal stack is used on this platform
++
++ Stack_Base_Available : constant Boolean := False;
++ -- Indicates whether the stack base is available on this target. This
++ -- allows us to share s-osinte.adb between all the FSU run time. Note that
++ -- this value can only be true if pthread_t has a complete definition that
++ -- corresponds exactly to the C header files.
++
++ function Get_Stack_Base (thread : pthread_t) return Address;
++ pragma Inline (Get_Stack_Base);
++ -- returns the stack base of the specified thread. Only call this function
++ -- when Stack_Base_Available is True.
++
++ function Get_Page_Size return size_t;
++ function Get_Page_Size return Address;
++ pragma Import (C, Get_Page_Size, "getpagesize");
++ -- Returns the size of a page
++
++ PROT_NONE : constant := 0;
++ PROT_READ : constant := 1;
++ PROT_WRITE : constant := 2;
++ PROT_EXEC : constant := 4;
++ PROT_ALL : constant := PROT_READ + PROT_WRITE + PROT_EXEC;
++ PROT_ON : constant := PROT_NONE;
++ PROT_OFF : constant := PROT_ALL;
++
++ function mprotect (addr : Address; len : size_t; prot : int) return int;
++ pragma Import (C, mprotect);
++
++ ---------------------------------------
++ -- Nonstandard Thread Initialization --
++ ---------------------------------------
++
++ -- FSU_THREADS requires pthread_init, which is nonstandard and this should
++ -- be invoked during the elaboration of s-taprop.adb.
++
++ -- DragonFlyBSD does not require this so we provide an empty Ada body
++
++ procedure pthread_init;
++
++ -------------------------
++ -- POSIX.1c Section 3 --
++ -------------------------
++
++ function sigwait
++ (set : access sigset_t;
++ sig : access Signal) return int;
++ pragma Import (C, sigwait, "sigwait");
++
++ function pthread_kill
++ (thread : pthread_t;
++ sig : Signal) return int;
++ pragma Import (C, pthread_kill, "pthread_kill");
++
++ function pthread_sigmask
++ (how : int;
++ set : access sigset_t;
++ oset : access sigset_t) return int;
++ pragma Import (C, pthread_sigmask, "pthread_sigmask");
++
++ --------------------------
++ -- POSIX.1c Section 11 --
++ --------------------------
++
++ function pthread_mutexattr_init
++ (attr : access pthread_mutexattr_t) return int;
++ pragma Import (C, pthread_mutexattr_init, "pthread_mutexattr_init");
++
++ function pthread_mutexattr_destroy
++ (attr : access pthread_mutexattr_t) return int;
++ pragma Import (C, pthread_mutexattr_destroy, "pthread_mutexattr_destroy");
++
++ function pthread_mutex_init
++ (mutex : access pthread_mutex_t;
++ attr : access pthread_mutexattr_t) return int;
++ pragma Import (C, pthread_mutex_init, "pthread_mutex_init");
++
++ function pthread_mutex_destroy (mutex : access pthread_mutex_t) return int;
++ pragma Import (C, pthread_mutex_destroy, "pthread_mutex_destroy");
++
++ function pthread_mutex_lock (mutex : access pthread_mutex_t) return int;
++ pragma Import (C, pthread_mutex_lock, "pthread_mutex_lock");
++
++ function pthread_mutex_unlock (mutex : access pthread_mutex_t) return int;
++ pragma Import (C, pthread_mutex_unlock, "pthread_mutex_unlock");
++
++ function pthread_condattr_init
++ (attr : access pthread_condattr_t) return int;
++ pragma Import (C, pthread_condattr_init, "pthread_condattr_init");
++
++ function pthread_condattr_destroy
++ (attr : access pthread_condattr_t) return int;
++ pragma Import (C, pthread_condattr_destroy, "pthread_condattr_destroy");
++
++ function pthread_cond_init
++ (cond : access pthread_cond_t;
++ attr : access pthread_condattr_t) return int;
++ pragma Import (C, pthread_cond_init, "pthread_cond_init");
++
++ function pthread_cond_destroy (cond : access pthread_cond_t) return int;
++ pragma Import (C, pthread_cond_destroy, "pthread_cond_destroy");
++
++ function pthread_cond_signal (cond : access pthread_cond_t) return int;
++ pragma Import (C, pthread_cond_signal, "pthread_cond_signal");
++
++ function pthread_cond_wait
++ (cond : access pthread_cond_t;
++ mutex : access pthread_mutex_t) return int;
++ pragma Import (C, pthread_cond_wait, "pthread_cond_wait");
++
++ function pthread_cond_timedwait
++ (cond : access pthread_cond_t;
++ mutex : access pthread_mutex_t;
++ abstime : access timespec) return int;
++ pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait");
++
++ Relative_Timed_Wait : constant Boolean := False;
++ -- pthread_cond_timedwait requires an absolute delay time
++
++ --------------------------
++ -- POSIX.1c Section 13 --
++ --------------------------
++
++ PTHREAD_PRIO_NONE : constant := 0;
++ PTHREAD_PRIO_PROTECT : constant := 2;
++ PTHREAD_PRIO_INHERIT : constant := 1;
++
++ function pthread_mutexattr_setprotocol
++ (attr : access pthread_mutexattr_t;
++ protocol : int) return int;
++ pragma Import
++ (C, pthread_mutexattr_setprotocol, "pthread_mutexattr_setprotocol");
++
++ function pthread_mutexattr_getprotocol
++ (attr : access pthread_mutexattr_t;
++ protocol : access int) return int;
++ pragma Import
++ (C, pthread_mutexattr_getprotocol, "pthread_mutexattr_getprotocol");
++
++ function pthread_mutexattr_setprioceiling
++ (attr : access pthread_mutexattr_t;
++ prioceiling : int) return int;
++ pragma Import
++ (C, pthread_mutexattr_setprioceiling,
++ "pthread_mutexattr_setprioceiling");
++
++ function pthread_mutexattr_getprioceiling
++ (attr : access pthread_mutexattr_t;
++ prioceiling : access int) return int;
++ pragma Import
++ (C, pthread_mutexattr_getprioceiling,
++ "pthread_mutexattr_getprioceiling");
++
++ type struct_sched_param is record
++ sched_priority : int;
++ end record;
++ pragma Convention (C, struct_sched_param);
++
++ function pthread_getschedparam
++ (thread : pthread_t;
++ policy : access int;
++ param : access struct_sched_param) return int;
++ pragma Import (C, pthread_getschedparam, "pthread_getschedparam");
++
++ function pthread_setschedparam
++ (thread : pthread_t;
++ policy : int;
++ param : access struct_sched_param) return int;
++ pragma Import (C, pthread_setschedparam, "pthread_setschedparam");
++
++ function pthread_attr_setscope
++ (attr : access pthread_attr_t;
++ contentionscope : int) return int;
++ pragma Import (C, pthread_attr_setscope, "pthread_attr_setscope");
++
++ function pthread_attr_getscope
++ (attr : access pthread_attr_t;
++ contentionscope : access int) return int;
++ pragma Import (C, pthread_attr_getscope, "pthread_attr_getscope");
++
++ function pthread_attr_setinheritsched
++ (attr : access pthread_attr_t;
++ inheritsched : int) return int;
++ pragma Import
++ (C, pthread_attr_setinheritsched, "pthread_attr_setinheritsched");
++
++ function pthread_attr_getinheritsched
++ (attr : access pthread_attr_t;
++ inheritsched : access int) return int;
++ pragma Import
++ (C, pthread_attr_getinheritsched, "pthread_attr_getinheritsched");
++
++ function pthread_attr_setschedpolicy
++ (attr : access pthread_attr_t;
++ policy : int) return int;
++ pragma Import (C, pthread_attr_setschedpolicy,
++ "pthread_attr_setschedpolicy");
++
++ function pthread_attr_getschedpolicy
++ (attr : access pthread_attr_t;
++ policy : access int) return int;
++ pragma Import (C, pthread_attr_getschedpolicy,
++ "pthread_attr_getschedpolicy");
++
++ function pthread_attr_setschedparam
++ (attr : access pthread_attr_t;
++ sched_param : int) return int;
++ pragma Import (C, pthread_attr_setschedparam, "pthread_attr_setschedparam");
++
++ function pthread_attr_getschedparam
++ (attr : access pthread_attr_t;
++ sched_param : access int) return int;
++ pragma Import (C, pthread_attr_getschedparam, "pthread_attr_getschedparam");
++
++ function sched_yield return int;
++ pragma Import (C, sched_yield, "pthread_yield");
++
++ --------------------------
++ -- P1003.1c Section 16 --
++ --------------------------
++
++ function pthread_attr_init (attributes : access pthread_attr_t) return int;
++ pragma Import (C, pthread_attr_init, "pthread_attr_init");
++
++ function pthread_attr_destroy
++ (attributes : access pthread_attr_t) return int;
++ pragma Import (C, pthread_attr_destroy, "pthread_attr_destroy");
++
++ function pthread_attr_setdetachstate
++ (attr : access pthread_attr_t;
++ detachstate : int) return int;
++ pragma Import
++ (C, pthread_attr_setdetachstate, "pthread_attr_setdetachstate");
++
++ function pthread_attr_getdetachstate
++ (attr : access pthread_attr_t;
++ detachstate : access int) return int;
++ pragma Import
++ (C, pthread_attr_getdetachstate, "pthread_attr_getdetachstate");
++
++ function pthread_attr_getstacksize
++ (attr : access pthread_attr_t;
++ stacksize : access size_t) return int;
++ pragma Import
++ (C, pthread_attr_getstacksize, "pthread_attr_getstacksize");
++
++ function pthread_attr_setstacksize
++ (attr : access pthread_attr_t;
++ stacksize : size_t) return int;
++ pragma Import
++ (C, pthread_attr_setstacksize, "pthread_attr_setstacksize");
++
++ function pthread_create
++ (thread : access pthread_t;
++ attributes : access pthread_attr_t;
++ start_routine : Thread_Body;
++ arg : System.Address) return int;
++ pragma Import (C, pthread_create, "pthread_create");
++
++ function pthread_detach (thread : pthread_t) return int;
++ pragma Import (C, pthread_detach, "pthread_detach");
++
++ procedure pthread_exit (status : System.Address);
++ pragma Import (C, pthread_exit, "pthread_exit");
++
++ function pthread_self return pthread_t;
++ pragma Import (C, pthread_self, "pthread_self");
++
++ --------------------------
++ -- POSIX.1c Section 17 --
++ --------------------------
++
++ function pthread_setspecific
++ (key : pthread_key_t;
++ value : System.Address) return int;
++ pragma Import (C, pthread_setspecific, "pthread_setspecific");
++
++ function pthread_getspecific (key : pthread_key_t) return System.Address;
++ pragma Import (C, pthread_getspecific, "pthread_getspecific");
++
++ type destructor_pointer is access procedure (arg : System.Address);
++ pragma Convention (C, destructor_pointer);
++
++ function pthread_key_create
++ (key : access pthread_key_t;
++ destructor : destructor_pointer) return int;
++ pragma Import (C, pthread_key_create, "pthread_key_create");
++
++ ------------------------------------
++ -- Non-portable Pthread Functions --
++ ------------------------------------
++
++ function pthread_set_name_np
++ (thread : pthread_t;
++ name : System.Address) return int;
++ pragma Import (C, pthread_set_name_np, "pthread_set_name_np");
++
++private
++
++ type sigset_t is array (1 .. 4) of unsigned;
++
++ -- In DragonFlyBSD the component sa_handler turns out to
++ -- be one a union type, and the selector is a macro:
++ -- #define sa_handler __sigaction_u._handler
++ -- #define sa_sigaction __sigaction_u._sigaction
++
++ -- Should we add a signal_context type here ???
++ -- How could it be done independent of the CPU architecture ???
++ -- sigcontext type is opaque, so it is architecturally neutral.
++ -- It is always passed as an access type, so define it as an empty record
++ -- since the contents are not used anywhere.
++
++ type struct_sigcontext is null record;
++ pragma Convention (C, struct_sigcontext);
++
++ type pid_t is new int;
++
++ type time_t is new long;
++
++ type timespec is record
++ tv_sec : time_t;
++ tv_nsec : long;
++ end record;
++ pragma Convention (C, timespec);
++
++ type clockid_t is new int;
++ CLOCK_REALTIME : constant clockid_t := 0;
++
++ type pthread_t is new System.Address;
++ type pthread_attr_t is new System.Address;
++ type pthread_mutex_t is new System.Address;
++ type pthread_mutexattr_t is new System.Address;
++ type pthread_cond_t is new System.Address;
++ type pthread_condattr_t is new System.Address;
++ type pthread_key_t is new int;
++
++end System.OS_Interface;
+--- gcc/ada/s-osinte-freebsd.adb.orig
++++ gcc/ada/s-osinte-freebsd.adb
+@@ -28,6 +28,7 @@
+ -- now maintained by Ada Core Technologies Inc. in cooperation with Florida --
+ -- State University (http://www.gnat.com). --
+ -- --
++-- Copyright (C) 2010 John Marino <draco@marino.st> --
+ ------------------------------------------------------------------------------
+
+ -- This is the FreeBSD THREADS version of this package
+@@ -44,7 +45,7 @@
+ type int_ptr is access all int;
+
+ function internal_errno return int_ptr;
+- pragma Import (C, internal_errno, "__error");
++ pragma Import (C, internal_errno, "__get_errno");
+
+ begin
+ return (internal_errno.all);
+@@ -57,7 +58,7 @@
+ function Get_Stack_Base (thread : pthread_t) return Address is
+ pragma Unreferenced (thread);
+ begin
+- return (0);
++ return Null_Address;
+ end Get_Stack_Base;
+
+ ------------------
+@@ -75,7 +76,7 @@
+
+ function To_Duration (TS : timespec) return Duration is
+ begin
+- return Duration (TS.ts_sec) + Duration (TS.ts_nsec) / 10#1#E9;
++ return Duration (TS.tv_sec) + Duration (TS.tv_nsec) / 10#1#E9;
+ end To_Duration;
+
+ ------------------------
+@@ -108,8 +109,8 @@
+ F := F + 1.0;
+ end if;
+
+- return timespec'(ts_sec => S,
+- ts_nsec => long (Long_Long_Integer (F * 10#1#E9)));
++ return timespec'(tv_sec => S,
++ tv_nsec => long (Long_Long_Integer (F * 10#1#E9)));
+ end To_Timespec;
+
+ end System.OS_Interface;
+--- /dev/null
++++ gcc/ada/s-osinte-freebsd32.ads
+@@ -0,0 +1,648 @@
++------------------------------------------------------------------------------
++-- --
++-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
++-- --
++-- S Y S T E M . O S _ I N T E R F A C E --
++-- --
++-- S p e c --
++-- --
++-- Copyright (C) 1991-1994, Florida State University --
++-- Copyright (C) 1995-2009, Free Software Foundation, Inc. --
++-- --
++-- GNARL is free software; you can redistribute it and/or modify it under --
++-- terms of the GNU General Public License as published by the Free Soft- --
++-- ware Foundation; either version 2, or (at your option) any later ver- --
++-- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
++-- OUT 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 distributed with GNARL; see file COPYING. If not, write --
++-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
++-- Boston, MA 02110-1301, USA. --
++-- --
++-- As a special exception, if other files instantiate generics from this --
++-- unit, or you link this unit with other files to produce an executable, --
++-- this unit does not by itself cause the resulting executable to be --
++-- covered by the GNU General Public License. This exception does not --
++-- however invalidate any other reasons why the executable file might be --
++-- covered by the GNU Public License. --
++-- --
++-- GNARL was developed by the GNARL team at Florida State University. It is --
++-- now maintained by Ada Core Technologies Inc. in cooperation with Florida --
++-- State University (http://www.gnat.com). --
++-- --
++-- Copyright (C) 2010 John Marino <draco@marino.st> --
++------------------------------------------------------------------------------
++
++-- This is the FreeBSD PTHREADS version of this package
++
++-- This package encapsulates all direct interfaces to OS services
++-- that are needed by the tasking run-time (libgnarl).
++
++-- PLEASE DO NOT add any with-clauses to this package or remove the pragma
++-- Preelaborate. This package is designed to be a bottom-level (leaf) package.
++
++with Ada.Unchecked_Conversion;
++
++with Interfaces.C;
++
++package System.OS_Interface is
++ pragma Preelaborate;
++
++ pragma Linker_Options ("-pthread");
++
++ subtype int is Interfaces.C.int;
++ subtype short is Interfaces.C.short;
++ subtype long is Interfaces.C.long;
++ subtype unsigned is Interfaces.C.unsigned;
++ subtype unsigned_short is Interfaces.C.unsigned_short;
++ subtype unsigned_long is Interfaces.C.unsigned_long;
++ subtype unsigned_char is Interfaces.C.unsigned_char;
++ subtype plain_char is Interfaces.C.plain_char;
++ subtype size_t is Interfaces.C.size_t;
++
++ -----------
++ -- Errno --
++ -----------
++
++ function Errno return int;
++ pragma Inline (Errno);
++
++ EAGAIN : constant := 35;
++ EINTR : constant := 4;
++ EINVAL : constant := 22;
++ ENOMEM : constant := 12;
++ ETIMEDOUT : constant := 60;
++
++ -------------
++ -- Signals --
++ -------------
++
++ Max_Interrupt : constant := 31;
++ type Signal is new int range 0 .. Max_Interrupt;
++ for Signal'Size use int'Size;
++
++ SIGHUP : constant := 1; -- hangup
++ SIGINT : constant := 2; -- interrupt (rubout)
++ SIGQUIT : constant := 3; -- quit (ASCD FS)
++ SIGILL : constant := 4; -- illegal instruction (not reset)
++ SIGTRAP : constant := 5; -- trace trap (not reset)
++ SIGIOT : constant := 6; -- IOT instruction
++ SIGABRT : constant := 6; -- used by abort, replace SIGIOT in the future
++ SIGEMT : constant := 7; -- EMT instruction
++ SIGFPE : constant := 8; -- floating point exception
++ SIGKILL : constant := 9; -- kill (cannot be caught or ignored)
++ SIGBUS : constant := 10; -- bus error
++ SIGSEGV : constant := 11; -- segmentation violation
++ SIGSYS : constant := 12; -- bad argument to system call
++ SIGPIPE : constant := 13; -- write on a pipe with no one to read it
++ SIGALRM : constant := 14; -- alarm clock
++ SIGTERM : constant := 15; -- software termination signal from kill
++ SIGURG : constant := 16; -- urgent condition on IO channel
++ SIGSTOP : constant := 17; -- stop (cannot be caught or ignored)
++ SIGTSTP : constant := 18; -- user stop requested from tty
++ SIGCONT : constant := 19; -- stopped process has been continued
++ SIGCLD : constant := 20; -- alias for SIGCHLD
++ SIGCHLD : constant := 20; -- child status change
++ SIGTTIN : constant := 21; -- background tty read attempted
++ SIGTTOU : constant := 22; -- background tty write attempted
++ SIGIO : constant := 23; -- I/O possible (Solaris SIGPOLL alias)
++ SIGXCPU : constant := 24; -- CPU time limit exceeded
++ SIGXFSZ : constant := 25; -- filesize limit exceeded
++ SIGVTALRM : constant := 26; -- virtual timer expired
++ SIGPROF : constant := 27; -- profiling timer expired
++ SIGWINCH : constant := 28; -- window size change
++ SIGINFO : constant := 29; -- information request (BSD)
++ SIGUSR1 : constant := 30; -- user defined signal 1
++ SIGUSR2 : constant := 31; -- user defined signal 2
++
++ SIGADAABORT : constant := SIGABRT;
++ -- Change this if you want to use another signal for task abort.
++ -- SIGTERM might be a good one.
++
++ type Signal_Set is array (Natural range <>) of Signal;
++
++ -- Interrupts that must be unmasked at all times. FreeBSD
++ -- pthreads will not allow an application to mask out any
++ -- interrupt needed by the threads library.
++ Unmasked : constant Signal_Set :=
++ (SIGTRAP, SIGBUS, SIGTTIN, SIGTTOU, SIGTSTP);
++
++ -- FreeBSD will uses SIGPROF for timing. Do not allow a
++ -- handler to attach to this signal.
++ Reserved : constant Signal_Set := (0 .. 0 => SIGPROF);
++
++ type sigset_t is private;
++
++ function sigaddset
++ (set : access sigset_t;
++ sig : Signal) return int;
++ pragma Import (C, sigaddset, "sigaddset");
++
++ function sigdelset
++ (set : access sigset_t;
++ sig : Signal) return int;
++ pragma Import (C, sigdelset, "sigdelset");
++
++ function sigfillset (set : access sigset_t) return int;
++ pragma Import (C, sigfillset, "sigfillset");
++
++ function sigismember
++ (set : access sigset_t;
++ sig : Signal) return int;
++ pragma Import (C, sigismember, "sigismember");
++
++ function sigemptyset (set : access sigset_t) return int;
++ pragma Import (C, sigemptyset, "sigemptyset");
++
++ -- sigcontext is architecture dependent, so define it private
++ type struct_sigcontext is private;
++
++ type old_struct_sigaction is record
++ sa_handler : System.Address;
++ sa_mask : sigset_t;
++ sa_flags : int;
++ end record;
++ pragma Convention (C, old_struct_sigaction);
++
++ type new_struct_sigaction is record
++ sa_handler : System.Address;
++ sa_flags : int;
++ sa_mask : sigset_t;
++ end record;
++ pragma Convention (C, new_struct_sigaction);
++
++ subtype struct_sigaction is new_struct_sigaction;
++ type struct_sigaction_ptr is access all struct_sigaction;
++
++ SIG_BLOCK : constant := 1;
++ SIG_UNBLOCK : constant := 2;
++ SIG_SETMASK : constant := 3;
++
++ SIG_DFL : constant := 0;
++ SIG_IGN : constant := 1;
++
++ SA_SIGINFO : constant := 16#0040#;
++ SA_ONSTACK : constant := 16#0001#;
++
++ function sigaction
++ (sig : Signal;
++ act : struct_sigaction_ptr;
++ oact : struct_sigaction_ptr) return int;
++ pragma Import (C, sigaction, "sigaction");
++
++ ----------
++ -- Time --
++ ----------
++
++ Time_Slice_Supported : constant Boolean := True;
++ -- Indicates whether time slicing is supported (i.e SCHED_RR is supported)
++
++ type timespec is private;
++
++ function nanosleep (rqtp, rmtp : access timespec) return int;
++ pragma Import (C, nanosleep, "nanosleep");
++
++ type clockid_t is private;
++
++ CLOCK_REALTIME : constant clockid_t;
++
++ function clock_gettime
++ (clock_id : clockid_t;
++ tp : access timespec)
++ return int;
++ pragma Import (C, clock_gettime, "clock_gettime");
++
++ function To_Duration (TS : timespec) return Duration;
++ pragma Inline (To_Duration);
++
++ function To_Timespec (D : Duration) return timespec;
++ pragma Inline (To_Timespec);
++
++ type struct_timezone is record
++ tz_minuteswest : int;
++ tz_dsttime : int;
++ end record;
++ pragma Convention (C, struct_timezone);
++
++ procedure usleep (useconds : unsigned_long);
++ pragma Import (C, usleep, "usleep");
++
++ -------------------------
++ -- Priority Scheduling --
++ -------------------------
++
++ SCHED_FIFO : constant := 1;
++ SCHED_OTHER : constant := 2;
++ SCHED_RR : constant := 3;
++
++ function To_Target_Priority
++ (Prio : System.Any_Priority) return Interfaces.C.int;
++ -- Maps System.Any_Priority to a POSIX priority
++
++ -------------
++ -- Process --
++ -------------
++
++ type pid_t is private;
++
++ function kill (pid : pid_t; sig : Signal) return int;
++ pragma Import (C, kill, "kill");
++
++ function getpid return pid_t;
++ pragma Import (C, getpid, "getpid");
++
++ ---------
++ -- LWP --
++ ---------
++
++ function lwp_self return System.Address;
++ -- lwp_self does not exist on this thread library, revert to pthread_self
++ -- which is the closest approximation (with getpid). This function is
++ -- needed to share 7staprop.adb across POSIX-like targets.
++ pragma Import (C, lwp_self, "pthread_self");
++
++ -------------
++ -- Threads --
++ -------------
++
++ type Thread_Body is access
++ function (arg : System.Address) return System.Address;
++ pragma Convention (C, Thread_Body);
++
++ function Thread_Body_Access is new
++ Ada.Unchecked_Conversion (System.Address, Thread_Body);
++
++ type pthread_t is private;
++ subtype Thread_Id is pthread_t;
++
++ type pthread_mutex_t is limited private;
++ type pthread_cond_t is limited private;
++ type pthread_attr_t is limited private;
++ type pthread_mutexattr_t is limited private;
++ type pthread_condattr_t is limited private;
++ type pthread_key_t is private;
++
++ PTHREAD_CREATE_DETACHED : constant := 1;
++ PTHREAD_CREATE_JOINABLE : constant := 0;
++
++ PTHREAD_SCOPE_PROCESS : constant := 0;
++ PTHREAD_SCOPE_SYSTEM : constant := 2;
++
++ -----------
++ -- Stack --
++ -----------
++
++ type stack_t is record
++ ss_sp : System.Address;
++ ss_size : size_t;
++ ss_flags : int;
++ end record;
++ pragma Convention (C, stack_t);
++
++ function sigaltstack
++ (ss : not null access stack_t;
++ oss : access stack_t) return int;
++ pragma Import (C, sigaltstack, "sigaltstack");
++
++ Alternate_Stack : aliased System.Address;
++ -- This is a dummy definition, never used (Alternate_Stack_Size is null)
++
++ Alternate_Stack_Size : constant := 0;
++ -- No alternate signal stack is used on this platform
++
++ Stack_Base_Available : constant Boolean := False;
++ -- Indicates whether the stack base is available on this target. This
++ -- allows us to share s-osinte.adb between all the FSU run time. Note that
++ -- this value can only be true if pthread_t has a complete definition that
++ -- corresponds exactly to the C header files.
++
++ function Get_Stack_Base (thread : pthread_t) return Address;
++ pragma Inline (Get_Stack_Base);
++ -- returns the stack base of the specified thread. Only call this function
++ -- when Stack_Base_Available is True.
++
++ function Get_Page_Size return size_t;
++ function Get_Page_Size return Address;
++ pragma Import (C, Get_Page_Size, "getpagesize");
++ -- Returns the size of a page
++
++ PROT_NONE : constant := 0;
++ PROT_READ : constant := 1;
++ PROT_WRITE : constant := 2;
++ PROT_EXEC : constant := 4;
++ PROT_ALL : constant := PROT_READ + PROT_WRITE + PROT_EXEC;
++ PROT_ON : constant := PROT_NONE;
++ PROT_OFF : constant := PROT_ALL;
++
++ function mprotect (addr : Address; len : size_t; prot : int) return int;
++ pragma Import (C, mprotect);
++
++ ---------------------------------------
++ -- Nonstandard Thread Initialization --
++ ---------------------------------------
++
++ -- FSU_THREADS requires pthread_init, which is nonstandard and this should
++ -- be invoked during the elaboration of s-taprop.adb.
++
++ -- FreeBSD does not require this so we provide an empty Ada body
++
++ procedure pthread_init;
++
++ -------------------------
++ -- POSIX.1c Section 3 --
++ -------------------------
++
++ function sigwait
++ (set : access sigset_t;
++ sig : access Signal) return int;
++ pragma Import (C, sigwait, "sigwait");
++
++ function pthread_kill
++ (thread : pthread_t;
++ sig : Signal) return int;
++ pragma Import (C, pthread_kill, "pthread_kill");
++
++ function pthread_sigmask
++ (how : int;
++ set : access sigset_t;
++ oset : access sigset_t) return int;
++ pragma Import (C, pthread_sigmask, "pthread_sigmask");
++
++ --------------------------
++ -- POSIX.1c Section 11 --
++ --------------------------
++
++ function pthread_mutexattr_init
++ (attr : access pthread_mutexattr_t) return int;
++ pragma Import (C, pthread_mutexattr_init, "pthread_mutexattr_init");
++
++ function pthread_mutexattr_destroy
++ (attr : access pthread_mutexattr_t) return int;
++ pragma Import (C, pthread_mutexattr_destroy, "pthread_mutexattr_destroy");
++
++ function pthread_mutex_init
++ (mutex : access pthread_mutex_t;
++ attr : access pthread_mutexattr_t) return int;
++ pragma Import (C, pthread_mutex_init, "pthread_mutex_init");
++
++ function pthread_mutex_destroy (mutex : access pthread_mutex_t) return int;
++ pragma Import (C, pthread_mutex_destroy, "pthread_mutex_destroy");
++
++ function pthread_mutex_lock (mutex : access pthread_mutex_t) return int;
++ pragma Import (C, pthread_mutex_lock, "pthread_mutex_lock");
++
++ function pthread_mutex_unlock (mutex : access pthread_mutex_t) return int;
++ pragma Import (C, pthread_mutex_unlock, "pthread_mutex_unlock");
++
++ function pthread_condattr_init
++ (attr : access pthread_condattr_t) return int;
++ pragma Import (C, pthread_condattr_init, "pthread_condattr_init");
++
++ function pthread_condattr_destroy
++ (attr : access pthread_condattr_t) return int;
++ pragma Import (C, pthread_condattr_destroy, "pthread_condattr_destroy");
++
++ function pthread_cond_init
++ (cond : access pthread_cond_t;
++ attr : access pthread_condattr_t) return int;
++ pragma Import (C, pthread_cond_init, "pthread_cond_init");
++
++ function pthread_cond_destroy (cond : access pthread_cond_t) return int;
++ pragma Import (C, pthread_cond_destroy, "pthread_cond_destroy");
++
++ function pthread_cond_signal (cond : access pthread_cond_t) return int;
++ pragma Import (C, pthread_cond_signal, "pthread_cond_signal");
++
++ function pthread_cond_wait
++ (cond : access pthread_cond_t;
++ mutex : access pthread_mutex_t) return int;
++ pragma Import (C, pthread_cond_wait, "pthread_cond_wait");
++
++ function pthread_cond_timedwait
++ (cond : access pthread_cond_t;
++ mutex : access pthread_mutex_t;
++ abstime : access timespec) return int;
++ pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait");
++
++ Relative_Timed_Wait : constant Boolean := False;
++ -- pthread_cond_timedwait requires an absolute delay time
++
++ --------------------------
++ -- POSIX.1c Section 13 --
++ --------------------------
++
++ PTHREAD_PRIO_NONE : constant := 0;
++ PTHREAD_PRIO_PROTECT : constant := 2;
++ PTHREAD_PRIO_INHERIT : constant := 1;
++
++ function pthread_mutexattr_setprotocol
++ (attr : access pthread_mutexattr_t;
++ protocol : int) return int;
++ pragma Import
++ (C, pthread_mutexattr_setprotocol, "pthread_mutexattr_setprotocol");
++
++ function pthread_mutexattr_getprotocol
++ (attr : access pthread_mutexattr_t;
++ protocol : access int) return int;
++ pragma Import
++ (C, pthread_mutexattr_getprotocol, "pthread_mutexattr_getprotocol");
++
++ function pthread_mutexattr_setprioceiling
++ (attr : access pthread_mutexattr_t;
++ prioceiling : int) return int;
++ pragma Import
++ (C, pthread_mutexattr_setprioceiling,
++ "pthread_mutexattr_setprioceiling");
++
++ function pthread_mutexattr_getprioceiling
++ (attr : access pthread_mutexattr_t;
++ prioceiling : access int) return int;
++ pragma Import
++ (C, pthread_mutexattr_getprioceiling,
++ "pthread_mutexattr_getprioceiling");
++
++ type struct_sched_param is record
++ sched_priority : int;
++ end record;
++ pragma Convention (C, struct_sched_param);
++
++ function pthread_getschedparam
++ (thread : pthread_t;
++ policy : access int;
++ param : access struct_sched_param) return int;
++ pragma Import (C, pthread_getschedparam, "pthread_getschedparam");
++
++ function pthread_setschedparam
++ (thread : pthread_t;
++ policy : int;
++ param : access struct_sched_param) return int;
++ pragma Import (C, pthread_setschedparam, "pthread_setschedparam");
++
++ function pthread_attr_setscope
++ (attr : access pthread_attr_t;
++ contentionscope : int) return int;
++ pragma Import (C, pthread_attr_setscope, "pthread_attr_setscope");
++
++ function pthread_attr_getscope
++ (attr : access pthread_attr_t;
++ contentionscope : access int) return int;
++ pragma Import (C, pthread_attr_getscope, "pthread_attr_getscope");
++
++ function pthread_attr_setinheritsched
++ (attr : access pthread_attr_t;
++ inheritsched : int) return int;
++ pragma Import
++ (C, pthread_attr_setinheritsched, "pthread_attr_setinheritsched");
++
++ function pthread_attr_getinheritsched
++ (attr : access pthread_attr_t;
++ inheritsched : access int) return int;
++ pragma Import
++ (C, pthread_attr_getinheritsched, "pthread_attr_getinheritsched");
++
++ function pthread_attr_setschedpolicy
++ (attr : access pthread_attr_t;
++ policy : int) return int;
++ pragma Import (C, pthread_attr_setschedpolicy,
++ "pthread_attr_setschedpolicy");
++
++ function pthread_attr_getschedpolicy
++ (attr : access pthread_attr_t;
++ policy : access int) return int;
++ pragma Import (C, pthread_attr_getschedpolicy,
++ "pthread_attr_getschedpolicy");
++
++ function pthread_attr_setschedparam
++ (attr : access pthread_attr_t;
++ sched_param : int) return int;
++ pragma Import (C, pthread_attr_setschedparam, "pthread_attr_setschedparam");
++
++ function pthread_attr_getschedparam
++ (attr : access pthread_attr_t;
++ sched_param : access int) return int;
++ pragma Import (C, pthread_attr_getschedparam, "pthread_attr_getschedparam");
++
++ function sched_yield return int;
++ pragma Import (C, sched_yield, "pthread_yield");
++
++ --------------------------
++ -- P1003.1c Section 16 --
++ --------------------------
++
++ function pthread_attr_init (attributes : access pthread_attr_t) return int;
++ pragma Import (C, pthread_attr_init, "pthread_attr_init");
++
++ function pthread_attr_destroy
++ (attributes : access pthread_attr_t) return int;
++ pragma Import (C, pthread_attr_destroy, "pthread_attr_destroy");
++
++ function pthread_attr_setdetachstate
++ (attr : access pthread_attr_t;
++ detachstate : int) return int;
++ pragma Import
++ (C, pthread_attr_setdetachstate, "pthread_attr_setdetachstate");
++
++ function pthread_attr_getdetachstate
++ (attr : access pthread_attr_t;
++ detachstate : access int) return int;
++ pragma Import
++ (C, pthread_attr_getdetachstate, "pthread_attr_getdetachstate");
++
++ function pthread_attr_getstacksize
++ (attr : access pthread_attr_t;
++ stacksize : access size_t) return int;
++ pragma Import
++ (C, pthread_attr_getstacksize, "pthread_attr_getstacksize");
++
++ function pthread_attr_setstacksize
++ (attr : access pthread_attr_t;
++ stacksize : size_t) return int;
++ pragma Import
++ (C, pthread_attr_setstacksize, "pthread_attr_setstacksize");
++
++ function pthread_create
++ (thread : access pthread_t;
++ attributes : access pthread_attr_t;
++ start_routine : Thread_Body;
++ arg : System.Address) return int;
++ pragma Import (C, pthread_create, "pthread_create");
++
++ function pthread_detach (thread : pthread_t) return int;
++ pragma Import (C, pthread_detach, "pthread_detach");
++
++ procedure pthread_exit (status : System.Address);
++ pragma Import (C, pthread_exit, "pthread_exit");
++
++ function pthread_self return pthread_t;
++ pragma Import (C, pthread_self, "pthread_self");
++
++ --------------------------
++ -- POSIX.1c Section 17 --
++ --------------------------
++
++ function pthread_setspecific
++ (key : pthread_key_t;
++ value : System.Address) return int;
++ pragma Import (C, pthread_setspecific, "pthread_setspecific");
++
++ function pthread_getspecific (key : pthread_key_t) return System.Address;
++ pragma Import (C, pthread_getspecific, "pthread_getspecific");
++
++ type destructor_pointer is access procedure (arg : System.Address);
++ pragma Convention (C, destructor_pointer);
++
++ function pthread_key_create
++ (key : access pthread_key_t;
++ destructor : destructor_pointer) return int;
++ pragma Import (C, pthread_key_create, "pthread_key_create");
++
++ ------------------------------------
++ -- Non-portable Pthread Functions --
++ ------------------------------------
++
++ function pthread_set_name_np
++ (thread : pthread_t;
++ name : System.Address) return int;
++ pragma Import (C, pthread_set_name_np, "pthread_set_name_np");
++
++private
++
++ type sigset_t is array (1 .. 4) of unsigned;
++
++ -- In FreeBSD the component sa_handler turns out to
++ -- be one a union type, and the selector is a macro:
++ -- #define sa_handler __sigaction_u._handler
++ -- #define sa_sigaction __sigaction_u._sigaction
++
++ -- Should we add a signal_context type here ???
++ -- How could it be done independent of the CPU architecture ???
++ -- sigcontext type is opaque, so it is architecturally neutral.
++ -- It is always passed as an access type, so define it as an empty record
++ -- since the contents are not used anywhere.
++
++ type struct_sigcontext is null record;
++ pragma Convention (C, struct_sigcontext);
++
++ type pid_t is new int;
++
++ type time_t is new int;
++
++ type timespec is record
++ tv_sec : time_t;
++ tv_nsec : long;
++ end record;
++ pragma Convention (C, timespec);
++
++ type clockid_t is new int;
++ CLOCK_REALTIME : constant clockid_t := 0;
++
++ type pthread_t is new System.Address;
++ type pthread_attr_t is new System.Address;
++ type pthread_mutex_t is new System.Address;
++ type pthread_mutexattr_t is new System.Address;
++ type pthread_cond_t is new System.Address;
++ type pthread_condattr_t is new System.Address;
++ type pthread_key_t is new int;
++
++end System.OS_Interface;
+--- /dev/null
++++ gcc/ada/s-osinte-freebsd64.ads
+@@ -0,0 +1,649 @@
++------------------------------------------------------------------------------
++-- --
++-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
++-- --
++-- S Y S T E M . O S _ I N T E R F A C E --
++-- --
++-- S p e c --
++-- --
++-- Copyright (C) 1991-1994, Florida State University --
++-- Copyright (C) 1995-2009, Free Software Foundation, Inc. --
++-- --
++-- GNARL is free software; you can redistribute it and/or modify it under --
++-- terms of the GNU General Public License as published by the Free Soft- --
++-- ware Foundation; either version 2, or (at your option) any later ver- --
++-- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
++-- OUT 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 distributed with GNARL; see file COPYING. If not, write --
++-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
++-- Boston, MA 02110-1301, USA. --
++-- --
++-- As a special exception, if other files instantiate generics from this --
++-- unit, or you link this unit with other files to produce an executable, --
++-- this unit does not by itself cause the resulting executable to be --
++-- covered by the GNU General Public License. This exception does not --
++-- however invalidate any other reasons why the executable file might be --
++-- covered by the GNU Public License. --
++-- --
++-- GNARL was developed by the GNARL team at Florida State University. It is --
++-- now maintained by Ada Core Technologies Inc. in cooperation with Florida --
++-- State University (http://www.gnat.com). --
++-- --
++-- Copyright (C) 2010 John Marino <draco@marino.st> --
++------------------------------------------------------------------------------
++
++-- This is the FreeBSD PTHREADS version of this package
++
++-- This package encapsulates all direct interfaces to OS services
++-- that are needed by the tasking run-time (libgnarl).
++
++-- PLEASE DO NOT add any with-clauses to this package or remove the pragma
++-- Preelaborate. This package is designed to be a bottom-level (leaf) package.
++
++with Ada.Unchecked_Conversion;
++
++with Interfaces.C;
++
++package System.OS_Interface is
++ pragma Preelaborate;
++
++ pragma Linker_Options ("-pthread");
++
++ subtype int is Interfaces.C.int;
++ subtype short is Interfaces.C.short;
++ subtype long is Interfaces.C.long;
++ subtype unsigned is Interfaces.C.unsigned;
++ subtype unsigned_short is Interfaces.C.unsigned_short;
++ subtype unsigned_long is Interfaces.C.unsigned_long;
++ subtype unsigned_char is Interfaces.C.unsigned_char;
++ subtype plain_char is Interfaces.C.plain_char;
++ subtype size_t is Interfaces.C.size_t;
++ subtype int64_t is Interfaces.Integer_64;
++
++ -----------
++ -- Errno --
++ -----------
++
++ function Errno return int;
++ pragma Inline (Errno);
++
++ EAGAIN : constant := 35;
++ EINTR : constant := 4;
++ EINVAL : constant := 22;
++ ENOMEM : constant := 12;
++ ETIMEDOUT : constant := 60;
++
++ -------------
++ -- Signals --
++ -------------
++
++ Max_Interrupt : constant := 31;
++ type Signal is new int range 0 .. Max_Interrupt;
++ for Signal'Size use int'Size;
++
++ SIGHUP : constant := 1; -- hangup
++ SIGINT : constant := 2; -- interrupt (rubout)
++ SIGQUIT : constant := 3; -- quit (ASCD FS)
++ SIGILL : constant := 4; -- illegal instruction (not reset)
++ SIGTRAP : constant := 5; -- trace trap (not reset)
++ SIGIOT : constant := 6; -- IOT instruction
++ SIGABRT : constant := 6; -- used by abort, replace SIGIOT in the future
++ SIGEMT : constant := 7; -- EMT instruction
++ SIGFPE : constant := 8; -- floating point exception
++ SIGKILL : constant := 9; -- kill (cannot be caught or ignored)
++ SIGBUS : constant := 10; -- bus error
++ SIGSEGV : constant := 11; -- segmentation violation
++ SIGSYS : constant := 12; -- bad argument to system call
++ SIGPIPE : constant := 13; -- write on a pipe with no one to read it
++ SIGALRM : constant := 14; -- alarm clock
++ SIGTERM : constant := 15; -- software termination signal from kill
++ SIGURG : constant := 16; -- urgent condition on IO channel
++ SIGSTOP : constant := 17; -- stop (cannot be caught or ignored)
++ SIGTSTP : constant := 18; -- user stop requested from tty
++ SIGCONT : constant := 19; -- stopped process has been continued
++ SIGCLD : constant := 20; -- alias for SIGCHLD
++ SIGCHLD : constant := 20; -- child status change
++ SIGTTIN : constant := 21; -- background tty read attempted
++ SIGTTOU : constant := 22; -- background tty write attempted
++ SIGIO : constant := 23; -- I/O possible (Solaris SIGPOLL alias)
++ SIGXCPU : constant := 24; -- CPU time limit exceeded
++ SIGXFSZ : constant := 25; -- filesize limit exceeded
++ SIGVTALRM : constant := 26; -- virtual timer expired
++ SIGPROF : constant := 27; -- profiling timer expired
++ SIGWINCH : constant := 28; -- window size change
++ SIGINFO : constant := 29; -- information request (BSD)
++ SIGUSR1 : constant := 30; -- user defined signal 1
++ SIGUSR2 : constant := 31; -- user defined signal 2
++
++ SIGADAABORT : constant := SIGABRT;
++ -- Change this if you want to use another signal for task abort.
++ -- SIGTERM might be a good one.
++
++ type Signal_Set is array (Natural range <>) of Signal;
++
++ -- Interrupts that must be unmasked at all times. FreeBSD
++ -- pthreads will not allow an application to mask out any
++ -- interrupt needed by the threads library.
++ Unmasked : constant Signal_Set :=
++ (SIGTRAP, SIGBUS, SIGTTIN, SIGTTOU, SIGTSTP);
++
++ -- FreeBSD will uses SIGPROF for timing. Do not allow a
++ -- handler to attach to this signal.
++ Reserved : constant Signal_Set := (0 .. 0 => SIGPROF);
++
++ type sigset_t is private;
++
++ function sigaddset
++ (set : access sigset_t;
++ sig : Signal) return int;
++ pragma Import (C, sigaddset, "sigaddset");
++
++ function sigdelset
++ (set : access sigset_t;
++ sig : Signal) return int;
++ pragma Import (C, sigdelset, "sigdelset");
++
++ function sigfillset (set : access sigset_t) return int;
++ pragma Import (C, sigfillset, "sigfillset");
++
++ function sigismember
++ (set : access sigset_t;
++ sig : Signal) return int;
++ pragma Import (C, sigismember, "sigismember");
++
++ function sigemptyset (set : access sigset_t) return int;
++ pragma Import (C, sigemptyset, "sigemptyset");
++
++ -- sigcontext is architecture dependent, so define it private
++ type struct_sigcontext is private;
++
++ type old_struct_sigaction is record
++ sa_handler : System.Address;
++ sa_mask : sigset_t;
++ sa_flags : int;
++ end record;
++ pragma Convention (C, old_struct_sigaction);
++
++ type new_struct_sigaction is record
++ sa_handler : System.Address;
++ sa_flags : int;
++ sa_mask : sigset_t;
++ end record;
++ pragma Convention (C, new_struct_sigaction);
++
++ subtype struct_sigaction is new_struct_sigaction;
++ type struct_sigaction_ptr is access all struct_sigaction;
++
++ SIG_BLOCK : constant := 1;
++ SIG_UNBLOCK : constant := 2;
++ SIG_SETMASK : constant := 3;
++
++ SIG_DFL : constant := 0;
++ SIG_IGN : constant := 1;
++
++ SA_SIGINFO : constant := 16#0040#;
++ SA_ONSTACK : constant := 16#0001#;
++
++ function sigaction
++ (sig : Signal;
++ act : struct_sigaction_ptr;
++ oact : struct_sigaction_ptr) return int;
++ pragma Import (C, sigaction, "sigaction");
++
++ ----------
++ -- Time --
++ ----------
++
++ Time_Slice_Supported : constant Boolean := True;
++ -- Indicates whether time slicing is supported (i.e SCHED_RR is supported)
++
++ type timespec is private;
++
++ function nanosleep (rqtp, rmtp : access timespec) return int;
++ pragma Import (C, nanosleep, "nanosleep");
++
++ type clockid_t is private;
++
++ CLOCK_REALTIME : constant clockid_t;
++
++ function clock_gettime
++ (clock_id : clockid_t;
++ tp : access timespec)
++ return int;
++ pragma Import (C, clock_gettime, "clock_gettime");
++
++ function To_Duration (TS : timespec) return Duration;
++ pragma Inline (To_Duration);
++
++ function To_Timespec (D : Duration) return timespec;
++ pragma Inline (To_Timespec);
++
++ type struct_timezone is record
++ tz_minuteswest : int;
++ tz_dsttime : int;
++ end record;
++ pragma Convention (C, struct_timezone);
++
++ procedure usleep (useconds : unsigned_long);
++ pragma Import (C, usleep, "usleep");
++
++ -------------------------
++ -- Priority Scheduling --
++ -------------------------
++
++ SCHED_FIFO : constant := 1;
++ SCHED_OTHER : constant := 2;
++ SCHED_RR : constant := 3;
++
++ function To_Target_Priority
++ (Prio : System.Any_Priority) return Interfaces.C.int;
++ -- Maps System.Any_Priority to a POSIX priority
++
++ -------------
++ -- Process --
++ -------------
++
++ type pid_t is private;
++
++ function kill (pid : pid_t; sig : Signal) return int;
++ pragma Import (C, kill, "kill");
++
++ function getpid return pid_t;
++ pragma Import (C, getpid, "getpid");
++
++ ---------
++ -- LWP --
++ ---------
++
++ function lwp_self return System.Address;
++ -- lwp_self does not exist on this thread library, revert to pthread_self
++ -- which is the closest approximation (with getpid). This function is
++ -- needed to share 7staprop.adb across POSIX-like targets.
++ pragma Import (C, lwp_self, "pthread_self");
++
++ -------------
++ -- Threads --
++ -------------
++
++ type Thread_Body is access
++ function (arg : System.Address) return System.Address;
++ pragma Convention (C, Thread_Body);
++
++ function Thread_Body_Access is new
++ Ada.Unchecked_Conversion (System.Address, Thread_Body);
++
++ type pthread_t is private;
++ subtype Thread_Id is pthread_t;
++
++ type pthread_mutex_t is limited private;
++ type pthread_cond_t is limited private;
++ type pthread_attr_t is limited private;
++ type pthread_mutexattr_t is limited private;
++ type pthread_condattr_t is limited private;
++ type pthread_key_t is private;
++
++ PTHREAD_CREATE_DETACHED : constant := 1;
++ PTHREAD_CREATE_JOINABLE : constant := 0;
++
++ PTHREAD_SCOPE_PROCESS : constant := 0;
++ PTHREAD_SCOPE_SYSTEM : constant := 2;
++
++ -----------
++ -- Stack --
++ -----------
++
++ type stack_t is record
++ ss_sp : System.Address;
++ ss_size : size_t;
++ ss_flags : int;
++ end record;
++ pragma Convention (C, stack_t);
++
++ function sigaltstack
++ (ss : not null access stack_t;
++ oss : access stack_t) return int;
++ pragma Import (C, sigaltstack, "sigaltstack");
++
++ Alternate_Stack : aliased System.Address;
++ -- This is a dummy definition, never used (Alternate_Stack_Size is null)
++
++ Alternate_Stack_Size : constant := 0;
++ -- No alternate signal stack is used on this platform
++
++ Stack_Base_Available : constant Boolean := False;
++ -- Indicates whether the stack base is available on this target. This
++ -- allows us to share s-osinte.adb between all the FSU run time. Note that
++ -- this value can only be true if pthread_t has a complete definition that
++ -- corresponds exactly to the C header files.
++
++ function Get_Stack_Base (thread : pthread_t) return Address;
++ pragma Inline (Get_Stack_Base);
++ -- returns the stack base of the specified thread. Only call this function
++ -- when Stack_Base_Available is True.
++
++ function Get_Page_Size return size_t;
++ function Get_Page_Size return Address;
++ pragma Import (C, Get_Page_Size, "getpagesize");
++ -- Returns the size of a page
++
++ PROT_NONE : constant := 0;
++ PROT_READ : constant := 1;
++ PROT_WRITE : constant := 2;
++ PROT_EXEC : constant := 4;
++ PROT_ALL : constant := PROT_READ + PROT_WRITE + PROT_EXEC;
++ PROT_ON : constant := PROT_NONE;
++ PROT_OFF : constant := PROT_ALL;
++
++ function mprotect (addr : Address; len : size_t; prot : int) return int;
++ pragma Import (C, mprotect);
++
++ ---------------------------------------
++ -- Nonstandard Thread Initialization --
++ ---------------------------------------
++
++ -- FSU_THREADS requires pthread_init, which is nonstandard and this should
++ -- be invoked during the elaboration of s-taprop.adb.
++
++ -- FreeBSD does not require this so we provide an empty Ada body
++
++ procedure pthread_init;
++
++ -------------------------
++ -- POSIX.1c Section 3 --
++ -------------------------
++
++ function sigwait
++ (set : access sigset_t;
++ sig : access Signal) return int;
++ pragma Import (C, sigwait, "sigwait");
++
++ function pthread_kill
++ (thread : pthread_t;
++ sig : Signal) return int;
++ pragma Import (C, pthread_kill, "pthread_kill");
++
++ function pthread_sigmask
++ (how : int;
++ set : access sigset_t;
++ oset : access sigset_t) return int;
++ pragma Import (C, pthread_sigmask, "pthread_sigmask");
++
++ --------------------------
++ -- POSIX.1c Section 11 --
++ --------------------------
++
++ function pthread_mutexattr_init
++ (attr : access pthread_mutexattr_t) return int;
++ pragma Import (C, pthread_mutexattr_init, "pthread_mutexattr_init");
++
++ function pthread_mutexattr_destroy
++ (attr : access pthread_mutexattr_t) return int;
++ pragma Import (C, pthread_mutexattr_destroy, "pthread_mutexattr_destroy");
++
++ function pthread_mutex_init
++ (mutex : access pthread_mutex_t;
++ attr : access pthread_mutexattr_t) return int;
++ pragma Import (C, pthread_mutex_init, "pthread_mutex_init");
++
++ function pthread_mutex_destroy (mutex : access pthread_mutex_t) return int;
++ pragma Import (C, pthread_mutex_destroy, "pthread_mutex_destroy");
++
++ function pthread_mutex_lock (mutex : access pthread_mutex_t) return int;
++ pragma Import (C, pthread_mutex_lock, "pthread_mutex_lock");
++
++ function pthread_mutex_unlock (mutex : access pthread_mutex_t) return int;
++ pragma Import (C, pthread_mutex_unlock, "pthread_mutex_unlock");
++
++ function pthread_condattr_init
++ (attr : access pthread_condattr_t) return int;
++ pragma Import (C, pthread_condattr_init, "pthread_condattr_init");
++
++ function pthread_condattr_destroy
++ (attr : access pthread_condattr_t) return int;
++ pragma Import (C, pthread_condattr_destroy, "pthread_condattr_destroy");
++
++ function pthread_cond_init
++ (cond : access pthread_cond_t;
++ attr : access pthread_condattr_t) return int;
++ pragma Import (C, pthread_cond_init, "pthread_cond_init");
++
++ function pthread_cond_destroy (cond : access pthread_cond_t) return int;
++ pragma Import (C, pthread_cond_destroy, "pthread_cond_destroy");
++
++ function pthread_cond_signal (cond : access pthread_cond_t) return int;
++ pragma Import (C, pthread_cond_signal, "pthread_cond_signal");
++
++ function pthread_cond_wait
++ (cond : access pthread_cond_t;
++ mutex : access pthread_mutex_t) return int;
++ pragma Import (C, pthread_cond_wait, "pthread_cond_wait");
++
++ function pthread_cond_timedwait
++ (cond : access pthread_cond_t;
++ mutex : access pthread_mutex_t;
++ abstime : access timespec) return int;
++ pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait");
++
++ Relative_Timed_Wait : constant Boolean := False;
++ -- pthread_cond_timedwait requires an absolute delay time
++
++ --------------------------
++ -- POSIX.1c Section 13 --
++ --------------------------
++
++ PTHREAD_PRIO_NONE : constant := 0;
++ PTHREAD_PRIO_PROTECT : constant := 2;
++ PTHREAD_PRIO_INHERIT : constant := 1;
++
++ function pthread_mutexattr_setprotocol
++ (attr : access pthread_mutexattr_t;
++ protocol : int) return int;
++ pragma Import
++ (C, pthread_mutexattr_setprotocol, "pthread_mutexattr_setprotocol");
++
++ function pthread_mutexattr_getprotocol
++ (attr : access pthread_mutexattr_t;
++ protocol : access int) return int;
++ pragma Import
++ (C, pthread_mutexattr_getprotocol, "pthread_mutexattr_getprotocol");
++
++ function pthread_mutexattr_setprioceiling
++ (attr : access pthread_mutexattr_t;
++ prioceiling : int) return int;
++ pragma Import
++ (C, pthread_mutexattr_setprioceiling,
++ "pthread_mutexattr_setprioceiling");
++
++ function pthread_mutexattr_getprioceiling
++ (attr : access pthread_mutexattr_t;
++ prioceiling : access int) return int;
++ pragma Import
++ (C, pthread_mutexattr_getprioceiling,
++ "pthread_mutexattr_getprioceiling");
++
++ type struct_sched_param is record
++ sched_priority : int;
++ end record;
++ pragma Convention (C, struct_sched_param);
++
++ function pthread_getschedparam
++ (thread : pthread_t;
++ policy : access int;
++ param : access struct_sched_param) return int;
++ pragma Import (C, pthread_getschedparam, "pthread_getschedparam");
++
++ function pthread_setschedparam
++ (thread : pthread_t;
++ policy : int;
++ param : access struct_sched_param) return int;
++ pragma Import (C, pthread_setschedparam, "pthread_setschedparam");
++
++ function pthread_attr_setscope
++ (attr : access pthread_attr_t;
++ contentionscope : int) return int;
++ pragma Import (C, pthread_attr_setscope, "pthread_attr_setscope");
++
++ function pthread_attr_getscope
++ (attr : access pthread_attr_t;
++ contentionscope : access int) return int;
++ pragma Import (C, pthread_attr_getscope, "pthread_attr_getscope");
++
++ function pthread_attr_setinheritsched
++ (attr : access pthread_attr_t;
++ inheritsched : int) return int;
++ pragma Import
++ (C, pthread_attr_setinheritsched, "pthread_attr_setinheritsched");
++
++ function pthread_attr_getinheritsched
++ (attr : access pthread_attr_t;
++ inheritsched : access int) return int;
++ pragma Import
++ (C, pthread_attr_getinheritsched, "pthread_attr_getinheritsched");
++
++ function pthread_attr_setschedpolicy
++ (attr : access pthread_attr_t;
++ policy : int) return int;
++ pragma Import (C, pthread_attr_setschedpolicy,
++ "pthread_attr_setschedpolicy");
++
++ function pthread_attr_getschedpolicy
++ (attr : access pthread_attr_t;
++ policy : access int) return int;
++ pragma Import (C, pthread_attr_getschedpolicy,
++ "pthread_attr_getschedpolicy");
++
++ function pthread_attr_setschedparam
++ (attr : access pthread_attr_t;
++ sched_param : int) return int;
++ pragma Import (C, pthread_attr_setschedparam, "pthread_attr_setschedparam");
++
++ function pthread_attr_getschedparam
++ (attr : access pthread_attr_t;
++ sched_param : access int) return int;
++ pragma Import (C, pthread_attr_getschedparam, "pthread_attr_getschedparam");
++
++ function sched_yield return int;
++ pragma Import (C, sched_yield, "pthread_yield");
++
++ --------------------------
++ -- P1003.1c Section 16 --
++ --------------------------
++
++ function pthread_attr_init (attributes : access pthread_attr_t) return int;
++ pragma Import (C, pthread_attr_init, "pthread_attr_init");
++
++ function pthread_attr_destroy
++ (attributes : access pthread_attr_t) return int;
++ pragma Import (C, pthread_attr_destroy, "pthread_attr_destroy");
++
++ function pthread_attr_setdetachstate
++ (attr : access pthread_attr_t;
++ detachstate : int) return int;
++ pragma Import
++ (C, pthread_attr_setdetachstate, "pthread_attr_setdetachstate");
++
++ function pthread_attr_getdetachstate
++ (attr : access pthread_attr_t;
++ detachstate : access int) return int;
++ pragma Import
++ (C, pthread_attr_getdetachstate, "pthread_attr_getdetachstate");
++
++ function pthread_attr_getstacksize
++ (attr : access pthread_attr_t;
++ stacksize : access size_t) return int;
++ pragma Import
++ (C, pthread_attr_getstacksize, "pthread_attr_getstacksize");
++
++ function pthread_attr_setstacksize
++ (attr : access pthread_attr_t;
++ stacksize : size_t) return int;
++ pragma Import
++ (C, pthread_attr_setstacksize, "pthread_attr_setstacksize");
++
++ function pthread_create
++ (thread : access pthread_t;
++ attributes : access pthread_attr_t;
++ start_routine : Thread_Body;
++ arg : System.Address) return int;
++ pragma Import (C, pthread_create, "pthread_create");
++
++ function pthread_detach (thread : pthread_t) return int;
++ pragma Import (C, pthread_detach, "pthread_detach");
++
++ procedure pthread_exit (status : System.Address);
++ pragma Import (C, pthread_exit, "pthread_exit");
++
++ function pthread_self return pthread_t;
++ pragma Import (C, pthread_self, "pthread_self");
++
++ --------------------------
++ -- POSIX.1c Section 17 --
++ --------------------------
++
++ function pthread_setspecific
++ (key : pthread_key_t;
++ value : System.Address) return int;
++ pragma Import (C, pthread_setspecific, "pthread_setspecific");
++
++ function pthread_getspecific (key : pthread_key_t) return System.Address;
++ pragma Import (C, pthread_getspecific, "pthread_getspecific");
++
++ type destructor_pointer is access procedure (arg : System.Address);
++ pragma Convention (C, destructor_pointer);
++
++ function pthread_key_create
++ (key : access pthread_key_t;
++ destructor : destructor_pointer) return int;
++ pragma Import (C, pthread_key_create, "pthread_key_create");
++
++ ------------------------------------
++ -- Non-portable Pthread Functions --
++ ------------------------------------
++
++ function pthread_set_name_np
++ (thread : pthread_t;
++ name : System.Address) return int;
++ pragma Import (C, pthread_set_name_np, "pthread_set_name_np");
++
++private
++
++ type sigset_t is array (1 .. 4) of unsigned;
++
++ -- In FreeBSD the component sa_handler turns out to
++ -- be one a union type, and the selector is a macro:
++ -- #define sa_handler __sigaction_u._handler
++ -- #define sa_sigaction __sigaction_u._sigaction
++
++ -- Should we add a signal_context type here ???
++ -- How could it be done independent of the CPU architecture ???
++ -- sigcontext type is opaque, so it is architecturally neutral.
++ -- It is always passed as an access type, so define it as an empty record
++ -- since the contents are not used anywhere.
++
++ type struct_sigcontext is null record;
++ pragma Convention (C, struct_sigcontext);
++
++ type pid_t is new int;
++
++ type time_t is new int64_t;
++
++ type timespec is record
++ tv_sec : time_t;
++ tv_nsec : long;
++ end record;
++ pragma Convention (C, timespec);
++
++ type clockid_t is new int;
++ CLOCK_REALTIME : constant clockid_t := 0;
++
++ type pthread_t is new System.Address;
++ type pthread_attr_t is new System.Address;
++ type pthread_mutex_t is new System.Address;
++ type pthread_mutexattr_t is new System.Address;
++ type pthread_cond_t is new System.Address;
++ type pthread_condattr_t is new System.Address;
++ type pthread_key_t is new int;
++
++end System.OS_Interface;
+--- /dev/null
++++ gcc/ada/s-osinte-netbsd.adb
+@@ -0,0 +1,141 @@
++------------------------------------------------------------------------------
++-- --
++-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
++-- --
++-- S Y S T E M . O S _ I N T E R F A C E --
++-- --
++-- B o d y --
++-- --
++-- Copyright (C) 1991-2009, Free Software Foundation, Inc. --
++-- --
++-- GNARL is free software; you can redistribute it and/or modify it under --
++-- terms of the GNU General Public License as published by the Free Soft- --
++-- ware Foundation; either version 3, or (at your option) any later ver- --
++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
++-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
++-- or FITNESS FOR A PARTICULAR PURPOSE. --
++-- --
++-- As a special exception under Section 7 of GPL version 3, you are granted --
++-- additional permissions described in the GCC Runtime Library Exception, --
++-- version 3.1, as published by the Free Software Foundation. --
++-- --
++-- You should have received a copy of the GNU General Public License and --
++-- a copy of the GCC Runtime Library Exception along with this program; --
++-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
++-- <http://www.gnu.org/licenses/>. --
++-- --
++-- GNARL was developed by the GNARL team at Florida State University. It is --
++-- now maintained by Ada Core Technologies Inc. in cooperation with Florida --
++-- State University (http://www.gnat.com). --
++-- --
++-- Copyright (C) 2010 John Marino <draco@marino.st> --
++------------------------------------------------------------------------------
++
++-- This is the NetBSD THREADS version of this package
++
++with Interfaces.C; use Interfaces.C;
++
++package body System.OS_Interface is
++
++ -----------
++ -- Errno --
++ -----------
++
++ function Errno return int is
++ type int_ptr is access all int;
++
++ function internal_errno return int_ptr;
++ pragma Import (C, internal_errno, "__errno");
++
++ begin
++ return (internal_errno.all);
++ end Errno;
++
++ --------------------
++ -- Get_Stack_Base --
++ --------------------
++
++ function Get_Stack_Base (thread : pthread_t) return Address is
++ pragma Unreferenced (thread);
++ begin
++ return Null_Address;
++ end Get_Stack_Base;
++
++ ------------------
++ -- pthread_init --
++ ------------------
++
++ procedure pthread_init is
++ begin
++ null;
++ end pthread_init;
++
++ -----------------------------------
++ -- pthread_mutexattr_setprotocol --
++ -----------------------------------
++
++ function pthread_mutexattr_setprotocol
++ (attr : access pthread_mutexattr_t;
++ protocol : int) return int is
++ pragma Unreferenced (attr, protocol);
++ begin
++ return 0;
++ end pthread_mutexattr_setprotocol;
++
++ --------------------------------------
++ -- pthread_mutexattr_setprioceiling --
++ --------------------------------------
++
++ function pthread_mutexattr_setprioceiling
++ (attr : access pthread_mutexattr_t;
++ prioceiling : int) return int is
++ pragma Unreferenced (attr, prioceiling);
++ begin
++ return 0;
++ end pthread_mutexattr_setprioceiling;
++
++ -----------------
++ -- To_Duration --
++ -----------------
++
++ function To_Duration (TS : timespec) return Duration is
++ begin
++ return Duration (TS.tv_sec) + Duration (TS.tv_nsec) / 10#1#E9;
++ end To_Duration;
++
++ ------------------------
++ -- To_Target_Priority --
++ ------------------------
++
++ function To_Target_Priority
++ (Prio : System.Any_Priority) return Interfaces.C.int
++ is
++ begin
++ return Interfaces.C.int (Prio);
++ end To_Target_Priority;
++
++ -----------------
++ -- To_Timespec --
++ -----------------
++
++ function To_Timespec (D : Duration) return timespec is
++ S : time_t;
++ F : Duration;
++
++ begin
++ S := time_t (Long_Long_Integer (D));
++ F := D - Duration (S);
++
++ -- If F has negative value due to a round-up, adjust for positive F
++ -- value.
++
++ if F < 0.0 then
++ S := S - 1;
++ F := F + 1.0;
++ end if;
++
++ return timespec'(tv_sec => S,
++ tv_nsec => long (Long_Long_Integer (F * 10#1#E9)));
++ end To_Timespec;
++
++end System.OS_Interface;
+--- /dev/null
++++ gcc/ada/s-osinte-netbsd.ads
+@@ -0,0 +1,674 @@
++------------------------------------------------------------------------------
++-- --
++-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
++-- --
++-- S Y S T E M . O S _ I N T E R F A C E --
++-- --
++-- S p e c --
++-- --
++-- Copyright (C) 1991-1994, Florida State University --
++-- Copyright (C) 1995-2009, Free Software Foundation, Inc. --
++-- --
++-- GNARL is free software; you can redistribute it and/or modify it under --
++-- terms of the GNU General Public License as published by the Free Soft- --
++-- ware Foundation; either version 2, or (at your option) any later ver- --
++-- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
++-- OUT 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 distributed with GNARL; see file COPYING. If not, write --
++-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
++-- Boston, MA 02110-1301, USA. --
++-- --
++-- As a special exception, if other files instantiate generics from this --
++-- unit, or you link this unit with other files to produce an executable, --
++-- this unit does not by itself cause the resulting executable to be --
++-- covered by the GNU General Public License. This exception does not --
++-- however invalidate any other reasons why the executable file might be --
++-- covered by the GNU Public License. --
++-- --
++-- GNARL was developed by the GNARL team at Florida State University. It is --
++-- now maintained by Ada Core Technologies Inc. in cooperation with Florida --
++-- State University (http://www.gnat.com). --
++-- --
++-- Copyright (C) 2010 John Marino <draco@marino.st> --
++------------------------------------------------------------------------------
++
++-- This is the NetBSD PTHREADS version of this package.
++-- It is based off of the FreeBSD PTHREADS as of 4.2.3.
++
++-- This package encapsulates all direct interfaces to OS services
++-- that are needed by the tasking run-time (libgnarl).
++
++-- PLEASE DO NOT add any with-clauses to this package or remove the pragma
++-- Preelaborate. This package is designed to be a bottom-level (leaf) package.
++
++with Ada.Unchecked_Conversion;
++
++with Interfaces.C;
++
++package System.OS_Interface is
++ pragma Preelaborate;
++
++ pragma Linker_Options ("-pthread");
++
++ subtype int is Interfaces.C.int;
++ subtype short is Interfaces.C.short;
++ subtype long is Interfaces.C.long;
++ subtype unsigned is Interfaces.C.unsigned;
++ subtype unsigned_short is Interfaces.C.unsigned_short;
++ subtype unsigned_long is Interfaces.C.unsigned_long;
++ subtype unsigned_char is Interfaces.C.unsigned_char;
++ subtype plain_char is Interfaces.C.plain_char;
++ subtype size_t is Interfaces.C.size_t;
++
++ -----------
++ -- Errno --
++ -----------
++
++ function Errno return int;
++ pragma Inline (Errno);
++
++ EAGAIN : constant := 35;
++ EINTR : constant := 4;
++ EINVAL : constant := 22;
++ ENOMEM : constant := 12;
++ ETIMEDOUT : constant := 60;
++
++ -------------
++ -- Signals --
++ -------------
++
++ Max_Interrupt : constant := 63;
++ type Signal is new int range 0 .. Max_Interrupt;
++ for Signal'Size use int'Size;
++
++ SIGHUP : constant := 1; -- hangup
++ SIGINT : constant := 2; -- interrupt (rubout)
++ SIGQUIT : constant := 3; -- quit (ASCD FS)
++ SIGILL : constant := 4; -- illegal instruction (not reset)
++ SIGTRAP : constant := 5; -- trace trap (not reset)
++ SIGIOT : constant := 6; -- IOT instruction
++ SIGABRT : constant := 6; -- used by abort, replace SIGIOT in the future
++ SIGEMT : constant := 7; -- EMT instruction
++ SIGFPE : constant := 8; -- floating point exception
++ SIGKILL : constant := 9; -- kill (cannot be caught or ignored)
++ SIGBUS : constant := 10; -- bus error
++ SIGSEGV : constant := 11; -- segmentation violation
++ SIGSYS : constant := 12; -- bad argument to system call
++ SIGPIPE : constant := 13; -- write on a pipe with no one to read it
++ SIGALRM : constant := 14; -- alarm clock
++ SIGTERM : constant := 15; -- software termination signal from kill
++ SIGURG : constant := 16; -- urgent condition on IO channel
++ SIGSTOP : constant := 17; -- stop (cannot be caught or ignored)
++ SIGTSTP : constant := 18; -- user stop requested from tty
++ SIGCONT : constant := 19; -- stopped process has been continued
++ SIGCLD : constant := 20; -- alias for SIGCHLD
++ SIGCHLD : constant := 20; -- child status change
++ SIGTTIN : constant := 21; -- background tty read attempted
++ SIGTTOU : constant := 22; -- background tty write attempted
++ SIGIO : constant := 23; -- I/O possible (Solaris SIGPOLL alias)
++ SIGXCPU : constant := 24; -- CPU time limit exceeded
++ SIGXFSZ : constant := 25; -- filesize limit exceeded
++ SIGVTALRM : constant := 26; -- virtual timer expired
++ SIGPROF : constant := 27; -- profiling timer expired
++ SIGWINCH : constant := 28; -- window size change
++ SIGINFO : constant := 29; -- information request (BSD)
++ SIGUSR1 : constant := 30; -- user defined signal 1
++ SIGUSR2 : constant := 31; -- user defined signal 2
++ SIGPWR : constant := 32; -- power fail/restart (not reset when caught)
++
++ SIGADAABORT : constant := SIGABRT;
++ -- Change this if you want to use another signal for task abort.
++ -- SIGTERM might be a good one.
++
++ type Signal_Set is array (Natural range <>) of Signal;
++
++ -- Interrupts that must be unmasked at all times. NetBSD
++ -- pthreads will not allow an application to mask out any
++ -- interrupt needed by the threads library.
++ Unmasked : constant Signal_Set :=
++ (SIGTRAP, SIGBUS, SIGTTIN, SIGTTOU, SIGTSTP);
++
++ -- NetBSD will uses SIGPROF for timing. Do not allow a
++ -- handler to attach to this signal.
++ Reserved : constant Signal_Set := (0 .. 0 => SIGPROF);
++
++ type sigset_t is private;
++
++ function sigaddset
++ (set : access sigset_t;
++ sig : Signal) return int;
++ pragma Import (C, sigaddset, "__sigaddset14");
++
++ function sigdelset
++ (set : access sigset_t;
++ sig : Signal) return int;
++ pragma Import (C, sigdelset, "__sigdelset14");
++
++ function sigfillset (set : access sigset_t) return int;
++ pragma Import (C, sigfillset, "__sigfillset14");
++
++ function sigismember
++ (set : access sigset_t;
++ sig : Signal) return int;
++ pragma Import (C, sigismember, "__sigismember14");
++
++ function sigemptyset (set : access sigset_t) return int;
++ pragma Import (C, sigemptyset, "__sigemptyset14");
++
++ -- sigcontext is architecture dependent, so define it private
++ type struct_sigcontext is private;
++
++ type old_struct_sigaction is record
++ sa_handler : System.Address;
++ sa_mask : sigset_t;
++ sa_flags : int;
++ end record;
++ pragma Convention (C, old_struct_sigaction);
++
++ type new_struct_sigaction is record
++ sa_handler : System.Address;
++ sa_flags : int;
++ sa_mask : sigset_t;
++ end record;
++ pragma Convention (C, new_struct_sigaction);
++
++ subtype struct_sigaction is new_struct_sigaction;
++ type struct_sigaction_ptr is access all struct_sigaction;
++
++ SIG_BLOCK : constant := 1;
++ SIG_UNBLOCK : constant := 2;
++ SIG_SETMASK : constant := 3;
++
++ SIG_DFL : constant := 0;
++ SIG_IGN : constant := 1;
++ SIG_ERR : constant := -1;
++ SIG_HOLD : constant := 3;
++
++ SA_SIGINFO : constant := 16#0040#;
++ SA_ONSTACK : constant := 16#0001#;
++
++ function sigaction
++ (sig : Signal;
++ act : struct_sigaction_ptr;
++ oact : struct_sigaction_ptr) return int;
++ pragma Import (C, sigaction, "__sigaction14");
++
++ ----------
++ -- Time --
++ ----------
++
++ Time_Slice_Supported : constant Boolean := True;
++ -- Indicates whether time slicing is supported (i.e SCHED_RR is supported)
++
++ type timespec is private;
++
++ function nanosleep (rqtp, rmtp : access timespec) return int;
++ pragma Import (C, nanosleep, "nanosleep");
++
++ type clockid_t is private;
++
++ CLOCK_REALTIME : constant clockid_t;
++
++ function clock_gettime
++ (clock_id : clockid_t;
++ tp : access timespec)
++ return int;
++ pragma Import (C, clock_gettime, "clock_gettime");
++
++ function To_Duration (TS : timespec) return Duration;
++ pragma Inline (To_Duration);
++
++ function To_Timespec (D : Duration) return timespec;
++ pragma Inline (To_Timespec);
++
++ type struct_timezone is record
++ tz_minuteswest : int;
++ tz_dsttime : int;
++ end record;
++ pragma Convention (C, struct_timezone);
++
++ -------------------------
++ -- Priority Scheduling --
++ -------------------------
++
++ SCHED_FIFO : constant := 1;
++ SCHED_OTHER : constant := 2;
++ SCHED_RR : constant := 3;
++
++ function To_Target_Priority
++ (Prio : System.Any_Priority) return Interfaces.C.int;
++ -- Maps System.Any_Priority to a POSIX priority
++
++ -------------
++ -- Process --
++ -------------
++
++ type pid_t is private;
++
++ function kill (pid : pid_t; sig : Signal) return int;
++ pragma Import (C, kill, "kill");
++
++ function getpid return pid_t;
++ pragma Import (C, getpid, "getpid");
++
++ ---------
++ -- LWP --
++ ---------
++
++ function lwp_self return System.Address;
++ -- lwp_self does not exist on this thread library, revert to pthread_self
++ -- which is the closest approximation (with getpid). This function is
++ -- needed to share 7staprop.adb across POSIX-like targets.
++ pragma Import (C, lwp_self, "pthread_self");
++
++ -------------
++ -- Threads --
++ -------------
++
++ type Thread_Body is access
++ function (arg : System.Address) return System.Address;
++ pragma Convention (C, Thread_Body);
++
++ function Thread_Body_Access is new
++ Ada.Unchecked_Conversion (System.Address, Thread_Body);
++
++ type pthread_t is private;
++ subtype Thread_Id is pthread_t;
++
++ type pthread_mutex_t is limited private;
++ type pthread_cond_t is limited private;
++ type pthread_attr_t is limited private;
++ type pthread_mutexattr_t is limited private;
++ type pthread_condattr_t is limited private;
++ type pthread_key_t is private;
++
++ PTHREAD_CREATE_DETACHED : constant := 1;
++ PTHREAD_CREATE_JOINABLE : constant := 0;
++
++ PTHREAD_SCOPE_PROCESS : constant := 0;
++ PTHREAD_SCOPE_SYSTEM : constant := 2;
++
++ -----------
++ -- Stack --
++ -----------
++
++ type stack_t is record
++ ss_sp : System.Address;
++ ss_size : size_t;
++ ss_flags : int;
++ end record;
++ pragma Convention (C, stack_t);
++
++ function sigaltstack
++ (ss : not null access stack_t;
++ oss : access stack_t) return int;
++ pragma Import (C, sigaltstack, "sigaltstack");
++
++ Alternate_Stack : aliased System.Address;
++ -- This is a dummy definition, never used (Alternate_Stack_Size is null)
++
++ Alternate_Stack_Size : constant := 0;
++ -- No alternate signal stack is used on this platform
++
++ Stack_Base_Available : constant Boolean := False;
++ -- Indicates whether the stack base is available on this target. This
++ -- allows us to share s-osinte.adb between all the FSU run time. Note that
++ -- this value can only be true if pthread_t has a complete definition that
++ -- corresponds exactly to the C header files.
++
++ function Get_Stack_Base (thread : pthread_t) return Address;
++ pragma Inline (Get_Stack_Base);
++ -- returns the stack base of the specified thread. Only call this function
++ -- when Stack_Base_Available is True.
++
++ function Get_Page_Size return size_t;
++ function Get_Page_Size return Address;
++ pragma Import (C, Get_Page_Size, "getpagesize");
++ -- Returns the size of a page
++
++ PROT_NONE : constant := 0;
++ PROT_READ : constant := 1;
++ PROT_WRITE : constant := 2;
++ PROT_EXEC : constant := 4;
++ PROT_ALL : constant := PROT_READ + PROT_WRITE + PROT_EXEC;
++ PROT_ON : constant := PROT_NONE;
++ PROT_OFF : constant := PROT_ALL;
++
++ function mprotect (addr : Address; len : size_t; prot : int) return int;
++ pragma Import (C, mprotect);
++
++ ---------------------------------------
++ -- Nonstandard Thread Initialization --
++ ---------------------------------------
++
++ -- FSU_THREADS requires pthread_init, which is nonstandard and this should
++ -- be invoked during the elaboration of s-taprop.adb.
++
++ -- NetBSD does not require this so we provide an empty Ada body
++
++ procedure pthread_init;
++
++ -------------------------
++ -- POSIX.1c Section 3 --
++ -------------------------
++
++ function sigwait
++ (set : access sigset_t;
++ sig : access Signal) return int;
++ pragma Import (C, sigwait, "sigwait");
++
++ function pthread_kill
++ (thread : pthread_t;
++ sig : Signal) return int;
++ pragma Import (C, pthread_kill, "pthread_kill");
++
++ function pthread_sigmask
++ (how : int;
++ set : access sigset_t;
++ oset : access sigset_t) return int;
++ pragma Import (C, pthread_sigmask, "pthread_sigmask");
++
++ --------------------------
++ -- POSIX.1c Section 11 --
++ --------------------------
++
++ function pthread_mutexattr_init
++ (attr : access pthread_mutexattr_t) return int;
++ pragma Import (C, pthread_mutexattr_init, "pthread_mutexattr_init");
++
++ function pthread_mutexattr_destroy
++ (attr : access pthread_mutexattr_t) return int;
++ pragma Import (C, pthread_mutexattr_destroy, "pthread_mutexattr_destroy");
++
++ function pthread_mutex_init
++ (mutex : access pthread_mutex_t;
++ attr : access pthread_mutexattr_t) return int;
++ pragma Import (C, pthread_mutex_init, "pthread_mutex_init");
++
++ function pthread_mutex_destroy (mutex : access pthread_mutex_t) return int;
++ pragma Import (C, pthread_mutex_destroy, "pthread_mutex_destroy");
++
++ function pthread_mutex_lock (mutex : access pthread_mutex_t) return int;
++ pragma Import (C, pthread_mutex_lock, "pthread_mutex_lock");
++
++ function pthread_mutex_unlock (mutex : access pthread_mutex_t) return int;
++ pragma Import (C, pthread_mutex_unlock, "pthread_mutex_unlock");
++
++ function pthread_condattr_init
++ (attr : access pthread_condattr_t) return int;
++ pragma Import (C, pthread_condattr_init, "pthread_condattr_init");
++
++ function pthread_condattr_destroy
++ (attr : access pthread_condattr_t) return int;
++ pragma Import (C, pthread_condattr_destroy, "pthread_condattr_destroy");
++
++ function pthread_cond_init
++ (cond : access pthread_cond_t;
++ attr : access pthread_condattr_t) return int;
++ pragma Import (C, pthread_cond_init, "pthread_cond_init");
++
++ function pthread_cond_destroy (cond : access pthread_cond_t) return int;
++ pragma Import (C, pthread_cond_destroy, "pthread_cond_destroy");
++
++ function pthread_cond_signal (cond : access pthread_cond_t) return int;
++ pragma Import (C, pthread_cond_signal, "pthread_cond_signal");
++
++ function pthread_cond_wait
++ (cond : access pthread_cond_t;
++ mutex : access pthread_mutex_t) return int;
++ pragma Import (C, pthread_cond_wait, "pthread_cond_wait");
++
++ function pthread_cond_timedwait
++ (cond : access pthread_cond_t;
++ mutex : access pthread_mutex_t;
++ abstime : access timespec) return int;
++ pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait");
++
++ Relative_Timed_Wait : constant Boolean := False;
++ -- pthread_cond_timedwait requires an absolute delay time
++
++ --------------------------
++ -- POSIX.1c Section 13 --
++ --------------------------
++
++ PTHREAD_PRIO_NONE : constant := 0;
++ PTHREAD_PRIO_PROTECT : constant := 2;
++ PTHREAD_PRIO_INHERIT : constant := 1;
++
++ function pthread_mutexattr_setprotocol
++ (attr : access pthread_mutexattr_t;
++ protocol : int) return int;
++
++ function pthread_mutexattr_setprioceiling
++ (attr : access pthread_mutexattr_t;
++ prioceiling : int) return int;
++
++ type struct_sched_param is record
++ sched_priority : int;
++ end record;
++ pragma Convention (C, struct_sched_param);
++
++ function pthread_getschedparam
++ (thread : pthread_t;
++ policy : access int;
++ param : access struct_sched_param) return int;
++ pragma Import (C, pthread_getschedparam, "pthread_getschedparam");
++
++ function pthread_setschedparam
++ (thread : pthread_t;
++ policy : int;
++ param : access struct_sched_param) return int;
++ pragma Import (C, pthread_setschedparam, "pthread_setschedparam");
++
++ function pthread_attr_setscope
++ (attr : access pthread_attr_t;
++ contentionscope : int) return int;
++ pragma Import (C, pthread_attr_setscope, "pthread_attr_setscope");
++
++ function pthread_attr_getscope
++ (attr : access pthread_attr_t;
++ contentionscope : access int) return int;
++ pragma Import (C, pthread_attr_getscope, "pthread_attr_getscope");
++
++ function pthread_attr_setinheritsched
++ (attr : access pthread_attr_t;
++ inheritsched : int) return int;
++ pragma Import
++ (C, pthread_attr_setinheritsched, "pthread_attr_setinheritsched");
++
++ function pthread_attr_getinheritsched
++ (attr : access pthread_attr_t;
++ inheritsched : access int) return int;
++ pragma Import
++ (C, pthread_attr_getinheritsched, "pthread_attr_getinheritsched");
++
++ function pthread_attr_setschedpolicy
++ (attr : access pthread_attr_t;
++ policy : int) return int;
++ pragma Import (C, pthread_attr_setschedpolicy,
++ "pthread_attr_setschedpolicy");
++
++ function pthread_attr_getschedpolicy
++ (attr : access pthread_attr_t;
++ policy : access int) return int;
++ pragma Import (C, pthread_attr_getschedpolicy,
++ "pthread_attr_getschedpolicy");
++
++ function pthread_attr_setschedparam
++ (attr : access pthread_attr_t;
++ sched_param : int) return int;
++ pragma Import (C, pthread_attr_setschedparam, "pthread_attr_setschedparam");
++
++ function pthread_attr_getschedparam
++ (attr : access pthread_attr_t;
++ sched_param : access int) return int;
++ pragma Import (C, pthread_attr_getschedparam, "pthread_attr_getschedparam");
++
++ function sched_yield return int;
++ pragma Import (C, sched_yield, "sched_yield");
++
++ --------------------------
++ -- P1003.1c Section 16 --
++ --------------------------
++
++ function pthread_attr_init (attributes : access pthread_attr_t) return int;
++ pragma Import (C, pthread_attr_init, "pthread_attr_init");
++
++ function pthread_attr_destroy
++ (attributes : access pthread_attr_t) return int;
++ pragma Import (C, pthread_attr_destroy, "pthread_attr_destroy");
++
++ function pthread_attr_setdetachstate
++ (attr : access pthread_attr_t;
++ detachstate : int) return int;
++ pragma Import
++ (C, pthread_attr_setdetachstate, "pthread_attr_setdetachstate");
++
++ function pthread_attr_getdetachstate
++ (attr : access pthread_attr_t;
++ detachstate : access int) return int;
++ pragma Import
++ (C, pthread_attr_getdetachstate, "pthread_attr_getdetachstate");
++
++ function pthread_attr_getstacksize
++ (attr : access pthread_attr_t;
++ stacksize : access size_t) return int;
++ pragma Import
++ (C, pthread_attr_getstacksize, "pthread_attr_getstacksize");
++
++ function pthread_attr_setstacksize
++ (attr : access pthread_attr_t;
++ stacksize : size_t) return int;
++ pragma Import
++ (C, pthread_attr_setstacksize, "pthread_attr_setstacksize");
++
++ function pthread_create
++ (thread : access pthread_t;
++ attributes : access pthread_attr_t;
++ start_routine : Thread_Body;
++ arg : System.Address) return int;
++ pragma Import (C, pthread_create, "pthread_create");
++
++ function pthread_detach (thread : pthread_t) return int;
++ pragma Import (C, pthread_detach, "pthread_detach");
++
++ procedure pthread_exit (status : System.Address);
++ pragma Import (C, pthread_exit, "pthread_exit");
++
++ function pthread_self return pthread_t;
++ pragma Import (C, pthread_self, "pthread_self");
++
++ --------------------------
++ -- POSIX.1c Section 17 --
++ --------------------------
++
++ function pthread_setspecific
++ (key : pthread_key_t;
++ value : System.Address) return int;
++ pragma Import (C, pthread_setspecific, "pthread_setspecific");
++
++ function pthread_getspecific (key : pthread_key_t) return System.Address;
++ pragma Import (C, pthread_getspecific, "pthread_getspecific");
++
++ type destructor_pointer is access procedure (arg : System.Address);
++ pragma Convention (C, destructor_pointer);
++
++ function pthread_key_create
++ (key : access pthread_key_t;
++ destructor : destructor_pointer) return int;
++ pragma Import (C, pthread_key_create, "pthread_key_create");
++
++ ------------------------------------
++ -- Non-portable Pthread Functions --
++ ------------------------------------
++
++ function pthread_set_name_np
++ (thread : pthread_t;
++ name : System.Address) return int;
++ pragma Import (C, pthread_set_name_np, "pthread_set_name_np");
++
++private
++
++ type sigset_t is array (1 .. 4) of unsigned;
++
++ -- In NetBSD the component sa_handler turns out to
++ -- be one a union type, and the selector is a macro:
++ -- #define sa_handler __sigaction_u._handler
++ -- #define sa_sigaction __sigaction_u._sigaction
++
++ -- Should we add a signal_context type here ???
++ -- How could it be done independent of the CPU architecture ???
++ -- sigcontext type is opaque, so it is architecturally neutral.
++ -- It is always passed as an access type, so define it as an empty record
++ -- since the contents are not used anywhere.
++
++ type struct_sigcontext is null record;
++ pragma Convention (C, struct_sigcontext);
++
++ type pid_t is new int;
++
++ type time_t is new int;
++
++ type timespec is record
++ tv_sec : time_t;
++ tv_nsec : long;
++ end record;
++ pragma Convention (C, timespec);
++
++ type clockid_t is new int;
++ CLOCK_REALTIME : constant clockid_t := 0;
++
++ type pthread_t is new System.Address;
++ type pthread_attr_t is record
++ Pta_Magic : unsigned;
++ Pta_Flags : int;
++ Pta_Private : System.Address;
++ end record;
++ pragma Convention (C, pthread_attr_t);
++
++ -- PORT NOTE: The size of pthread_spin_t is defined in
++ -- /src/sys/arch/*/include/types.h
++ type pthread_spin_t is new unsigned_char;
++
++ type pthread_queue_t is record
++ Pthqh_First : pthread_t;
++ Pthqh_Last : System.Address;
++ end record;
++ pragma Convention (C, pthread_queue_t);
++
++ type pthread_mutex_t is record
++ Ptm_Majic : unsigned;
++ Ptm_Lock : pthread_spin_t;
++ Ptm_Interlock : pthread_spin_t;
++ Ptm_Owner : pthread_t;
++ Ptm_Block : pthread_queue_t;
++ Ptm_Private : System.Address;
++ end record;
++ pragma Convention (C, pthread_mutex_t);
++
++ type pthread_mutexattr_t is record
++ Ptma_Majic : unsigned;
++ Ptma_Private : System.Address;
++ end record;
++ pragma Convention (C, pthread_mutexattr_t);
++
++ type pthread_cond_t is record
++ Ptc_Magic : unsigned;
++ Ptc_Lock : pthread_spin_t;
++ Ptc_Waiters : pthread_queue_t;
++ Ptc_Mutex : pthread_mutex_t;
++ Ptc_Private : System.Address;
++ end record;
++ pragma Convention (C, pthread_cond_t);
++
++ type pthread_condattr_t is record
++ Ptca_Magic : unsigned;
++ Ptca_Private : System.Address;
++ end record;
++ pragma Convention (C, pthread_condattr_t);
++
++ type pthread_key_t is new int;
++
++end System.OS_Interface;
+--- /dev/null
++++ gcc/ada/s-osinte-netbsd6.ads
+@@ -0,0 +1,675 @@
++------------------------------------------------------------------------------
++-- --
++-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
++-- --
++-- S Y S T E M . O S _ I N T E R F A C E --
++-- --
++-- S p e c --
++-- --
++-- Copyright (C) 1991-1994, Florida State University --
++-- Copyright (C) 1995-2009, Free Software Foundation, Inc. --
++-- --
++-- GNARL is free software; you can redistribute it and/or modify it under --
++-- terms of the GNU General Public License as published by the Free Soft- --
++-- ware Foundation; either version 2, or (at your option) any later ver- --
++-- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
++-- OUT 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 distributed with GNARL; see file COPYING. If not, write --
++-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
++-- Boston, MA 02110-1301, USA. --
++-- --
++-- As a special exception, if other files instantiate generics from this --
++-- unit, or you link this unit with other files to produce an executable, --
++-- this unit does not by itself cause the resulting executable to be --
++-- covered by the GNU General Public License. This exception does not --
++-- however invalidate any other reasons why the executable file might be --
++-- covered by the GNU Public License. --
++-- --
++-- GNARL was developed by the GNARL team at Florida State University. It is --
++-- now maintained by Ada Core Technologies Inc. in cooperation with Florida --
++-- State University (http://www.gnat.com). --
++-- --
++-- Copyright (C) 2010, 2011 John Marino <www.dragonlace.net> --
++------------------------------------------------------------------------------
++
++-- This is the NetBSD 6+ PTHREADS version of this package.
++-- It is based off of the FreeBSD PTHREADS as of 4.2.3.
++
++-- This package encapsulates all direct interfaces to OS services
++-- that are needed by the tasking run-time (libgnarl).
++
++-- PLEASE DO NOT add any with-clauses to this package or remove the pragma
++-- Preelaborate. This package is designed to be a bottom-level (leaf) package.
++
++with Ada.Unchecked_Conversion;
++
++with Interfaces.C;
++
++package System.OS_Interface is
++ pragma Preelaborate;
++
++ pragma Linker_Options ("-pthread");
++
++ subtype int is Interfaces.C.int;
++ subtype short is Interfaces.C.short;
++ subtype long is Interfaces.C.long;
++ subtype unsigned is Interfaces.C.unsigned;
++ subtype unsigned_short is Interfaces.C.unsigned_short;
++ subtype unsigned_long is Interfaces.C.unsigned_long;
++ subtype unsigned_char is Interfaces.C.unsigned_char;
++ subtype plain_char is Interfaces.C.plain_char;
++ subtype size_t is Interfaces.C.size_t;
++ subtype int64_t is Interfaces.Integer_64;
++
++ -----------
++ -- Errno --
++ -----------
++
++ function Errno return int;
++ pragma Inline (Errno);
++
++ EAGAIN : constant := 35;
++ EINTR : constant := 4;
++ EINVAL : constant := 22;
++ ENOMEM : constant := 12;
++ ETIMEDOUT : constant := 60;
++
++ -------------
++ -- Signals --
++ -------------
++
++ Max_Interrupt : constant := 63;
++ type Signal is new int range 0 .. Max_Interrupt;
++ for Signal'Size use int'Size;
++
++ SIGHUP : constant := 1; -- hangup
++ SIGINT : constant := 2; -- interrupt (rubout)
++ SIGQUIT : constant := 3; -- quit (ASCD FS)
++ SIGILL : constant := 4; -- illegal instruction (not reset)
++ SIGTRAP : constant := 5; -- trace trap (not reset)
++ SIGIOT : constant := 6; -- IOT instruction
++ SIGABRT : constant := 6; -- used by abort, replace SIGIOT in the future
++ SIGEMT : constant := 7; -- EMT instruction
++ SIGFPE : constant := 8; -- floating point exception
++ SIGKILL : constant := 9; -- kill (cannot be caught or ignored)
++ SIGBUS : constant := 10; -- bus error
++ SIGSEGV : constant := 11; -- segmentation violation
++ SIGSYS : constant := 12; -- bad argument to system call
++ SIGPIPE : constant := 13; -- write on a pipe with no one to read it
++ SIGALRM : constant := 14; -- alarm clock
++ SIGTERM : constant := 15; -- software termination signal from kill
++ SIGURG : constant := 16; -- urgent condition on IO channel
++ SIGSTOP : constant := 17; -- stop (cannot be caught or ignored)
++ SIGTSTP : constant := 18; -- user stop requested from tty
++ SIGCONT : constant := 19; -- stopped process has been continued
++ SIGCLD : constant := 20; -- alias for SIGCHLD
++ SIGCHLD : constant := 20; -- child status change
++ SIGTTIN : constant := 21; -- background tty read attempted
++ SIGTTOU : constant := 22; -- background tty write attempted
++ SIGIO : constant := 23; -- I/O possible (Solaris SIGPOLL alias)
++ SIGXCPU : constant := 24; -- CPU time limit exceeded
++ SIGXFSZ : constant := 25; -- filesize limit exceeded
++ SIGVTALRM : constant := 26; -- virtual timer expired
++ SIGPROF : constant := 27; -- profiling timer expired
++ SIGWINCH : constant := 28; -- window size change
++ SIGINFO : constant := 29; -- information request (BSD)
++ SIGUSR1 : constant := 30; -- user defined signal 1
++ SIGUSR2 : constant := 31; -- user defined signal 2
++ SIGPWR : constant := 32; -- power fail/restart (not reset when caught)
++
++ SIGADAABORT : constant := SIGABRT;
++ -- Change this if you want to use another signal for task abort.
++ -- SIGTERM might be a good one.
++
++ type Signal_Set is array (Natural range <>) of Signal;
++
++ -- Interrupts that must be unmasked at all times. NetBSD
++ -- pthreads will not allow an application to mask out any
++ -- interrupt needed by the threads library.
++ Unmasked : constant Signal_Set :=
++ (SIGTRAP, SIGBUS, SIGTTIN, SIGTTOU, SIGTSTP);
++
++ -- NetBSD will uses SIGPROF for timing. Do not allow a
++ -- handler to attach to this signal.
++ Reserved : constant Signal_Set := (0 .. 0 => SIGPROF);
++
++ type sigset_t is private;
++
++ function sigaddset
++ (set : access sigset_t;
++ sig : Signal) return int;
++ pragma Import (C, sigaddset, "__sigaddset14");
++
++ function sigdelset
++ (set : access sigset_t;
++ sig : Signal) return int;
++ pragma Import (C, sigdelset, "__sigdelset14");
++
++ function sigfillset (set : access sigset_t) return int;
++ pragma Import (C, sigfillset, "__sigfillset14");
++
++ function sigismember
++ (set : access sigset_t;
++ sig : Signal) return int;
++ pragma Import (C, sigismember, "__sigismember14");
++
++ function sigemptyset (set : access sigset_t) return int;
++ pragma Import (C, sigemptyset, "__sigemptyset14");
++
++ -- sigcontext is architecture dependent, so define it private
++ type struct_sigcontext is private;
++
++ type old_struct_sigaction is record
++ sa_handler : System.Address;
++ sa_mask : sigset_t;
++ sa_flags : int;
++ end record;
++ pragma Convention (C, old_struct_sigaction);
++
++ type new_struct_sigaction is record
++ sa_handler : System.Address;
++ sa_flags : int;
++ sa_mask : sigset_t;
++ end record;
++ pragma Convention (C, new_struct_sigaction);
++
++ subtype struct_sigaction is new_struct_sigaction;
++ type struct_sigaction_ptr is access all struct_sigaction;
++
++ SIG_BLOCK : constant := 1;
++ SIG_UNBLOCK : constant := 2;
++ SIG_SETMASK : constant := 3;
++
++ SIG_DFL : constant := 0;
++ SIG_IGN : constant := 1;
++ SIG_ERR : constant := -1;
++ SIG_HOLD : constant := 3;
++
++ SA_SIGINFO : constant := 16#0040#;
++ SA_ONSTACK : constant := 16#0001#;
++
++ function sigaction
++ (sig : Signal;
++ act : struct_sigaction_ptr;
++ oact : struct_sigaction_ptr) return int;
++ pragma Import (C, sigaction, "__sigaction14");
++
++ ----------
++ -- Time --
++ ----------
++
++ Time_Slice_Supported : constant Boolean := True;
++ -- Indicates whether time slicing is supported (i.e SCHED_RR is supported)
++
++ type timespec is private;
++
++ function nanosleep (rqtp, rmtp : access timespec) return int;
++ pragma Import (C, nanosleep, "__nanosleep50");
++
++ type clockid_t is private;
++
++ CLOCK_REALTIME : constant clockid_t;
++
++ function clock_gettime
++ (clock_id : clockid_t;
++ tp : access timespec)
++ return int;
++ pragma Import (C, clock_gettime, "__clock_gettime50");
++
++ function To_Duration (TS : timespec) return Duration;
++ pragma Inline (To_Duration);
++
++ function To_Timespec (D : Duration) return timespec;
++ pragma Inline (To_Timespec);
++
++ type struct_timezone is record
++ tz_minuteswest : int;
++ tz_dsttime : int;
++ end record;
++ pragma Convention (C, struct_timezone);
++
++ -------------------------
++ -- Priority Scheduling --
++ -------------------------
++
++ SCHED_FIFO : constant := 1;
++ SCHED_OTHER : constant := 2;
++ SCHED_RR : constant := 3;
++
++ function To_Target_Priority
++ (Prio : System.Any_Priority) return Interfaces.C.int;
++ -- Maps System.Any_Priority to a POSIX priority
++
++ -------------
++ -- Process --
++ -------------
++
++ type pid_t is private;
++
++ function kill (pid : pid_t; sig : Signal) return int;
++ pragma Import (C, kill, "kill");
++
++ function getpid return pid_t;
++ pragma Import (C, getpid, "getpid");
++
++ ---------
++ -- LWP --
++ ---------
++
++ function lwp_self return System.Address;
++ -- lwp_self does not exist on this thread library, revert to pthread_self
++ -- which is the closest approximation (with getpid). This function is
++ -- needed to share 7staprop.adb across POSIX-like targets.
++ pragma Import (C, lwp_self, "pthread_self");
++
++ -------------
++ -- Threads --
++ -------------
++
++ type Thread_Body is access
++ function (arg : System.Address) return System.Address;
++ pragma Convention (C, Thread_Body);
++
++ function Thread_Body_Access is new
++ Ada.Unchecked_Conversion (System.Address, Thread_Body);
++
++ type pthread_t is private;
++ subtype Thread_Id is pthread_t;
++
++ type pthread_mutex_t is limited private;
++ type pthread_cond_t is limited private;
++ type pthread_attr_t is limited private;
++ type pthread_mutexattr_t is limited private;
++ type pthread_condattr_t is limited private;
++ type pthread_key_t is private;
++
++ PTHREAD_CREATE_DETACHED : constant := 1;
++ PTHREAD_CREATE_JOINABLE : constant := 0;
++
++ PTHREAD_SCOPE_PROCESS : constant := 0;
++ PTHREAD_SCOPE_SYSTEM : constant := 2;
++
++ -----------
++ -- Stack --
++ -----------
++
++ type stack_t is record
++ ss_sp : System.Address;
++ ss_size : size_t;
++ ss_flags : int;
++ end record;
++ pragma Convention (C, stack_t);
++
++ function sigaltstack
++ (ss : not null access stack_t;
++ oss : access stack_t) return int;
++ pragma Import (C, sigaltstack, "sigaltstack");
++
++ Alternate_Stack : aliased System.Address;
++ -- This is a dummy definition, never used (Alternate_Stack_Size is null)
++
++ Alternate_Stack_Size : constant := 0;
++ -- No alternate signal stack is used on this platform
++
++ Stack_Base_Available : constant Boolean := False;
++ -- Indicates whether the stack base is available on this target. This
++ -- allows us to share s-osinte.adb between all the FSU run time. Note that
++ -- this value can only be true if pthread_t has a complete definition that
++ -- corresponds exactly to the C header files.
++
++ function Get_Stack_Base (thread : pthread_t) return Address;
++ pragma Inline (Get_Stack_Base);
++ -- returns the stack base of the specified thread. Only call this function
++ -- when Stack_Base_Available is True.
++
++ function Get_Page_Size return size_t;
++ function Get_Page_Size return Address;
++ pragma Import (C, Get_Page_Size, "getpagesize");
++ -- Returns the size of a page
++
++ PROT_NONE : constant := 0;
++ PROT_READ : constant := 1;
++ PROT_WRITE : constant := 2;
++ PROT_EXEC : constant := 4;
++ PROT_ALL : constant := PROT_READ + PROT_WRITE + PROT_EXEC;
++ PROT_ON : constant := PROT_NONE;
++ PROT_OFF : constant := PROT_ALL;
++
++ function mprotect (addr : Address; len : size_t; prot : int) return int;
++ pragma Import (C, mprotect);
++
++ ---------------------------------------
++ -- Nonstandard Thread Initialization --
++ ---------------------------------------
++
++ -- FSU_THREADS requires pthread_init, which is nonstandard and this should
++ -- be invoked during the elaboration of s-taprop.adb.
++
++ -- NetBSD does not require this so we provide an empty Ada body
++
++ procedure pthread_init;
++
++ -------------------------
++ -- POSIX.1c Section 3 --
++ -------------------------
++
++ function sigwait
++ (set : access sigset_t;
++ sig : access Signal) return int;
++ pragma Import (C, sigwait, "sigwait");
++
++ function pthread_kill
++ (thread : pthread_t;
++ sig : Signal) return int;
++ pragma Import (C, pthread_kill, "pthread_kill");
++
++ function pthread_sigmask
++ (how : int;
++ set : access sigset_t;
++ oset : access sigset_t) return int;
++ pragma Import (C, pthread_sigmask, "pthread_sigmask");
++
++ --------------------------
++ -- POSIX.1c Section 11 --
++ --------------------------
++
++ function pthread_mutexattr_init
++ (attr : access pthread_mutexattr_t) return int;
++ pragma Import (C, pthread_mutexattr_init, "pthread_mutexattr_init");
++
++ function pthread_mutexattr_destroy
++ (attr : access pthread_mutexattr_t) return int;
++ pragma Import (C, pthread_mutexattr_destroy, "pthread_mutexattr_destroy");
++
++ function pthread_mutex_init
++ (mutex : access pthread_mutex_t;
++ attr : access pthread_mutexattr_t) return int;
++ pragma Import (C, pthread_mutex_init, "pthread_mutex_init");
++
++ function pthread_mutex_destroy (mutex : access pthread_mutex_t) return int;
++ pragma Import (C, pthread_mutex_destroy, "pthread_mutex_destroy");
++
++ function pthread_mutex_lock (mutex : access pthread_mutex_t) return int;
++ pragma Import (C, pthread_mutex_lock, "pthread_mutex_lock");
++
++ function pthread_mutex_unlock (mutex : access pthread_mutex_t) return int;
++ pragma Import (C, pthread_mutex_unlock, "pthread_mutex_unlock");
++
++ function pthread_condattr_init
++ (attr : access pthread_condattr_t) return int;
++ pragma Import (C, pthread_condattr_init, "pthread_condattr_init");
++
++ function pthread_condattr_destroy
++ (attr : access pthread_condattr_t) return int;
++ pragma Import (C, pthread_condattr_destroy, "pthread_condattr_destroy");
++
++ function pthread_cond_init
++ (cond : access pthread_cond_t;
++ attr : access pthread_condattr_t) return int;
++ pragma Import (C, pthread_cond_init, "pthread_cond_init");
++
++ function pthread_cond_destroy (cond : access pthread_cond_t) return int;
++ pragma Import (C, pthread_cond_destroy, "pthread_cond_destroy");
++
++ function pthread_cond_signal (cond : access pthread_cond_t) return int;
++ pragma Import (C, pthread_cond_signal, "pthread_cond_signal");
++
++ function pthread_cond_wait
++ (cond : access pthread_cond_t;
++ mutex : access pthread_mutex_t) return int;
++ pragma Import (C, pthread_cond_wait, "pthread_cond_wait");
++
++ function pthread_cond_timedwait
++ (cond : access pthread_cond_t;
++ mutex : access pthread_mutex_t;
++ abstime : access timespec) return int;
++ pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait");
++
++ Relative_Timed_Wait : constant Boolean := False;
++ -- pthread_cond_timedwait requires an absolute delay time
++
++ --------------------------
++ -- POSIX.1c Section 13 --
++ --------------------------
++
++ PTHREAD_PRIO_NONE : constant := 0;
++ PTHREAD_PRIO_PROTECT : constant := 2;
++ PTHREAD_PRIO_INHERIT : constant := 1;
++
++ function pthread_mutexattr_setprotocol
++ (attr : access pthread_mutexattr_t;
++ protocol : int) return int;
++
++ function pthread_mutexattr_setprioceiling
++ (attr : access pthread_mutexattr_t;
++ prioceiling : int) return int;
++
++ type struct_sched_param is record
++ sched_priority : int;
++ end record;
++ pragma Convention (C, struct_sched_param);
++
++ function pthread_getschedparam
++ (thread : pthread_t;
++ policy : access int;
++ param : access struct_sched_param) return int;
++ pragma Import (C, pthread_getschedparam, "pthread_getschedparam");
++
++ function pthread_setschedparam
++ (thread : pthread_t;
++ policy : int;
++ param : access struct_sched_param) return int;
++ pragma Import (C, pthread_setschedparam, "pthread_setschedparam");
++
++ function pthread_attr_setscope
++ (attr : access pthread_attr_t;
++ contentionscope : int) return int;
++ pragma Import (C, pthread_attr_setscope, "pthread_attr_setscope");
++
++ function pthread_attr_getscope
++ (attr : access pthread_attr_t;
++ contentionscope : access int) return int;
++ pragma Import (C, pthread_attr_getscope, "pthread_attr_getscope");
++
++ function pthread_attr_setinheritsched
++ (attr : access pthread_attr_t;
++ inheritsched : int) return int;
++ pragma Import
++ (C, pthread_attr_setinheritsched, "pthread_attr_setinheritsched");
++
++ function pthread_attr_getinheritsched
++ (attr : access pthread_attr_t;
++ inheritsched : access int) return int;
++ pragma Import
++ (C, pthread_attr_getinheritsched, "pthread_attr_getinheritsched");
++
++ function pthread_attr_setschedpolicy
++ (attr : access pthread_attr_t;
++ policy : int) return int;
++ pragma Import (C, pthread_attr_setschedpolicy,
++ "pthread_attr_setschedpolicy");
++
++ function pthread_attr_getschedpolicy
++ (attr : access pthread_attr_t;
++ policy : access int) return int;
++ pragma Import (C, pthread_attr_getschedpolicy,
++ "pthread_attr_getschedpolicy");
++
++ function pthread_attr_setschedparam
++ (attr : access pthread_attr_t;
++ sched_param : int) return int;
++ pragma Import (C, pthread_attr_setschedparam, "pthread_attr_setschedparam");
++
++ function pthread_attr_getschedparam
++ (attr : access pthread_attr_t;
++ sched_param : access int) return int;
++ pragma Import (C, pthread_attr_getschedparam, "pthread_attr_getschedparam");
++
++ function sched_yield return int;
++ pragma Import (C, sched_yield, "sched_yield");
++
++ --------------------------
++ -- P1003.1c Section 16 --
++ --------------------------
++
++ function pthread_attr_init (attributes : access pthread_attr_t) return int;
++ pragma Import (C, pthread_attr_init, "pthread_attr_init");
++
++ function pthread_attr_destroy
++ (attributes : access pthread_attr_t) return int;
++ pragma Import (C, pthread_attr_destroy, "pthread_attr_destroy");
++
++ function pthread_attr_setdetachstate
++ (attr : access pthread_attr_t;
++ detachstate : int) return int;
++ pragma Import
++ (C, pthread_attr_setdetachstate, "pthread_attr_setdetachstate");
++
++ function pthread_attr_getdetachstate
++ (attr : access pthread_attr_t;
++ detachstate : access int) return int;
++ pragma Import
++ (C, pthread_attr_getdetachstate, "pthread_attr_getdetachstate");
++
++ function pthread_attr_getstacksize
++ (attr : access pthread_attr_t;
++ stacksize : access size_t) return int;
++ pragma Import
++ (C, pthread_attr_getstacksize, "pthread_attr_getstacksize");
++
++ function pthread_attr_setstacksize
++ (attr : access pthread_attr_t;
++ stacksize : size_t) return int;
++ pragma Import
++ (C, pthread_attr_setstacksize, "pthread_attr_setstacksize");
++
++ function pthread_create
++ (thread : access pthread_t;
++ attributes : access pthread_attr_t;
++ start_routine : Thread_Body;
++ arg : System.Address) return int;
++ pragma Import (C, pthread_create, "pthread_create");
++
++ function pthread_detach (thread : pthread_t) return int;
++ pragma Import (C, pthread_detach, "pthread_detach");
++
++ procedure pthread_exit (status : System.Address);
++ pragma Import (C, pthread_exit, "pthread_exit");
++
++ function pthread_self return pthread_t;
++ pragma Import (C, pthread_self, "pthread_self");
++
++ --------------------------
++ -- POSIX.1c Section 17 --
++ --------------------------
++
++ function pthread_setspecific
++ (key : pthread_key_t;
++ value : System.Address) return int;
++ pragma Import (C, pthread_setspecific, "pthread_setspecific");
++
++ function pthread_getspecific (key : pthread_key_t) return System.Address;
++ pragma Import (C, pthread_getspecific, "pthread_getspecific");
++
++ type destructor_pointer is access procedure (arg : System.Address);
++ pragma Convention (C, destructor_pointer);
++
++ function pthread_key_create
++ (key : access pthread_key_t;
++ destructor : destructor_pointer) return int;
++ pragma Import (C, pthread_key_create, "pthread_key_create");
++
++ ------------------------------------
++ -- Non-portable Pthread Functions --
++ ------------------------------------
++
++ function pthread_set_name_np
++ (thread : pthread_t;
++ name : System.Address) return int;
++ pragma Import (C, pthread_set_name_np, "pthread_set_name_np");
++
++private
++
++ type sigset_t is array (1 .. 4) of unsigned;
++
++ -- In NetBSD the component sa_handler turns out to
++ -- be one a union type, and the selector is a macro:
++ -- #define sa_handler __sigaction_u._handler
++ -- #define sa_sigaction __sigaction_u._sigaction
++
++ -- Should we add a signal_context type here ???
++ -- How could it be done independent of the CPU architecture ???
++ -- sigcontext type is opaque, so it is architecturally neutral.
++ -- It is always passed as an access type, so define it as an empty record
++ -- since the contents are not used anywhere.
++
++ type struct_sigcontext is null record;
++ pragma Convention (C, struct_sigcontext);
++
++ type pid_t is new int;
++
++ type time_t is new int64_t;
++
++ type timespec is record
++ tv_sec : time_t;
++ tv_nsec : long;
++ end record;
++ pragma Convention (C, timespec);
++
++ type clockid_t is new int;
++ CLOCK_REALTIME : constant clockid_t := 0;
++
++ type pthread_t is new System.Address;
++ type pthread_attr_t is record
++ Pta_Magic : unsigned;
++ Pta_Flags : int;
++ Pta_Private : System.Address;
++ end record;
++ pragma Convention (C, pthread_attr_t);
++
++ -- PORT NOTE: The size of pthread_spin_t is defined in
++ -- /src/sys/arch/*/include/types.h
++ type pthread_spin_t is new unsigned_char;
++
++ type pthread_queue_t is record
++ Pthqh_First : pthread_t;
++ Pthqh_Last : System.Address;
++ end record;
++ pragma Convention (C, pthread_queue_t);
++
++ type pthread_mutex_t is record
++ Ptm_Majic : unsigned;
++ Ptm_Lock : pthread_spin_t;
++ Ptm_Interlock : pthread_spin_t;
++ Ptm_Owner : pthread_t;
++ Ptm_Block : pthread_queue_t;
++ Ptm_Private : System.Address;
++ end record;
++ pragma Convention (C, pthread_mutex_t);
++
++ type pthread_mutexattr_t is record
++ Ptma_Majic : unsigned;
++ Ptma_Private : System.Address;
++ end record;
++ pragma Convention (C, pthread_mutexattr_t);
++
++ type pthread_cond_t is record
++ Ptc_Magic : unsigned;
++ Ptc_Lock : pthread_spin_t;
++ Ptc_Waiters : pthread_queue_t;
++ Ptc_Mutex : pthread_mutex_t;
++ Ptc_Private : System.Address;
++ end record;
++ pragma Convention (C, pthread_cond_t);
++
++ type pthread_condattr_t is record
++ Ptca_Magic : unsigned;
++ Ptca_Private : System.Address;
++ end record;
++ pragma Convention (C, pthread_condattr_t);
++
++ type pthread_key_t is new int;
++
++end System.OS_Interface;
+--- /dev/null
++++ gcc/ada/s-osinte-openbsd.adb
+@@ -0,0 +1,117 @@
++------------------------------------------------------------------------------
++-- --
++-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
++-- --
++-- S Y S T E M . O S _ I N T E R F A C E --
++-- --
++-- B o d y --
++-- --
++-- Copyright (C) 1991-2009, Free Software Foundation, Inc. --
++-- --
++-- GNARL is free software; you can redistribute it and/or modify it under --
++-- terms of the GNU General Public License as published by the Free Soft- --
++-- ware Foundation; either version 3, or (at your option) any later ver- --
++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
++-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
++-- or FITNESS FOR A PARTICULAR PURPOSE. --
++-- --
++-- As a special exception under Section 7 of GPL version 3, you are granted --
++-- additional permissions described in the GCC Runtime Library Exception, --
++-- version 3.1, as published by the Free Software Foundation. --
++-- --
++-- You should have received a copy of the GNU General Public License and --
++-- a copy of the GCC Runtime Library Exception along with this program; --
++-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
++-- <http://www.gnu.org/licenses/>. --
++-- --
++-- GNARL was developed by the GNARL team at Florida State University. It is --
++-- now maintained by Ada Core Technologies Inc. in cooperation with Florida --
++-- State University (http://www.gnat.com). --
++-- --
++-- Copyright (C) 2010 John Marino <draco@marino.st> --
++------------------------------------------------------------------------------
++
++-- This is the OpenBSD THREADS version of this package
++
++with Interfaces.C; use Interfaces.C;
++
++package body System.OS_Interface is
++
++ -----------
++ -- Errno --
++ -----------
++
++ function Errno return int is
++ type int_ptr is access all int;
++
++ function internal_errno return int_ptr;
++ pragma Import (C, internal_errno, "__errno");
++
++ begin
++ return (internal_errno.all);
++ end Errno;
++
++ --------------------
++ -- Get_Stack_Base --
++ --------------------
++
++ function Get_Stack_Base (thread : pthread_t) return Address is
++ pragma Unreferenced (thread);
++ begin
++ return Null_Address;
++ end Get_Stack_Base;
++
++ ------------------
++ -- pthread_init --
++ ------------------
++
++ procedure pthread_init is
++ begin
++ null;
++ end pthread_init;
++
++ -----------------
++ -- To_Duration --
++ -----------------
++
++ function To_Duration (TS : timespec) return Duration is
++ begin
++ return Duration (TS.tv_sec) + Duration (TS.tv_nsec) / 10#1#E9;
++ end To_Duration;
++
++ ------------------------
++ -- To_Target_Priority --
++ ------------------------
++
++ function To_Target_Priority
++ (Prio : System.Any_Priority) return Interfaces.C.int
++ is
++ begin
++ return Interfaces.C.int (Prio);
++ end To_Target_Priority;
++
++ -----------------
++ -- To_Timespec --
++ -----------------
++
++ function To_Timespec (D : Duration) return timespec is
++ S : time_t;
++ F : Duration;
++
++ begin
++ S := time_t (Long_Long_Integer (D));
++ F := D - Duration (S);
++
++ -- If F has negative value due to a round-up, adjust for positive F
++ -- value.
++
++ if F < 0.0 then
++ S := S - 1;
++ F := F + 1.0;
++ end if;
++
++ return timespec'(tv_sec => S,
++ tv_nsec => long (Long_Long_Integer (F * 10#1#E9)));
++ end To_Timespec;
++
++end System.OS_Interface;
+--- /dev/null
++++ gcc/ada/s-osinte-openbsd.ads
+@@ -0,0 +1,648 @@
++------------------------------------------------------------------------------
++-- --
++-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
++-- --
++-- S Y S T E M . O S _ I N T E R F A C E --
++-- --
++-- S p e c --
++-- --
++-- Copyright (C) 1991-1994, Florida State University --
++-- Copyright (C) 1995-2009, Free Software Foundation, Inc. --
++-- --
++-- GNARL is free software; you can redistribute it and/or modify it under --
++-- terms of the GNU General Public License as published by the Free Soft- --
++-- ware Foundation; either version 2, or (at your option) any later ver- --
++-- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
++-- OUT 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 distributed with GNARL; see file COPYING. If not, write --
++-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
++-- Boston, MA 02110-1301, USA. --
++-- --
++-- As a special exception, if other files instantiate generics from this --
++-- unit, or you link this unit with other files to produce an executable, --
++-- this unit does not by itself cause the resulting executable to be --
++-- covered by the GNU General Public License. This exception does not --
++-- however invalidate any other reasons why the executable file might be --
++-- covered by the GNU Public License. --
++-- --
++-- GNARL was developed by the GNARL team at Florida State University. It is --
++-- now maintained by Ada Core Technologies Inc. in cooperation with Florida --
++-- State University (http://www.gnat.com). --
++-- --
++-- Copyright (C) 2010 John Marino <draco@marino.st> --
++------------------------------------------------------------------------------
++
++-- This is the OpenBSD PTHREADS version of this package
++
++-- This package encapsulates all direct interfaces to OS services
++-- that are needed by the tasking run-time (libgnarl).
++
++-- PLEASE DO NOT add any with-clauses to this package or remove the pragma
++-- Preelaborate. This package is designed to be a bottom-level (leaf) package.
++
++with Ada.Unchecked_Conversion;
++
++with Interfaces.C;
++
++package System.OS_Interface is
++ pragma Preelaborate;
++
++ pragma Linker_Options ("-pthread");
++
++ subtype int is Interfaces.C.int;
++ subtype short is Interfaces.C.short;
++ subtype long is Interfaces.C.long;
++ subtype unsigned is Interfaces.C.unsigned;
++ subtype unsigned_short is Interfaces.C.unsigned_short;
++ subtype unsigned_long is Interfaces.C.unsigned_long;
++ subtype unsigned_char is Interfaces.C.unsigned_char;
++ subtype plain_char is Interfaces.C.plain_char;
++ subtype size_t is Interfaces.C.size_t;
++
++ -----------
++ -- Errno --
++ -----------
++
++ function Errno return int;
++ pragma Inline (Errno);
++
++ EAGAIN : constant := 35;
++ EINTR : constant := 4;
++ EINVAL : constant := 22;
++ ENOMEM : constant := 12;
++ ETIMEDOUT : constant := 60;
++
++ -------------
++ -- Signals --
++ -------------
++
++ Max_Interrupt : constant := 31;
++ type Signal is new int range 0 .. Max_Interrupt;
++ for Signal'Size use int'Size;
++
++ SIGHUP : constant := 1; -- hangup
++ SIGINT : constant := 2; -- interrupt (rubout)
++ SIGQUIT : constant := 3; -- quit (ASCD FS)
++ SIGILL : constant := 4; -- illegal instruction (not reset)
++ SIGTRAP : constant := 5; -- trace trap (not reset)
++ SIGIOT : constant := 6; -- IOT instruction
++ SIGABRT : constant := 6; -- used by abort, replace SIGIOT in the future
++ SIGEMT : constant := 7; -- EMT instruction
++ SIGFPE : constant := 8; -- floating point exception
++ SIGKILL : constant := 9; -- kill (cannot be caught or ignored)
++ SIGBUS : constant := 10; -- bus error
++ SIGSEGV : constant := 11; -- segmentation violation
++ SIGSYS : constant := 12; -- bad argument to system call
++ SIGPIPE : constant := 13; -- write on a pipe with no one to read it
++ SIGALRM : constant := 14; -- alarm clock
++ SIGTERM : constant := 15; -- software termination signal from kill
++ SIGURG : constant := 16; -- urgent condition on IO channel
++ SIGSTOP : constant := 17; -- stop (cannot be caught or ignored)
++ SIGTSTP : constant := 18; -- user stop requested from tty
++ SIGCONT : constant := 19; -- stopped process has been continued
++ SIGCLD : constant := 20; -- alias for SIGCHLD
++ SIGCHLD : constant := 20; -- child status change
++ SIGTTIN : constant := 21; -- background tty read attempted
++ SIGTTOU : constant := 22; -- background tty write attempted
++ SIGIO : constant := 23; -- I/O possible (Solaris SIGPOLL alias)
++ SIGXCPU : constant := 24; -- CPU time limit exceeded
++ SIGXFSZ : constant := 25; -- filesize limit exceeded
++ SIGVTALRM : constant := 26; -- virtual timer expired
++ SIGPROF : constant := 27; -- profiling timer expired
++ SIGWINCH : constant := 28; -- window size change
++ SIGINFO : constant := 29; -- information request (BSD)
++ SIGUSR1 : constant := 30; -- user defined signal 1
++ SIGUSR2 : constant := 31; -- user defined signal 2
++
++ SIGADAABORT : constant := SIGABRT;
++ -- Change this if you want to use another signal for task abort.
++ -- SIGTERM might be a good one.
++
++ type Signal_Set is array (Natural range <>) of Signal;
++
++ -- Interrupts that must be unmasked at all times. OpenBSD
++ -- pthreads will not allow an application to mask out any
++ -- interrupt needed by the threads library.
++ Unmasked : constant Signal_Set :=
++ (SIGTRAP, SIGBUS, SIGTTIN, SIGTTOU, SIGTSTP);
++
++ -- OpenBSD will uses SIGPROF for timing. Do not allow a
++ -- handler to attach to this signal.
++ Reserved : constant Signal_Set := (0 .. 0 => SIGPROF);
++
++ type sigset_t is private;
++
++ function sigaddset
++ (set : access sigset_t;
++ sig : Signal) return int;
++ pragma Import (C, sigaddset, "sigaddset");
++
++ function sigdelset
++ (set : access sigset_t;
++ sig : Signal) return int;
++ pragma Import (C, sigdelset, "sigdelset");
++
++ function sigfillset (set : access sigset_t) return int;
++ pragma Import (C, sigfillset, "sigfillset");
++
++ function sigismember
++ (set : access sigset_t;
++ sig : Signal) return int;
++ pragma Import (C, sigismember, "sigismember");
++
++ function sigemptyset (set : access sigset_t) return int;
++ pragma Import (C, sigemptyset, "sigemptyset");
++
++ -- sigcontext is architecture dependent, so define it private
++ type struct_sigcontext is private;
++
++ type old_struct_sigaction is record
++ sa_handler : System.Address;
++ sa_mask : sigset_t;
++ sa_flags : int;
++ end record;
++ pragma Convention (C, old_struct_sigaction);
++
++ type new_struct_sigaction is record
++ sa_handler : System.Address;
++ sa_flags : int;
++ sa_mask : sigset_t;
++ end record;
++ pragma Convention (C, new_struct_sigaction);
++
++ subtype struct_sigaction is new_struct_sigaction;
++ type struct_sigaction_ptr is access all struct_sigaction;
++
++ SIG_BLOCK : constant := 1;
++ SIG_UNBLOCK : constant := 2;
++ SIG_SETMASK : constant := 3;
++
++ SIG_DFL : constant := 0;
++ SIG_IGN : constant := 1;
++
++ SA_SIGINFO : constant := 16#0040#;
++ SA_ONSTACK : constant := 16#0001#;
++
++ function sigaction
++ (sig : Signal;
++ act : struct_sigaction_ptr;
++ oact : struct_sigaction_ptr) return int;
++ pragma Import (C, sigaction, "sigaction");
++
++ ----------
++ -- Time --
++ ----------
++
++ Time_Slice_Supported : constant Boolean := True;
++ -- Indicates whether time slicing is supported (i.e SCHED_RR is supported)
++
++ type timespec is private;
++
++ function nanosleep (rqtp, rmtp : access timespec) return int;
++ pragma Import (C, nanosleep, "nanosleep");
++
++ type clockid_t is private;
++
++ CLOCK_REALTIME : constant clockid_t;
++
++ function clock_gettime
++ (clock_id : clockid_t;
++ tp : access timespec)
++ return int;
++ pragma Import (C, clock_gettime, "clock_gettime");
++
++ function To_Duration (TS : timespec) return Duration;
++ pragma Inline (To_Duration);
++
++ function To_Timespec (D : Duration) return timespec;
++ pragma Inline (To_Timespec);
++
++ type struct_timezone is record
++ tz_minuteswest : int;
++ tz_dsttime : int;
++ end record;
++ pragma Convention (C, struct_timezone);
++
++ procedure usleep (useconds : unsigned_long);
++ pragma Import (C, usleep, "usleep");
++
++ -------------------------
++ -- Priority Scheduling --
++ -------------------------
++
++ SCHED_FIFO : constant := 1;
++ SCHED_OTHER : constant := 2;
++ SCHED_RR : constant := 3;
++
++ function To_Target_Priority
++ (Prio : System.Any_Priority) return Interfaces.C.int;
++ -- Maps System.Any_Priority to a POSIX priority
++
++ -------------
++ -- Process --
++ -------------
++
++ type pid_t is private;
++
++ function kill (pid : pid_t; sig : Signal) return int;
++ pragma Import (C, kill, "kill");
++
++ function getpid return pid_t;
++ pragma Import (C, getpid, "getpid");
++
++ ---------
++ -- LWP --
++ ---------
++
++ function lwp_self return System.Address;
++ -- lwp_self does not exist on this thread library, revert to pthread_self
++ -- which is the closest approximation (with getpid). This function is
++ -- needed to share 7staprop.adb across POSIX-like targets.
++ pragma Import (C, lwp_self, "pthread_self");
++
++ -------------
++ -- Threads --
++ -------------
++
++ type Thread_Body is access
++ function (arg : System.Address) return System.Address;
++ pragma Convention (C, Thread_Body);
++
++ function Thread_Body_Access is new
++ Ada.Unchecked_Conversion (System.Address, Thread_Body);
++
++ type pthread_t is private;
++ subtype Thread_Id is pthread_t;
++
++ type pthread_mutex_t is limited private;
++ type pthread_cond_t is limited private;
++ type pthread_attr_t is limited private;
++ type pthread_mutexattr_t is limited private;
++ type pthread_condattr_t is limited private;
++ type pthread_key_t is private;
++
++ PTHREAD_CREATE_DETACHED : constant := 1;
++ PTHREAD_CREATE_JOINABLE : constant := 0;
++
++ PTHREAD_SCOPE_PROCESS : constant := 0;
++ PTHREAD_SCOPE_SYSTEM : constant := 2;
++
++ -----------
++ -- Stack --
++ -----------
++
++ type stack_t is record
++ ss_sp : System.Address;
++ ss_size : size_t;
++ ss_flags : int;
++ end record;
++ pragma Convention (C, stack_t);
++
++ function sigaltstack
++ (ss : not null access stack_t;
++ oss : access stack_t) return int;
++ pragma Import (C, sigaltstack, "sigaltstack");
++
++ Alternate_Stack : aliased System.Address;
++ -- This is a dummy definition, never used (Alternate_Stack_Size is null)
++
++ Alternate_Stack_Size : constant := 0;
++ -- No alternate signal stack is used on this platform
++
++ Stack_Base_Available : constant Boolean := False;
++ -- Indicates whether the stack base is available on this target. This
++ -- allows us to share s-osinte.adb between all the FSU run time. Note that
++ -- this value can only be true if pthread_t has a complete definition that
++ -- corresponds exactly to the C header files.
++
++ function Get_Stack_Base (thread : pthread_t) return Address;
++ pragma Inline (Get_Stack_Base);
++ -- returns the stack base of the specified thread. Only call this function
++ -- when Stack_Base_Available is True.
++
++ function Get_Page_Size return size_t;
++ function Get_Page_Size return Address;
++ pragma Import (C, Get_Page_Size, "getpagesize");
++ -- Returns the size of a page
++
++ PROT_NONE : constant := 0;
++ PROT_READ : constant := 1;
++ PROT_WRITE : constant := 2;
++ PROT_EXEC : constant := 4;
++ PROT_ALL : constant := PROT_READ + PROT_WRITE + PROT_EXEC;
++ PROT_ON : constant := PROT_NONE;
++ PROT_OFF : constant := PROT_ALL;
++
++ function mprotect (addr : Address; len : size_t; prot : int) return int;
++ pragma Import (C, mprotect);
++
++ ---------------------------------------
++ -- Nonstandard Thread Initialization --
++ ---------------------------------------
++
++ -- FSU_THREADS requires pthread_init, which is nonstandard and this should
++ -- be invoked during the elaboration of s-taprop.adb.
++
++ -- OpenBSD does not require this so we provide an empty Ada body
++
++ procedure pthread_init;
++
++ -------------------------
++ -- POSIX.1c Section 3 --
++ -------------------------
++
++ function sigwait
++ (set : access sigset_t;
++ sig : access Signal) return int;
++ pragma Import (C, sigwait, "sigwait");
++
++ function pthread_kill
++ (thread : pthread_t;
++ sig : Signal) return int;
++ pragma Import (C, pthread_kill, "pthread_kill");
++
++ function pthread_sigmask
++ (how : int;
++ set : access sigset_t;
++ oset : access sigset_t) return int;
++ pragma Import (C, pthread_sigmask, "pthread_sigmask");
++
++ --------------------------
++ -- POSIX.1c Section 11 --
++ --------------------------
++
++ function pthread_mutexattr_init
++ (attr : access pthread_mutexattr_t) return int;
++ pragma Import (C, pthread_mutexattr_init, "pthread_mutexattr_init");
++
++ function pthread_mutexattr_destroy
++ (attr : access pthread_mutexattr_t) return int;
++ pragma Import (C, pthread_mutexattr_destroy, "pthread_mutexattr_destroy");
++
++ function pthread_mutex_init
++ (mutex : access pthread_mutex_t;
++ attr : access pthread_mutexattr_t) return int;
++ pragma Import (C, pthread_mutex_init, "pthread_mutex_init");
++
++ function pthread_mutex_destroy (mutex : access pthread_mutex_t) return int;
++ pragma Import (C, pthread_mutex_destroy, "pthread_mutex_destroy");
++
++ function pthread_mutex_lock (mutex : access pthread_mutex_t) return int;
++ pragma Import (C, pthread_mutex_lock, "pthread_mutex_lock");
++
++ function pthread_mutex_unlock (mutex : access pthread_mutex_t) return int;
++ pragma Import (C, pthread_mutex_unlock, "pthread_mutex_unlock");
++
++ function pthread_condattr_init
++ (attr : access pthread_condattr_t) return int;
++ pragma Import (C, pthread_condattr_init, "pthread_condattr_init");
++
++ function pthread_condattr_destroy
++ (attr : access pthread_condattr_t) return int;
++ pragma Import (C, pthread_condattr_destroy, "pthread_condattr_destroy");
++
++ function pthread_cond_init
++ (cond : access pthread_cond_t;
++ attr : access pthread_condattr_t) return int;
++ pragma Import (C, pthread_cond_init, "pthread_cond_init");
++
++ function pthread_cond_destroy (cond : access pthread_cond_t) return int;
++ pragma Import (C, pthread_cond_destroy, "pthread_cond_destroy");
++
++ function pthread_cond_signal (cond : access pthread_cond_t) return int;
++ pragma Import (C, pthread_cond_signal, "pthread_cond_signal");
++
++ function pthread_cond_wait
++ (cond : access pthread_cond_t;
++ mutex : access pthread_mutex_t) return int;
++ pragma Import (C, pthread_cond_wait, "pthread_cond_wait");
++
++ function pthread_cond_timedwait
++ (cond : access pthread_cond_t;
++ mutex : access pthread_mutex_t;
++ abstime : access timespec) return int;
++ pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait");
++
++ Relative_Timed_Wait : constant Boolean := False;
++ -- pthread_cond_timedwait requires an absolute delay time
++
++ --------------------------
++ -- POSIX.1c Section 13 --
++ --------------------------
++
++ PTHREAD_PRIO_NONE : constant := 0;
++ PTHREAD_PRIO_PROTECT : constant := 2;
++ PTHREAD_PRIO_INHERIT : constant := 1;
++
++ function pthread_mutexattr_setprotocol
++ (attr : access pthread_mutexattr_t;
++ protocol : int) return int;
++ pragma Import
++ (C, pthread_mutexattr_setprotocol, "pthread_mutexattr_setprotocol");
++
++ function pthread_mutexattr_getprotocol
++ (attr : access pthread_mutexattr_t;
++ protocol : access int) return int;
++ pragma Import
++ (C, pthread_mutexattr_getprotocol, "pthread_mutexattr_getprotocol");
++
++ function pthread_mutexattr_setprioceiling
++ (attr : access pthread_mutexattr_t;
++ prioceiling : int) return int;
++ pragma Import
++ (C, pthread_mutexattr_setprioceiling,
++ "pthread_mutexattr_setprioceiling");
++
++ function pthread_mutexattr_getprioceiling
++ (attr : access pthread_mutexattr_t;
++ prioceiling : access int) return int;
++ pragma Import
++ (C, pthread_mutexattr_getprioceiling,
++ "pthread_mutexattr_getprioceiling");
++
++ type struct_sched_param is record
++ sched_priority : int;
++ end record;
++ pragma Convention (C, struct_sched_param);
++
++ function pthread_getschedparam
++ (thread : pthread_t;
++ policy : access int;
++ param : access struct_sched_param) return int;
++ pragma Import (C, pthread_getschedparam, "pthread_getschedparam");
++
++ function pthread_setschedparam
++ (thread : pthread_t;
++ policy : int;
++ param : access struct_sched_param) return int;
++ pragma Import (C, pthread_setschedparam, "pthread_setschedparam");
++
++ function pthread_attr_setscope
++ (attr : access pthread_attr_t;
++ contentionscope : int) return int;
++ pragma Import (C, pthread_attr_setscope, "pthread_attr_setscope");
++
++ function pthread_attr_getscope
++ (attr : access pthread_attr_t;
++ contentionscope : access int) return int;
++ pragma Import (C, pthread_attr_getscope, "pthread_attr_getscope");
++
++ function pthread_attr_setinheritsched
++ (attr : access pthread_attr_t;
++ inheritsched : int) return int;
++ pragma Import
++ (C, pthread_attr_setinheritsched, "pthread_attr_setinheritsched");
++
++ function pthread_attr_getinheritsched
++ (attr : access pthread_attr_t;
++ inheritsched : access int) return int;
++ pragma Import
++ (C, pthread_attr_getinheritsched, "pthread_attr_getinheritsched");
++
++ function pthread_attr_setschedpolicy
++ (attr : access pthread_attr_t;
++ policy : int) return int;
++ pragma Import (C, pthread_attr_setschedpolicy,
++ "pthread_attr_setschedpolicy");
++
++ function pthread_attr_getschedpolicy
++ (attr : access pthread_attr_t;
++ policy : access int) return int;
++ pragma Import (C, pthread_attr_getschedpolicy,
++ "pthread_attr_getschedpolicy");
++
++ function pthread_attr_setschedparam
++ (attr : access pthread_attr_t;
++ sched_param : int) return int;
++ pragma Import (C, pthread_attr_setschedparam, "pthread_attr_setschedparam");
++
++ function pthread_attr_getschedparam
++ (attr : access pthread_attr_t;
++ sched_param : access int) return int;
++ pragma Import (C, pthread_attr_getschedparam, "pthread_attr_getschedparam");
++
++ function sched_yield return int;
++ pragma Import (C, sched_yield, "pthread_yield");
++
++ --------------------------
++ -- P1003.1c Section 16 --
++ --------------------------
++
++ function pthread_attr_init (attributes : access pthread_attr_t) return int;
++ pragma Import (C, pthread_attr_init, "pthread_attr_init");
++
++ function pthread_attr_destroy
++ (attributes : access pthread_attr_t) return int;
++ pragma Import (C, pthread_attr_destroy, "pthread_attr_destroy");
++
++ function pthread_attr_setdetachstate
++ (attr : access pthread_attr_t;
++ detachstate : int) return int;
++ pragma Import
++ (C, pthread_attr_setdetachstate, "pthread_attr_setdetachstate");
++
++ function pthread_attr_getdetachstate
++ (attr : access pthread_attr_t;
++ detachstate : access int) return int;
++ pragma Import
++ (C, pthread_attr_getdetachstate, "pthread_attr_getdetachstate");
++
++ function pthread_attr_getstacksize
++ (attr : access pthread_attr_t;
++ stacksize : access size_t) return int;
++ pragma Import
++ (C, pthread_attr_getstacksize, "pthread_attr_getstacksize");
++
++ function pthread_attr_setstacksize
++ (attr : access pthread_attr_t;
++ stacksize : size_t) return int;
++ pragma Import
++ (C, pthread_attr_setstacksize, "pthread_attr_setstacksize");
++
++ function pthread_create
++ (thread : access pthread_t;
++ attributes : access pthread_attr_t;
++ start_routine : Thread_Body;
++ arg : System.Address) return int;
++ pragma Import (C, pthread_create, "pthread_create");
++
++ function pthread_detach (thread : pthread_t) return int;
++ pragma Import (C, pthread_detach, "pthread_detach");
++
++ procedure pthread_exit (status : System.Address);
++ pragma Import (C, pthread_exit, "pthread_exit");
++
++ function pthread_self return pthread_t;
++ pragma Import (C, pthread_self, "pthread_self");
++
++ --------------------------
++ -- POSIX.1c Section 17 --
++ --------------------------
++
++ function pthread_setspecific
++ (key : pthread_key_t;
++ value : System.Address) return int;
++ pragma Import (C, pthread_setspecific, "pthread_setspecific");
++
++ function pthread_getspecific (key : pthread_key_t) return System.Address;
++ pragma Import (C, pthread_getspecific, "pthread_getspecific");
++
++ type destructor_pointer is access procedure (arg : System.Address);
++ pragma Convention (C, destructor_pointer);
++
++ function pthread_key_create
++ (key : access pthread_key_t;
++ destructor : destructor_pointer) return int;
++ pragma Import (C, pthread_key_create, "pthread_key_create");
++
++ ------------------------------------
++ -- Non-portable Pthread Functions --
++ ------------------------------------
++
++ function pthread_set_name_np
++ (thread : pthread_t;
++ name : System.Address) return int;
++ pragma Import (C, pthread_set_name_np, "pthread_set_name_np");
++
++private
++
++ type sigset_t is array (1 .. 4) of unsigned;
++
++ -- In OpenBSD the component sa_handler turns out to
++ -- be one a union type, and the selector is a macro:
++ -- #define sa_handler __sigaction_u._handler
++ -- #define sa_sigaction __sigaction_u._sigaction
++
++ -- Should we add a signal_context type here ???
++ -- How could it be done independent of the CPU architecture ???
++ -- sigcontext type is opaque, so it is architecturally neutral.
++ -- It is always passed as an access type, so define it as an empty record
++ -- since the contents are not used anywhere.
++
++ type struct_sigcontext is null record;
++ pragma Convention (C, struct_sigcontext);
++
++ type pid_t is new int;
++
++ type time_t is new int;
++
++ type timespec is record
++ tv_sec : time_t;
++ tv_nsec : long;
++ end record;
++ pragma Convention (C, timespec);
++
++ type clockid_t is new int;
++ CLOCK_REALTIME : constant clockid_t := 0;
++
++ type pthread_t is new System.Address;
++ type pthread_attr_t is new System.Address;
++ type pthread_mutex_t is new System.Address;
++ type pthread_mutexattr_t is new System.Address;
++ type pthread_cond_t is new System.Address;
++ type pthread_condattr_t is new System.Address;
++ type pthread_key_t is new int;
++
++end System.OS_Interface;
+--- /dev/null
++++ gcc/ada/s-osprim-bsd32.adb
+@@ -0,0 +1,186 @@
++------------------------------------------------------------------------------
++-- --
++-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
++-- --
++-- S Y S T E M . O S _ P R I M I T I V E S --
++-- --
++-- B o d y --
++-- --
++-- Copyright (C) 1998-2009, Free Software Foundation, Inc. --
++-- --
++-- GNARL is free software; you can redistribute it and/or modify it under --
++-- terms of the GNU General Public License as published by the Free Soft- --
++-- ware Foundation; either version 3, or (at your option) any later ver- --
++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
++-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
++-- or FITNESS FOR A PARTICULAR PURPOSE. --
++-- --
++-- As a special exception under Section 7 of GPL version 3, you are granted --
++-- additional permissions described in the GCC Runtime Library Exception, --
++-- version 3.1, as published by the Free Software Foundation. --
++-- --
++-- You should have received a copy of the GNU General Public License and --
++-- a copy of the GCC Runtime Library Exception along with this program; --
++-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
++-- <http://www.gnu.org/licenses/>. --
++-- --
++-- GNARL was developed by the GNARL team at Florida State University. --
++-- Extensive contributions were provided by Ada Core Technologies, Inc. --
++-- --
++-- Copyright (C) 2010, 2011 John Marino <www.dragonlace.net> --
++------------------------------------------------------------------------------
++
++-- This version is for BSD operating systems using 32-bit time types.
++
++with Interfaces.C;
++
++package body System.OS_Primitives is
++
++ -- ??? These definitions are duplicated from System.OS_Interface
++ -- because we don't want to depend on any package. Consider removing
++ -- these declarations in System.OS_Interface and move these ones in
++ -- the spec.
++
++ subtype int is Interfaces.C.int;
++ subtype long is Interfaces.C.long;
++
++ type time_t is new int;
++
++ type timespec is record
++ tv_sec : time_t;
++ tv_nsec : long;
++ end record;
++ pragma Convention (C, timespec);
++
++ type timezone is record
++ tz_minuteswest : int;
++ tz_dsttime : int;
++ end record;
++ pragma Convention (C, timezone);
++
++ function nanosleep (rqtp, rmtp : access timespec) return int;
++ pragma Import (C, nanosleep, "nanosleep");
++
++ -----------
++ -- Clock --
++ -----------
++
++ function Clock return Duration is
++ type timeval is array (1 .. 2) of Long_Integer;
++ tzresult : aliased timezone;
++
++ procedure timeval_to_duration
++ (T : not null access timeval;
++ sec : not null access Long_Integer;
++ usec : not null access Long_Integer);
++ pragma Import (C, timeval_to_duration, "__gnat_timeval_to_duration");
++
++ Micro : constant := 10**6;
++ sec : aliased Long_Integer;
++ usec : aliased Long_Integer;
++ TV : aliased timeval;
++ Result : int;
++
++ function gettimeofday
++ (Tv : access timeval;
++ Tz : access timezone) return int;
++ pragma Import (C, gettimeofday, "gettimeofday");
++
++ pragma Unreferenced (Result);
++ begin
++ -- The return codes for gettimeofday are as follows (from man pages):
++ -- EPERM settimeofday is called by someone other than the superuser
++ -- EINVAL Timezone (or something else) is invalid
++ -- EFAULT One of tv or tz pointed outside accessible address space
++
++ -- None of these codes signal a potential clock skew, hence the return
++ -- value is never checked.
++
++ Result := gettimeofday (TV'Access, tzresult'Access);
++ timeval_to_duration (TV'Access, sec'Access, usec'Access);
++ return Duration (sec) + Duration (usec) / Micro;
++ end Clock;
++
++ ---------------------
++ -- Monotonic_Clock --
++ ---------------------
++
++ function Monotonic_Clock return Duration renames Clock;
++
++ -----------------
++ -- To_Timespec --
++ -----------------
++
++ function To_Timespec (D : Duration) return timespec;
++
++ function To_Timespec (D : Duration) return timespec is
++ S : time_t;
++ F : Duration;
++
++ begin
++ S := time_t (Long_Long_Integer (D));
++ F := D - Duration (S);
++
++ -- If F has negative value due to a round-up, adjust for positive F
++ -- value.
++
++ if F < 0.0 then
++ S := S - 1;
++ F := F + 1.0;
++ end if;
++
++ return
++ timespec'(tv_sec => S,
++ tv_nsec => long (Long_Long_Integer (F * 10#1#E9)));
++ end To_Timespec;
++
++ -----------------
++ -- Timed_Delay --
++ -----------------
++
++ procedure Timed_Delay
++ (Time : Duration;
++ Mode : Integer)
++ is
++ Request : aliased timespec;
++ Remaind : aliased timespec;
++ Rel_Time : Duration;
++ Abs_Time : Duration;
++ Base_Time : constant Duration := Clock;
++ Check_Time : Duration := Base_Time;
++
++ Result : int;
++ pragma Unreferenced (Result);
++
++ begin
++ if Mode = Relative then
++ Rel_Time := Time;
++ Abs_Time := Time + Check_Time;
++ else
++ Rel_Time := Time - Check_Time;
++ Abs_Time := Time;
++ end if;
++
++ if Rel_Time > 0.0 then
++ loop
++ Request := To_Timespec (Rel_Time);
++ Result := nanosleep (Request'Access, Remaind'Access);
++ Check_Time := Clock;
++
++ exit when Abs_Time <= Check_Time or else Check_Time < Base_Time;
++
++ Rel_Time := Abs_Time - Check_Time;
++ end loop;
++ end if;
++ end Timed_Delay;
++
++ ----------------
++ -- Initialize --
++ ----------------
++
++ procedure Initialize is
++ begin
++ null;
++ end Initialize;
++
++end System.OS_Primitives;
+--- /dev/null
++++ gcc/ada/s-osprim-bsd64.adb
+@@ -0,0 +1,192 @@
++------------------------------------------------------------------------------
++-- --
++-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
++-- --
++-- S Y S T E M . O S _ P R I M I T I V E S --
++-- --
++-- B o d y --
++-- --
++-- Copyright (C) 1998-2009, Free Software Foundation, Inc. --
++-- --
++-- GNARL is free software; you can redistribute it and/or modify it under --
++-- terms of the GNU General Public License as published by the Free Soft- --
++-- ware Foundation; either version 3, or (at your option) any later ver- --
++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
++-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
++-- or FITNESS FOR A PARTICULAR PURPOSE. --
++-- --
++-- As a special exception under Section 7 of GPL version 3, you are granted --
++-- additional permissions described in the GCC Runtime Library Exception, --
++-- version 3.1, as published by the Free Software Foundation. --
++-- --
++-- You should have received a copy of the GNU General Public License and --
++-- a copy of the GCC Runtime Library Exception along with this program; --
++-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
++-- <http://www.gnu.org/licenses/>. --
++-- --
++-- GNARL was developed by the GNARL team at Florida State University. --
++-- Extensive contributions were provided by Ada Core Technologies, Inc. --
++-- --
++-- Copyright (C) 2010, 2011 John Marino <www.dragonlace.net> --
++------------------------------------------------------------------------------
++
++-- This version is for BSD operating systems using 64-bit time types.
++
++with Interfaces.C;
++
++package body System.OS_Primitives is
++
++ -- ??? These definitions are duplicated from System.OS_Interface
++ -- because we don't want to depend on any package. Consider removing
++ -- these declarations in System.OS_Interface and move these ones in
++ -- the spec.
++
++ subtype int is Interfaces.C.int;
++ subtype long is Interfaces.C.long;
++ subtype int64_t is Interfaces.Integer_64;
++
++ type time_t is new int64_t;
++
++ type timespec is record
++ tv_sec : time_t;
++ tv_nsec : long;
++ end record;
++ pragma Convention (C, timespec);
++
++ type timezone is record
++ tz_minuteswest : int;
++ tz_dsttime : int;
++ end record;
++ pragma Convention (C, timezone);
++
++ type timeval is record
++ tv_sec : time_t;
++ tv_usec : long; -- Not for NetBSD! FreeBSD/DragonFly
++ end record;
++ pragma Convention (C, timeval);
++
++ function nanosleep (rqtp, rmtp : access timespec) return int;
++ pragma Import (C, nanosleep, "nanosleep");
++
++ -----------
++ -- Clock --
++ -----------
++
++ function Clock return Duration is
++
++ procedure timeval_to_duration
++ (T : not null access timeval;
++ sec : not null access Long_Integer;
++ usec : not null access Long_Integer);
++ pragma Import (C, timeval_to_duration, "__gnat_timeval_to_duration");
++
++ Micro : constant := 10**6;
++ sec : aliased Long_Integer;
++ usec : aliased Long_Integer;
++ TV : aliased timeval;
++ tzresult : aliased timezone;
++ Result : int;
++
++ function gettimeofday
++ (Tv : access timeval;
++ Tz : access timezone) return int;
++ pragma Import (C, gettimeofday, "gettimeofday");
++
++ pragma Unreferenced (Result);
++ begin
++ -- The return codes for gettimeofday are as follows (from man pages):
++ -- EPERM settimeofday is called by someone other than the superuser
++ -- EINVAL Timezone (or something else) is invalid
++ -- EFAULT One of tv or tz pointed outside accessible address space
++
++ -- None of these codes signal a potential clock skew, hence the return
++ -- value is never checked.
++
++ Result := gettimeofday (TV'Access, tzresult'Access);
++ timeval_to_duration (TV'Access, sec'Access, usec'Access);
++ return Duration (sec) + Duration (usec) / Micro;
++ end Clock;
++
++ ---------------------
++ -- Monotonic_Clock --
++ ---------------------
++
++ function Monotonic_Clock return Duration renames Clock;
++
++ -----------------
++ -- To_Timespec --
++ -----------------
++
++ function To_Timespec (D : Duration) return timespec;
++
++ function To_Timespec (D : Duration) return timespec is
++ S : time_t;
++ F : Duration;
++
++ begin
++ S := time_t (Long_Long_Integer (D));
++ F := D - Duration (S);
++
++ -- If F has negative value due to a round-up, adjust for positive F
++ -- value.
++
++ if F < 0.0 then
++ S := S - 1;
++ F := F + 1.0;
++ end if;
++
++ return
++ timespec'(tv_sec => S,
++ tv_nsec => long (Long_Long_Integer (F * 10#1#E9)));
++ end To_Timespec;
++
++ -----------------
++ -- Timed_Delay --
++ -----------------
++
++ procedure Timed_Delay
++ (Time : Duration;
++ Mode : Integer)
++ is
++ Request : aliased timespec;
++ Remaind : aliased timespec;
++ Rel_Time : Duration;
++ Abs_Time : Duration;
++ Base_Time : constant Duration := Clock;
++ Check_Time : Duration := Base_Time;
++
++ Result : int;
++ pragma Unreferenced (Result);
++
++ begin
++ if Mode = Relative then
++ Rel_Time := Time;
++ Abs_Time := Time + Check_Time;
++ else
++ Rel_Time := Time - Check_Time;
++ Abs_Time := Time;
++ end if;
++
++ if Rel_Time > 0.0 then
++ loop
++ Request := To_Timespec (Rel_Time);
++ Result := nanosleep (Request'Access, Remaind'Access);
++ Check_Time := Clock;
++
++ exit when Abs_Time <= Check_Time or else Check_Time < Base_Time;
++
++ Rel_Time := Abs_Time - Check_Time;
++ end loop;
++ end if;
++ end Timed_Delay;
++
++ ----------------
++ -- Initialize --
++ ----------------
++
++ procedure Initialize is
++ begin
++ null;
++ end Initialize;
++
++end System.OS_Primitives;
+--- /dev/null
++++ gcc/ada/s-osprim-bsdn6.adb
+@@ -0,0 +1,193 @@
++------------------------------------------------------------------------------
++-- --
++-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
++-- --
++-- S Y S T E M . O S _ P R I M I T I V E S --
++-- --
++-- B o d y --
++-- --
++-- Copyright (C) 1998-2009, Free Software Foundation, Inc. --
++-- --
++-- GNARL is free software; you can redistribute it and/or modify it under --
++-- terms of the GNU General Public License as published by the Free Soft- --
++-- ware Foundation; either version 3, or (at your option) any later ver- --
++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
++-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
++-- or FITNESS FOR A PARTICULAR PURPOSE. --
++-- --
++-- As a special exception under Section 7 of GPL version 3, you are granted --
++-- additional permissions described in the GCC Runtime Library Exception, --
++-- version 3.1, as published by the Free Software Foundation. --
++-- --
++-- You should have received a copy of the GNU General Public License and --
++-- a copy of the GCC Runtime Library Exception along with this program; --
++-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
++-- <http://www.gnu.org/licenses/>. --
++-- --
++-- GNARL was developed by the GNARL team at Florida State University. --
++-- Extensive contributions were provided by Ada Core Technologies, Inc. --
++-- --
++-- Copyright (C) 2010, 2011 John Marino <www.dragonlace.net> --
++------------------------------------------------------------------------------
++
++-- This version is for NetBSD 6.0+
++-- It switches time type to 64 bits and uses compatibility functions
++
++with Interfaces.C;
++
++package body System.OS_Primitives is
++
++ -- ??? These definitions are duplicated from System.OS_Interface
++ -- because we don't want to depend on any package. Consider removing
++ -- these declarations in System.OS_Interface and move these ones in
++ -- the spec.
++
++ subtype int is Interfaces.C.int;
++ subtype long is Interfaces.C.long;
++ subtype int64_t is Interfaces.Integer_64;
++
++ type time_t is new int64_t;
++
++ type timespec is record
++ tv_sec : time_t;
++ tv_nsec : long;
++ end record;
++ pragma Convention (C, timespec);
++
++ type timezone is record
++ tz_minuteswest : int;
++ tz_dsttime : int;
++ end record;
++ pragma Convention (C, timezone);
++
++ type timeval is record
++ tv_sec : time_t;
++ tv_usec : int;
++ end record;
++ pragma Convention (C, timeval);
++
++ function nanosleep (rqtp, rmtp : access timespec) return int;
++ pragma Import (C, nanosleep, "__nanosleep50");
++
++ -----------
++ -- Clock --
++ -----------
++
++ function Clock return Duration is
++
++ procedure timeval_to_duration
++ (T : not null access timeval;
++ sec : not null access Long_Integer;
++ usec : not null access Long_Integer);
++ pragma Import (C, timeval_to_duration, "__gnat_timeval_to_duration");
++
++ Micro : constant := 10**6;
++ sec : aliased Long_Integer;
++ usec : aliased Long_Integer;
++ TV : aliased timeval;
++ tzresult : aliased timezone;
++ Result : int;
++
++ function gettimeofday
++ (Tv : access timeval;
++ Tz : access timezone) return int;
++ pragma Import (C, gettimeofday, "__gettimeofday50");
++
++ pragma Unreferenced (Result);
++ begin
++ -- The return codes for gettimeofday are as follows (from man pages):
++ -- EPERM settimeofday is called by someone other than the superuser
++ -- EINVAL Timezone (or something else) is invalid
++ -- EFAULT One of tv or tz pointed outside accessible address space
++
++ -- None of these codes signal a potential clock skew, hence the return
++ -- value is never checked.
++
++ Result := gettimeofday (TV'Access, tzresult'Access);
++ timeval_to_duration (TV'Access, sec'Access, usec'Access);
++ return Duration (sec) + Duration (usec) / Micro;
++ end Clock;
++
++ ---------------------
++ -- Monotonic_Clock --
++ ---------------------
++
++ function Monotonic_Clock return Duration renames Clock;
++
++ -----------------
++ -- To_Timespec --
++ -----------------
++
++ function To_Timespec (D : Duration) return timespec;
++
++ function To_Timespec (D : Duration) return timespec is
++ S : time_t;
++ F : Duration;
++
++ begin
++ S := time_t (Long_Long_Integer (D));
++ F := D - Duration (S);
++
++ -- If F has negative value due to a round-up, adjust for positive F
++ -- value.
++
++ if F < 0.0 then
++ S := S - 1;
++ F := F + 1.0;
++ end if;
++
++ return
++ timespec'(tv_sec => S,
++ tv_nsec => long (Long_Long_Integer (F * 10#1#E9)));
++ end To_Timespec;
++
++ -----------------
++ -- Timed_Delay --
++ -----------------
++
++ procedure Timed_Delay
++ (Time : Duration;
++ Mode : Integer)
++ is
++ Request : aliased timespec;
++ Remaind : aliased timespec;
++ Rel_Time : Duration;
++ Abs_Time : Duration;
++ Base_Time : constant Duration := Clock;
++ Check_Time : Duration := Base_Time;
++
++ Result : int;
++ pragma Unreferenced (Result);
++
++ begin
++ if Mode = Relative then
++ Rel_Time := Time;
++ Abs_Time := Time + Check_Time;
++ else
++ Rel_Time := Time - Check_Time;
++ Abs_Time := Time;
++ end if;
++
++ if Rel_Time > 0.0 then
++ loop
++ Request := To_Timespec (Rel_Time);
++ Result := nanosleep (Request'Access, Remaind'Access);
++ Check_Time := Clock;
++
++ exit when Abs_Time <= Check_Time or else Check_Time < Base_Time;
++
++ Rel_Time := Abs_Time - Check_Time;
++ end loop;
++ end if;
++ end Timed_Delay;
++
++ ----------------
++ -- Initialize --
++ ----------------
++
++ procedure Initialize is
++ begin
++ null;
++ end Initialize;
++
++end System.OS_Primitives;
+--- gcc/ada/s-rannum.adb.orig
++++ gcc/ada/s-rannum.adb
+@@ -27,6 +27,7 @@
+ -- GNAT was originally developed by the GNAT team at New York University. --
+ -- Extensive contributions were provided by Ada Core Technologies Inc. --
+ -- --
++-- Copyright (C) 2010 John Marino <draco@marino.st> --
+ ------------------------------------------------------------------------------
+
+ ------------------------------------------------------------------------------
+@@ -294,7 +295,7 @@
+ X : Real; -- Scaled mantissa
+ R : Unsigned_32; -- Supply of random bits
+ R_Bits : Natural; -- Number of bits left in R
+- K : Bit_Count; -- Next decrement to exponent
++ K : Bit_Count := 0; -- Next decrement to exponent
+
+ begin
+ Mantissa := Random (Gen) / 2**Extra_Bits;
+--- gcc/ada/s-stusta.adb.orig
++++ gcc/ada/s-stusta.adb
+@@ -29,6 +29,7 @@
+ -- GNARL was developed by the GNARL team at Florida State University. --
+ -- Extensive contributions were provided by Ada Core Technologies, Inc. --
+ -- --
++-- Copyright (C) 2010 John Marino <draco@marino.st --
+ ------------------------------------------------------------------------------
+
+ with System.Stack_Usage;
+@@ -235,7 +236,7 @@
+ ------------
+
+ procedure Print (Obj : Stack_Usage_Result) is
+- Pos : Positive;
++ Pos : Positive := 1;
+ begin
+
+ -- Simply trim the string containing the task name
+--- /dev/null
++++ gcc/ada/signal_android.c
+@@ -0,0 +1,77 @@
++/*
++ * Copyright (C) 2008 The Android Open Source Project
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * * Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * * Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in
++ * the documentation and/or other materials provided with the
++ * distribution.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
++ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
++ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
++ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
++ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
++ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
++ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
++ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
++ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
++ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++ * SUCH DAMAGE.
++ */
++#include <limits.h> /* For LONG_BIT */
++#include <string.h> /* For memset() */
++
++typedef unsigned long sigset_t;
++
++
++int
++sigismember(sigset_t *set, int signum)
++{
++ unsigned long *local_set = (unsigned long *)set;
++ signum--;
++ return (int)((local_set[signum/LONG_BIT] >> (signum%LONG_BIT)) & 1);
++}
++
++
++int
++sigaddset(sigset_t *set, int signum)
++{
++ unsigned long *local_set = (unsigned long *)set;
++ signum--;
++ local_set[signum/LONG_BIT] |= 1UL << (signum%LONG_BIT);
++ return 0;
++}
++
++
++int
++sigdelset(sigset_t *set, int signum)
++{
++ unsigned long *local_set = (unsigned long *)set;
++ signum--;
++ local_set[signum/LONG_BIT] &= ~(1UL << (signum%LONG_BIT));
++ return 0;
++}
++
++
++int
++sigemptyset(sigset_t *set)
++{
++ memset(set, 0, sizeof *set);
++ return 0;
++}
++
++
++int
++sigfillset(sigset_t *set)
++{
++ memset(set, ~0, sizeof *set);
++ return 0;
++}
++
+--- gcc/ada/sysdep.c.orig
++++ gcc/ada/sysdep.c
+@@ -27,6 +27,7 @@
+ * GNAT was originally developed by the GNAT team at New York University. *
+ * Extensive contributions were provided by Ada Core Technologies Inc. *
+ * *
++ * Copyright (C) 2010 John Marino <draco@marino.st> *
+ ****************************************************************************/
+
+ /* This file contains system dependent symbols that are referenced in the
+@@ -368,6 +369,7 @@
+ || defined (__MACHTEN__) || defined (__hpux__) || defined (_AIX) \
+ || (defined (__svr4__) && defined (i386)) || defined (__Lynx__) \
+ || defined (__CYGWIN__) || defined (__FreeBSD__) || defined (__OpenBSD__) \
++ || defined (__DragonFly__) \
+ || defined (__GLIBC__) || defined (__APPLE__)
+
+ #ifdef __MINGW32__
+@@ -426,6 +428,7 @@
+ || defined (__CYGWIN32__) || defined (__MACHTEN__) || defined (__hpux__) \
+ || defined (_AIX) || (defined (__svr4__) && defined (i386)) \
+ || defined (__Lynx__) || defined (__FreeBSD__) || defined (__OpenBSD__) \
++ || defined (__DragonFly__) \
+ || defined (__GLIBC__) || defined (__APPLE__)
+ char c;
+ int nread;
+@@ -446,6 +449,7 @@
+ || defined (__osf__) || defined (__MACHTEN__) || defined (__hpux__) \
+ || defined (_AIX) || (defined (__svr4__) && defined (i386)) \
+ || defined (__Lynx__) || defined (__FreeBSD__) || defined (__OpenBSD__) \
++ || defined (__DragonFly__) \
+ || defined (__GLIBC__) || defined (__APPLE__)
+ eof_ch = termios_rec.c_cc[VEOF];
+
+@@ -937,6 +941,7 @@
+ struct tm */
+
+ #elif defined (__APPLE__) || defined (__FreeBSD__) || defined (linux) ||\
++ defined (__DragonFly__) ||\
+ (defined (__alpha__) && defined (__osf__)) || defined (__GLIBC__)
+ {
+ localtime_r (timer, &tp);
+--- /dev/null
++++ gcc/ada/system-dragonfly-x86_64.ads
+@@ -0,0 +1,147 @@
++------------------------------------------------------------------------------
++-- --
++-- GNAT RUN-TIME COMPONENTS --
++-- --
++-- S Y S T E M --
++-- --
++-- S p e c --
++-- (DragonFly BSD/x86_64 Version) --
++-- --
++-- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
++-- --
++-- This specification is derived from the Ada Reference Manual for use with --
++-- GNAT. The copyright notice above, and the license provisions that follow --
++-- apply solely to the contents of the part following the private keyword. --
++-- --
++-- GNAT is free software; you can redistribute it and/or modify it under --
++-- terms of the GNU General Public License as published by the Free Soft- --
++-- ware Foundation; either version 3, or (at your option) any later ver- --
++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
++-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
++-- or FITNESS FOR A PARTICULAR PURPOSE. --
++-- --
++-- As a special exception under Section 7 of GPL version 3, you are granted --
++-- additional permissions described in the GCC Runtime Library Exception, --
++-- version 3.1, as published by the Free Software Foundation. --
++-- --
++-- You should have received a copy of the GNU General Public License and --
++-- a copy of the GCC Runtime Library Exception along with this program; --
++-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
++-- <http://www.gnu.org/licenses/>. --
++-- --
++-- GNAT was originally developed by the GNAT team at New York University. --
++-- Extensive contributions were provided by Ada Core Technologies Inc. --
++-- --
++-- Copyright (C) 2010 John Marino <draco@marino.st> --
++------------------------------------------------------------------------------
++
++package System is
++ pragma Pure;
++ -- Note that we take advantage of the implementation permission to make
++ -- this unit Pure instead of Preelaborable; see RM 13.7.1(15). In Ada
++ -- 2005, this is Pure in any case (AI-362).
++
++ type Name is (SYSTEM_NAME_GNAT);
++ System_Name : constant Name := SYSTEM_NAME_GNAT;
++
++ -- System-Dependent Named Numbers
++
++ Min_Int : constant := Long_Long_Integer'First;
++ Max_Int : constant := Long_Long_Integer'Last;
++
++ Max_Binary_Modulus : constant := 2 ** Long_Long_Integer'Size;
++ Max_Nonbinary_Modulus : constant := 2 ** Integer'Size - 1;
++
++ Max_Base_Digits : constant := Long_Long_Float'Digits;
++ Max_Digits : constant := Long_Long_Float'Digits;
++
++ Max_Mantissa : constant := 63;
++ Fine_Delta : constant := 2.0 ** (-Max_Mantissa);
++
++ Tick : constant := 0.000_001;
++
++ -- Storage-related Declarations
++
++ type Address is private;
++ pragma Preelaborable_Initialization (Address);
++ Null_Address : constant Address;
++
++ Storage_Unit : constant := 8;
++ Word_Size : constant := 64;
++ Memory_Size : constant := 2 ** 64;
++
++ -- Address comparison
++
++ function "<" (Left, Right : Address) return Boolean;
++ function "<=" (Left, Right : Address) return Boolean;
++ function ">" (Left, Right : Address) return Boolean;
++ function ">=" (Left, Right : Address) return Boolean;
++ function "=" (Left, Right : Address) return Boolean;
++
++ pragma Import (Intrinsic, "<");
++ pragma Import (Intrinsic, "<=");
++ pragma Import (Intrinsic, ">");
++ pragma Import (Intrinsic, ">=");
++ pragma Import (Intrinsic, "=");
++
++ -- Other System-Dependent Declarations
++
++ type Bit_Order is (High_Order_First, Low_Order_First);
++ Default_Bit_Order : constant Bit_Order := Low_Order_First;
++ pragma Warnings (Off, Default_Bit_Order); -- kill constant condition warning
++
++ -- Priority-related Declarations (RM D.1)
++
++ Max_Priority : constant Positive := 30;
++ Max_Interrupt_Priority : constant Positive := 31;
++
++ subtype Any_Priority is Integer range 0 .. 31;
++ subtype Priority is Any_Priority range 0 .. 30;
++ subtype Interrupt_Priority is Any_Priority range 31 .. 31;
++
++ Default_Priority : constant Priority := 15;
++
++private
++
++ type Address is mod Memory_Size;
++ Null_Address : constant Address := 0;
++
++ --------------------------------------
++ -- System Implementation Parameters --
++ --------------------------------------
++
++ -- These parameters provide information about the target that is used
++ -- by the compiler. They are in the private part of System, where they
++ -- can be accessed using the special circuitry in the Targparm unit
++ -- whose source should be consulted for more detailed descriptions
++ -- of the individual switch values.
++
++ Backend_Divide_Checks : constant Boolean := False;
++ Backend_Overflow_Checks : constant Boolean := True;
++ Command_Line_Args : constant Boolean := True;
++ Configurable_Run_Time : constant Boolean := False;
++ Denorm : constant Boolean := True;
++ Duration_32_Bits : constant Boolean := False;
++ Exit_Status_Supported : constant Boolean := True;
++ Fractional_Fixed_Ops : constant Boolean := False;
++ Frontend_Layout : constant Boolean := False;
++ Machine_Overflows : constant Boolean := False;
++ Machine_Rounds : constant Boolean := True;
++ OpenVMS : constant Boolean := False;
++ Preallocated_Stacks : constant Boolean := False;
++ Signed_Zeros : constant Boolean := True;
++ Stack_Check_Default : constant Boolean := False;
++ Stack_Check_Probes : constant Boolean := True;
++ Stack_Check_Limits : constant Boolean := False;
++ Support_64_Bit_Divides : constant Boolean := True;
++ Support_Aggregates : constant Boolean := True;
++ Support_Composite_Assign : constant Boolean := True;
++ Support_Composite_Compare : constant Boolean := True;
++ Support_Long_Shifts : constant Boolean := True;
++ Always_Compatible_Rep : constant Boolean := False;
++ Suppress_Standard_Library : constant Boolean := False;
++ Use_Ada_Main_Program_Name : constant Boolean := False;
++ ZCX_By_Default : constant Boolean := True;
++ GCC_ZCX_Support : constant Boolean := True;
++
++end System;
+--- /dev/null
++++ gcc/ada/system-dragonfly-x86.ads
+@@ -0,0 +1,147 @@
++------------------------------------------------------------------------------
++-- --
++-- GNAT RUN-TIME COMPONENTS --
++-- --
++-- S Y S T E M --
++-- --
++-- S p e c --
++-- (DragonFly BSD/x86 Version) --
++-- --
++-- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
++-- --
++-- This specification is derived from the Ada Reference Manual for use with --
++-- GNAT. The copyright notice above, and the license provisions that follow --
++-- apply solely to the contents of the part following the private keyword. --
++-- --
++-- GNAT is free software; you can redistribute it and/or modify it under --
++-- terms of the GNU General Public License as published by the Free Soft- --
++-- ware Foundation; either version 3, or (at your option) any later ver- --
++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
++-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
++-- or FITNESS FOR A PARTICULAR PURPOSE. --
++-- --
++-- As a special exception under Section 7 of GPL version 3, you are granted --
++-- additional permissions described in the GCC Runtime Library Exception, --
++-- version 3.1, as published by the Free Software Foundation. --
++-- --
++-- You should have received a copy of the GNU General Public License and --
++-- a copy of the GCC Runtime Library Exception along with this program; --
++-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
++-- <http://www.gnu.org/licenses/>. --
++-- --
++-- GNAT was originally developed by the GNAT team at New York University. --
++-- Extensive contributions were provided by Ada Core Technologies Inc. --
++-- --
++-- Copyright (C) 2010 John Marino <draco@marino.st> --
++------------------------------------------------------------------------------
++
++package System is
++ pragma Pure;
++ -- Note that we take advantage of the implementation permission to make
++ -- this unit Pure instead of Preelaborable; see RM 13.7.1(15). In Ada
++ -- 2005, this is Pure in any case (AI-362).
++
++ type Name is (SYSTEM_NAME_GNAT);
++ System_Name : constant Name := SYSTEM_NAME_GNAT;
++
++ -- System-Dependent Named Numbers
++
++ Min_Int : constant := Long_Long_Integer'First;
++ Max_Int : constant := Long_Long_Integer'Last;
++
++ Max_Binary_Modulus : constant := 2 ** Long_Long_Integer'Size;
++ Max_Nonbinary_Modulus : constant := 2 ** Integer'Size - 1;
++
++ Max_Base_Digits : constant := Long_Long_Float'Digits;
++ Max_Digits : constant := Long_Long_Float'Digits;
++
++ Max_Mantissa : constant := 63;
++ Fine_Delta : constant := 2.0 ** (-Max_Mantissa);
++
++ Tick : constant := 0.000_001;
++
++ -- Storage-related Declarations
++
++ type Address is private;
++ pragma Preelaborable_Initialization (Address);
++ Null_Address : constant Address;
++
++ Storage_Unit : constant := 8;
++ Word_Size : constant := 32;
++ Memory_Size : constant := 2 ** 32;
++
++ -- Address comparison
++
++ function "<" (Left, Right : Address) return Boolean;
++ function "<=" (Left, Right : Address) return Boolean;
++ function ">" (Left, Right : Address) return Boolean;
++ function ">=" (Left, Right : Address) return Boolean;
++ function "=" (Left, Right : Address) return Boolean;
++
++ pragma Import (Intrinsic, "<");
++ pragma Import (Intrinsic, "<=");
++ pragma Import (Intrinsic, ">");
++ pragma Import (Intrinsic, ">=");
++ pragma Import (Intrinsic, "=");
++
++ -- Other System-Dependent Declarations
++
++ type Bit_Order is (High_Order_First, Low_Order_First);
++ Default_Bit_Order : constant Bit_Order := Low_Order_First;
++ pragma Warnings (Off, Default_Bit_Order); -- kill constant condition warning
++
++ -- Priority-related Declarations (RM D.1)
++
++ Max_Priority : constant Positive := 30;
++ Max_Interrupt_Priority : constant Positive := 31;
++
++ subtype Any_Priority is Integer range 0 .. 31;
++ subtype Priority is Any_Priority range 0 .. 30;
++ subtype Interrupt_Priority is Any_Priority range 31 .. 31;
++
++ Default_Priority : constant Priority := 15;
++
++private
++
++ type Address is mod Memory_Size;
++ Null_Address : constant Address := 0;
++
++ --------------------------------------
++ -- System Implementation Parameters --
++ --------------------------------------
++
++ -- These parameters provide information about the target that is used
++ -- by the compiler. They are in the private part of System, where they
++ -- can be accessed using the special circuitry in the Targparm unit
++ -- whose source should be consulted for more detailed descriptions
++ -- of the individual switch values.
++
++ Backend_Divide_Checks : constant Boolean := False;
++ Backend_Overflow_Checks : constant Boolean := True;
++ Command_Line_Args : constant Boolean := True;
++ Configurable_Run_Time : constant Boolean := False;
++ Denorm : constant Boolean := True;
++ Duration_32_Bits : constant Boolean := False;
++ Exit_Status_Supported : constant Boolean := True;
++ Fractional_Fixed_Ops : constant Boolean := False;
++ Frontend_Layout : constant Boolean := False;
++ Machine_Overflows : constant Boolean := False;
++ Machine_Rounds : constant Boolean := True;
++ OpenVMS : constant Boolean := False;
++ Preallocated_Stacks : constant Boolean := False;
++ Signed_Zeros : constant Boolean := True;
++ Stack_Check_Default : constant Boolean := False;
++ Stack_Check_Probes : constant Boolean := True;
++ Stack_Check_Limits : constant Boolean := False;
++ Support_64_Bit_Divides : constant Boolean := True;
++ Support_Aggregates : constant Boolean := True;
++ Support_Composite_Assign : constant Boolean := True;
++ Support_Composite_Compare : constant Boolean := True;
++ Support_Long_Shifts : constant Boolean := True;
++ Always_Compatible_Rep : constant Boolean := False;
++ Suppress_Standard_Library : constant Boolean := False;
++ Use_Ada_Main_Program_Name : constant Boolean := False;
++ ZCX_By_Default : constant Boolean := True;
++ GCC_ZCX_Support : constant Boolean := True;
++
++end System;
+--- gcc/ada/system-freebsd-x86_64.ads.orig
++++ gcc/ada/system-freebsd-x86_64.ads
+@@ -32,6 +32,7 @@
+ -- GNAT was originally developed by the GNAT team at New York University. --
+ -- Extensive contributions were provided by Ada Core Technologies Inc. --
+ -- --
++-- Copyright (C) 2010 John Marino <draco@marino.st> --
+ ------------------------------------------------------------------------------
+
+ package System is
+@@ -90,6 +91,7 @@
+ pragma Warnings (Off, Default_Bit_Order); -- kill constant condition warning
+
+ -- Priority-related Declarations (RM D.1)
++ -- For FreeBSD 8.0, definitions found in <sys/priority.h>
+
+ Max_Priority : constant Positive := 30;
+ Max_Interrupt_Priority : constant Positive := 31;
+@@ -98,7 +100,7 @@
+ subtype Priority is Any_Priority range 0 .. 30;
+ subtype Interrupt_Priority is Any_Priority range 31 .. 31;
+
+- Default_Priority : constant Priority := 15;
++ Default_Priority : constant Priority := Max_Priority / 2;
+
+ private
+
+@@ -116,7 +118,7 @@
+ -- of the individual switch values.
+
+ Backend_Divide_Checks : constant Boolean := False;
+- Backend_Overflow_Checks : constant Boolean := False;
++ Backend_Overflow_Checks : constant Boolean := True;
+ Command_Line_Args : constant Boolean := True;
+ Configurable_Run_Time : constant Boolean := False;
+ Denorm : constant Boolean := True;
+--- gcc/ada/system-freebsd-x86.ads.orig
++++ gcc/ada/system-freebsd-x86.ads
+@@ -32,6 +32,7 @@
+ -- GNAT was originally developed by the GNAT team at New York University. --
+ -- Extensive contributions were provided by Ada Core Technologies Inc. --
+ -- --
++-- Copyright (C) 2010 John Marino <draco@marino.st> --
+ ------------------------------------------------------------------------------
+
+ package System is
+@@ -90,6 +91,7 @@
+ pragma Warnings (Off, Default_Bit_Order); -- kill constant condition warning
+
+ -- Priority-related Declarations (RM D.1)
++ -- For FreeBSD 8.0, definitions found in <sys/priority.h>
+
+ Max_Priority : constant Positive := 30;
+ Max_Interrupt_Priority : constant Positive := 31;
+@@ -98,7 +100,7 @@
+ subtype Priority is Any_Priority range 0 .. 30;
+ subtype Interrupt_Priority is Any_Priority range 31 .. 31;
+
+- Default_Priority : constant Priority := 15;
++ Default_Priority : constant Priority := Max_Priority / 2;
+
+ private
+
+--- /dev/null
++++ gcc/ada/system-netbsd-x86_64.ads
+@@ -0,0 +1,147 @@
++------------------------------------------------------------------------------
++-- --
++-- GNAT RUN-TIME COMPONENTS --
++-- --
++-- S Y S T E M --
++-- --
++-- S p e c --
++-- (NetBSD/x86_64 Version) --
++-- --
++-- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
++-- --
++-- This specification is derived from the Ada Reference Manual for use with --
++-- GNAT. The copyright notice above, and the license provisions that follow --
++-- apply solely to the contents of the part following the private keyword. --
++-- --
++-- GNAT is free software; you can redistribute it and/or modify it under --
++-- terms of the GNU General Public License as published by the Free Soft- --
++-- ware Foundation; either version 3, or (at your option) any later ver- --
++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
++-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
++-- or FITNESS FOR A PARTICULAR PURPOSE. --
++-- --
++-- As a special exception under Section 7 of GPL version 3, you are granted --
++-- additional permissions described in the GCC Runtime Library Exception, --
++-- version 3.1, as published by the Free Software Foundation. --
++-- --
++-- You should have received a copy of the GNU General Public License and --
++-- a copy of the GCC Runtime Library Exception along with this program; --
++-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
++-- <http://www.gnu.org/licenses/>. --
++-- --
++-- GNAT was originally developed by the GNAT team at New York University. --
++-- Extensive contributions were provided by Ada Core Technologies Inc. --
++-- --
++-- Copyright (C) 2010 John Marino <draco@marino.st> --
++------------------------------------------------------------------------------
++
++package System is
++ pragma Pure;
++ -- Note that we take advantage of the implementation permission to make
++ -- this unit Pure instead of Preelaborable; see RM 13.7.1(15). In Ada
++ -- 2005, this is Pure in any case (AI-362).
++
++ type Name is (SYSTEM_NAME_GNAT);
++ System_Name : constant Name := SYSTEM_NAME_GNAT;
++
++ -- System-Dependent Named Numbers
++
++ Min_Int : constant := Long_Long_Integer'First;
++ Max_Int : constant := Long_Long_Integer'Last;
++
++ Max_Binary_Modulus : constant := 2 ** Long_Long_Integer'Size;
++ Max_Nonbinary_Modulus : constant := 2 ** Integer'Size - 1;
++
++ Max_Base_Digits : constant := Long_Long_Float'Digits;
++ Max_Digits : constant := Long_Long_Float'Digits;
++
++ Max_Mantissa : constant := 63;
++ Fine_Delta : constant := 2.0 ** (-Max_Mantissa);
++
++ Tick : constant := 0.000_001;
++
++ -- Storage-related Declarations
++
++ type Address is private;
++ pragma Preelaborable_Initialization (Address);
++ Null_Address : constant Address;
++
++ Storage_Unit : constant := 8;
++ Word_Size : constant := 64;
++ Memory_Size : constant := 2 ** 64;
++
++ -- Address comparison
++
++ function "<" (Left, Right : Address) return Boolean;
++ function "<=" (Left, Right : Address) return Boolean;
++ function ">" (Left, Right : Address) return Boolean;
++ function ">=" (Left, Right : Address) return Boolean;
++ function "=" (Left, Right : Address) return Boolean;
++
++ pragma Import (Intrinsic, "<");
++ pragma Import (Intrinsic, "<=");
++ pragma Import (Intrinsic, ">");
++ pragma Import (Intrinsic, ">=");
++ pragma Import (Intrinsic, "=");
++
++ -- Other System-Dependent Declarations
++
++ type Bit_Order is (High_Order_First, Low_Order_First);
++ Default_Bit_Order : constant Bit_Order := Low_Order_First;
++ pragma Warnings (Off, Default_Bit_Order); -- kill constant condition warning
++
++ -- Priority-related Declarations (RM D.1)
++
++ Max_Priority : constant Positive := 30;
++ Max_Interrupt_Priority : constant Positive := 31;
++
++ subtype Any_Priority is Integer range 0 .. 31;
++ subtype Priority is Any_Priority range 0 .. 30;
++ subtype Interrupt_Priority is Any_Priority range 31 .. 31;
++
++ Default_Priority : constant Priority := 15;
++
++private
++
++ type Address is mod Memory_Size;
++ Null_Address : constant Address := 0;
++
++ --------------------------------------
++ -- System Implementation Parameters --
++ --------------------------------------
++
++ -- These parameters provide information about the target that is used
++ -- by the compiler. They are in the private part of System, where they
++ -- can be accessed using the special circuitry in the Targparm unit
++ -- whose source should be consulted for more detailed descriptions
++ -- of the individual switch values.
++
++ Backend_Divide_Checks : constant Boolean := False;
++ Backend_Overflow_Checks : constant Boolean := True;
++ Command_Line_Args : constant Boolean := True;
++ Configurable_Run_Time : constant Boolean := False;
++ Denorm : constant Boolean := True;
++ Duration_32_Bits : constant Boolean := False;
++ Exit_Status_Supported : constant Boolean := True;
++ Fractional_Fixed_Ops : constant Boolean := False;
++ Frontend_Layout : constant Boolean := False;
++ Machine_Overflows : constant Boolean := False;
++ Machine_Rounds : constant Boolean := True;
++ OpenVMS : constant Boolean := False;
++ Preallocated_Stacks : constant Boolean := False;
++ Signed_Zeros : constant Boolean := True;
++ Stack_Check_Default : constant Boolean := False;
++ Stack_Check_Probes : constant Boolean := True;
++ Stack_Check_Limits : constant Boolean := False;
++ Support_64_Bit_Divides : constant Boolean := True;
++ Support_Aggregates : constant Boolean := True;
++ Support_Composite_Assign : constant Boolean := True;
++ Support_Composite_Compare : constant Boolean := True;
++ Support_Long_Shifts : constant Boolean := True;
++ Always_Compatible_Rep : constant Boolean := True;
++ Suppress_Standard_Library : constant Boolean := False;
++ Use_Ada_Main_Program_Name : constant Boolean := False;
++ ZCX_By_Default : constant Boolean := True;
++ GCC_ZCX_Support : constant Boolean := True;
++
++end System;
+--- /dev/null
++++ gcc/ada/system-netbsd-x86.ads
+@@ -0,0 +1,147 @@
++------------------------------------------------------------------------------
++-- --
++-- GNAT RUN-TIME COMPONENTS --
++-- --
++-- S Y S T E M --
++-- --
++-- S p e c --
++-- (NetBSD/x86 Version) --
++-- --
++-- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
++-- --
++-- This specification is derived from the Ada Reference Manual for use with --
++-- GNAT. The copyright notice above, and the license provisions that follow --
++-- apply solely to the contents of the part following the private keyword. --
++-- --
++-- GNAT is free software; you can redistribute it and/or modify it under --
++-- terms of the GNU General Public License as published by the Free Soft- --
++-- ware Foundation; either version 3, or (at your option) any later ver- --
++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
++-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
++-- or FITNESS FOR A PARTICULAR PURPOSE. --
++-- --
++-- As a special exception under Section 7 of GPL version 3, you are granted --
++-- additional permissions described in the GCC Runtime Library Exception, --
++-- version 3.1, as published by the Free Software Foundation. --
++-- --
++-- You should have received a copy of the GNU General Public License and --
++-- a copy of the GCC Runtime Library Exception along with this program; --
++-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
++-- <http://www.gnu.org/licenses/>. --
++-- --
++-- GNAT was originally developed by the GNAT team at New York University. --
++-- Extensive contributions were provided by Ada Core Technologies Inc. --
++-- --
++-- Copyright (C) 2010 John Marino <draco@marino.st> --
++------------------------------------------------------------------------------
++
++package System is
++ pragma Pure;
++ -- Note that we take advantage of the implementation permission to make
++ -- this unit Pure instead of Preelaborable; see RM 13.7.1(15). In Ada
++ -- 2005, this is Pure in any case (AI-362).
++
++ type Name is (SYSTEM_NAME_GNAT);
++ System_Name : constant Name := SYSTEM_NAME_GNAT;
++
++ -- System-Dependent Named Numbers
++
++ Min_Int : constant := Long_Long_Integer'First;
++ Max_Int : constant := Long_Long_Integer'Last;
++
++ Max_Binary_Modulus : constant := 2 ** Long_Long_Integer'Size;
++ Max_Nonbinary_Modulus : constant := 2 ** Integer'Size - 1;
++
++ Max_Base_Digits : constant := Long_Long_Float'Digits;
++ Max_Digits : constant := Long_Long_Float'Digits;
++
++ Max_Mantissa : constant := 63;
++ Fine_Delta : constant := 2.0 ** (-Max_Mantissa);
++
++ Tick : constant := 0.000_001;
++
++ -- Storage-related Declarations
++
++ type Address is private;
++ pragma Preelaborable_Initialization (Address);
++ Null_Address : constant Address;
++
++ Storage_Unit : constant := 8;
++ Word_Size : constant := 32;
++ Memory_Size : constant := 2 ** 32;
++
++ -- Address comparison
++
++ function "<" (Left, Right : Address) return Boolean;
++ function "<=" (Left, Right : Address) return Boolean;
++ function ">" (Left, Right : Address) return Boolean;
++ function ">=" (Left, Right : Address) return Boolean;
++ function "=" (Left, Right : Address) return Boolean;
++
++ pragma Import (Intrinsic, "<");
++ pragma Import (Intrinsic, "<=");
++ pragma Import (Intrinsic, ">");
++ pragma Import (Intrinsic, ">=");
++ pragma Import (Intrinsic, "=");
++
++ -- Other System-Dependent Declarations
++
++ type Bit_Order is (High_Order_First, Low_Order_First);
++ Default_Bit_Order : constant Bit_Order := Low_Order_First;
++ pragma Warnings (Off, Default_Bit_Order); -- kill constant condition warning
++
++ -- Priority-related Declarations (RM D.1)
++
++ Max_Priority : constant Positive := 30;
++ Max_Interrupt_Priority : constant Positive := 31;
++
++ subtype Any_Priority is Integer range 0 .. 31;
++ subtype Priority is Any_Priority range 0 .. 30;
++ subtype Interrupt_Priority is Any_Priority range 31 .. 31;
++
++ Default_Priority : constant Priority := 15;
++
++private
++
++ type Address is mod Memory_Size;
++ Null_Address : constant Address := 0;
++
++ --------------------------------------
++ -- System Implementation Parameters --
++ --------------------------------------
++
++ -- These parameters provide information about the target that is used
++ -- by the compiler. They are in the private part of System, where they
++ -- can be accessed using the special circuitry in the Targparm unit
++ -- whose source should be consulted for more detailed descriptions
++ -- of the individual switch values.
++
++ Backend_Divide_Checks : constant Boolean := False;
++ Backend_Overflow_Checks : constant Boolean := True;
++ Command_Line_Args : constant Boolean := True;
++ Configurable_Run_Time : constant Boolean := False;
++ Denorm : constant Boolean := True;
++ Duration_32_Bits : constant Boolean := False;
++ Exit_Status_Supported : constant Boolean := True;
++ Fractional_Fixed_Ops : constant Boolean := False;
++ Frontend_Layout : constant Boolean := False;
++ Machine_Overflows : constant Boolean := False;
++ Machine_Rounds : constant Boolean := True;
++ OpenVMS : constant Boolean := False;
++ Preallocated_Stacks : constant Boolean := False;
++ Signed_Zeros : constant Boolean := True;
++ Stack_Check_Default : constant Boolean := False;
++ Stack_Check_Probes : constant Boolean := True;
++ Stack_Check_Limits : constant Boolean := False;
++ Support_64_Bit_Divides : constant Boolean := True;
++ Support_Aggregates : constant Boolean := True;
++ Support_Composite_Assign : constant Boolean := True;
++ Support_Composite_Compare : constant Boolean := True;
++ Support_Long_Shifts : constant Boolean := True;
++ Always_Compatible_Rep : constant Boolean := False;
++ Suppress_Standard_Library : constant Boolean := False;
++ Use_Ada_Main_Program_Name : constant Boolean := False;
++ ZCX_By_Default : constant Boolean := True;
++ GCC_ZCX_Support : constant Boolean := True;
++
++end System;
+--- /dev/null
++++ gcc/ada/system-openbsd-x86_64.ads
+@@ -0,0 +1,147 @@
++------------------------------------------------------------------------------
++-- --
++-- GNAT RUN-TIME COMPONENTS --
++-- --
++-- S Y S T E M --
++-- --
++-- S p e c --
++-- (DragonFly BSD/x86_64 Version) --
++-- --
++-- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
++-- --
++-- This specification is derived from the Ada Reference Manual for use with --
++-- GNAT. The copyright notice above, and the license provisions that follow --
++-- apply solely to the contents of the part following the private keyword. --
++-- --
++-- GNAT is free software; you can redistribute it and/or modify it under --
++-- terms of the GNU General Public License as published by the Free Soft- --
++-- ware Foundation; either version 3, or (at your option) any later ver- --
++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
++-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
++-- or FITNESS FOR A PARTICULAR PURPOSE. --
++-- --
++-- As a special exception under Section 7 of GPL version 3, you are granted --
++-- additional permissions described in the GCC Runtime Library Exception, --
++-- version 3.1, as published by the Free Software Foundation. --
++-- --
++-- You should have received a copy of the GNU General Public License and --
++-- a copy of the GCC Runtime Library Exception along with this program; --
++-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
++-- <http://www.gnu.org/licenses/>. --
++-- --
++-- GNAT was originally developed by the GNAT team at New York University. --
++-- Extensive contributions were provided by Ada Core Technologies Inc. --
++-- --
++-- Copyright (C) 2010 John Marino <draco@marino.st> --
++------------------------------------------------------------------------------
++
++package System is
++ pragma Pure;
++ -- Note that we take advantage of the implementation permission to make
++ -- this unit Pure instead of Preelaborable; see RM 13.7.1(15). In Ada
++ -- 2005, this is Pure in any case (AI-362).
++
++ type Name is (SYSTEM_NAME_GNAT);
++ System_Name : constant Name := SYSTEM_NAME_GNAT;
++
++ -- System-Dependent Named Numbers
++
++ Min_Int : constant := Long_Long_Integer'First;
++ Max_Int : constant := Long_Long_Integer'Last;
++
++ Max_Binary_Modulus : constant := 2 ** Long_Long_Integer'Size;
++ Max_Nonbinary_Modulus : constant := 2 ** Integer'Size - 1;
++
++ Max_Base_Digits : constant := Long_Long_Float'Digits;
++ Max_Digits : constant := Long_Long_Float'Digits;
++
++ Max_Mantissa : constant := 63;
++ Fine_Delta : constant := 2.0 ** (-Max_Mantissa);
++
++ Tick : constant := 0.000_001;
++
++ -- Storage-related Declarations
++
++ type Address is private;
++ pragma Preelaborable_Initialization (Address);
++ Null_Address : constant Address;
++
++ Storage_Unit : constant := 8;
++ Word_Size : constant := 64;
++ Memory_Size : constant := 2 ** 64;
++
++ -- Address comparison
++
++ function "<" (Left, Right : Address) return Boolean;
++ function "<=" (Left, Right : Address) return Boolean;
++ function ">" (Left, Right : Address) return Boolean;
++ function ">=" (Left, Right : Address) return Boolean;
++ function "=" (Left, Right : Address) return Boolean;
++
++ pragma Import (Intrinsic, "<");
++ pragma Import (Intrinsic, "<=");
++ pragma Import (Intrinsic, ">");
++ pragma Import (Intrinsic, ">=");
++ pragma Import (Intrinsic, "=");
++
++ -- Other System-Dependent Declarations
++
++ type Bit_Order is (High_Order_First, Low_Order_First);
++ Default_Bit_Order : constant Bit_Order := Low_Order_First;
++ pragma Warnings (Off, Default_Bit_Order); -- kill constant condition warning
++
++ -- Priority-related Declarations (RM D.1)
++
++ Max_Priority : constant Positive := 30;
++ Max_Interrupt_Priority : constant Positive := 31;
++
++ subtype Any_Priority is Integer range 0 .. 31;
++ subtype Priority is Any_Priority range 0 .. 30;
++ subtype Interrupt_Priority is Any_Priority range 31 .. 31;
++
++ Default_Priority : constant Priority := 15;
++
++private
++
++ type Address is mod Memory_Size;
++ Null_Address : constant Address := 0;
++
++ --------------------------------------
++ -- System Implementation Parameters --
++ --------------------------------------
++
++ -- These parameters provide information about the target that is used
++ -- by the compiler. They are in the private part of System, where they
++ -- can be accessed using the special circuitry in the Targparm unit
++ -- whose source should be consulted for more detailed descriptions
++ -- of the individual switch values.
++
++ Backend_Divide_Checks : constant Boolean := False;
++ Backend_Overflow_Checks : constant Boolean := True;
++ Command_Line_Args : constant Boolean := True;
++ Configurable_Run_Time : constant Boolean := False;
++ Denorm : constant Boolean := True;
++ Duration_32_Bits : constant Boolean := False;
++ Exit_Status_Supported : constant Boolean := True;
++ Fractional_Fixed_Ops : constant Boolean := False;
++ Frontend_Layout : constant Boolean := False;
++ Machine_Overflows : constant Boolean := False;
++ Machine_Rounds : constant Boolean := True;
++ OpenVMS : constant Boolean := False;
++ Preallocated_Stacks : constant Boolean := False;
++ Signed_Zeros : constant Boolean := True;
++ Stack_Check_Default : constant Boolean := False;
++ Stack_Check_Probes : constant Boolean := True;
++ Stack_Check_Limits : constant Boolean := False;
++ Support_64_Bit_Divides : constant Boolean := True;
++ Support_Aggregates : constant Boolean := True;
++ Support_Composite_Assign : constant Boolean := True;
++ Support_Composite_Compare : constant Boolean := True;
++ Support_Long_Shifts : constant Boolean := True;
++ Always_Compatible_Rep : constant Boolean := True;
++ Suppress_Standard_Library : constant Boolean := False;
++ Use_Ada_Main_Program_Name : constant Boolean := False;
++ ZCX_By_Default : constant Boolean := False;
++ GCC_ZCX_Support : constant Boolean := False;
++
++end System;
+--- /dev/null
++++ gcc/ada/system-openbsd-x86.ads
+@@ -0,0 +1,147 @@
++------------------------------------------------------------------------------
++-- --
++-- GNAT RUN-TIME COMPONENTS --
++-- --
++-- S Y S T E M --
++-- --
++-- S p e c --
++-- (DragonFly BSD/x86 Version) --
++-- --
++-- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
++-- --
++-- This specification is derived from the Ada Reference Manual for use with --
++-- GNAT. The copyright notice above, and the license provisions that follow --
++-- apply solely to the contents of the part following the private keyword. --
++-- --
++-- GNAT is free software; you can redistribute it and/or modify it under --
++-- terms of the GNU General Public License as published by the Free Soft- --
++-- ware Foundation; either version 3, or (at your option) any later ver- --
++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
++-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
++-- or FITNESS FOR A PARTICULAR PURPOSE. --
++-- --
++-- As a special exception under Section 7 of GPL version 3, you are granted --
++-- additional permissions described in the GCC Runtime Library Exception, --
++-- version 3.1, as published by the Free Software Foundation. --
++-- --
++-- You should have received a copy of the GNU General Public License and --
++-- a copy of the GCC Runtime Library Exception along with this program; --
++-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
++-- <http://www.gnu.org/licenses/>. --
++-- --
++-- GNAT was originally developed by the GNAT team at New York University. --
++-- Extensive contributions were provided by Ada Core Technologies Inc. --
++-- --
++-- Copyright (C) 2010 John Marino <draco@marino.st> --
++------------------------------------------------------------------------------
++
++package System is
++ pragma Pure;
++ -- Note that we take advantage of the implementation permission to make
++ -- this unit Pure instead of Preelaborable; see RM 13.7.1(15). In Ada
++ -- 2005, this is Pure in any case (AI-362).
++
++ type Name is (SYSTEM_NAME_GNAT);
++ System_Name : constant Name := SYSTEM_NAME_GNAT;
++
++ -- System-Dependent Named Numbers
++
++ Min_Int : constant := Long_Long_Integer'First;
++ Max_Int : constant := Long_Long_Integer'Last;
++
++ Max_Binary_Modulus : constant := 2 ** Long_Long_Integer'Size;
++ Max_Nonbinary_Modulus : constant := 2 ** Integer'Size - 1;
++
++ Max_Base_Digits : constant := Long_Long_Float'Digits;
++ Max_Digits : constant := Long_Long_Float'Digits;
++
++ Max_Mantissa : constant := 63;
++ Fine_Delta : constant := 2.0 ** (-Max_Mantissa);
++
++ Tick : constant := 0.000_001;
++
++ -- Storage-related Declarations
++
++ type Address is private;
++ pragma Preelaborable_Initialization (Address);
++ Null_Address : constant Address;
++
++ Storage_Unit : constant := 8;
++ Word_Size : constant := 32;
++ Memory_Size : constant := 2 ** 32;
++
++ -- Address comparison
++
++ function "<" (Left, Right : Address) return Boolean;
++ function "<=" (Left, Right : Address) return Boolean;
++ function ">" (Left, Right : Address) return Boolean;
++ function ">=" (Left, Right : Address) return Boolean;
++ function "=" (Left, Right : Address) return Boolean;
++
++ pragma Import (Intrinsic, "<");
++ pragma Import (Intrinsic, "<=");
++ pragma Import (Intrinsic, ">");
++ pragma Import (Intrinsic, ">=");
++ pragma Import (Intrinsic, "=");
++
++ -- Other System-Dependent Declarations
++
++ type Bit_Order is (High_Order_First, Low_Order_First);
++ Default_Bit_Order : constant Bit_Order := Low_Order_First;
++ pragma Warnings (Off, Default_Bit_Order); -- kill constant condition warning
++
++ -- Priority-related Declarations (RM D.1)
++
++ Max_Priority : constant Positive := 30;
++ Max_Interrupt_Priority : constant Positive := 31;
++
++ subtype Any_Priority is Integer range 0 .. 31;
++ subtype Priority is Any_Priority range 0 .. 30;
++ subtype Interrupt_Priority is Any_Priority range 31 .. 31;
++
++ Default_Priority : constant Priority := 15;
++
++private
++
++ type Address is mod Memory_Size;
++ Null_Address : constant Address := 0;
++
++ --------------------------------------
++ -- System Implementation Parameters --
++ --------------------------------------
++
++ -- These parameters provide information about the target that is used
++ -- by the compiler. They are in the private part of System, where they
++ -- can be accessed using the special circuitry in the Targparm unit
++ -- whose source should be consulted for more detailed descriptions
++ -- of the individual switch values.
++
++ Backend_Divide_Checks : constant Boolean := False;
++ Backend_Overflow_Checks : constant Boolean := True;
++ Command_Line_Args : constant Boolean := True;
++ Configurable_Run_Time : constant Boolean := False;
++ Denorm : constant Boolean := True;
++ Duration_32_Bits : constant Boolean := False;
++ Exit_Status_Supported : constant Boolean := True;
++ Fractional_Fixed_Ops : constant Boolean := False;
++ Frontend_Layout : constant Boolean := False;
++ Machine_Overflows : constant Boolean := False;
++ Machine_Rounds : constant Boolean := True;
++ OpenVMS : constant Boolean := False;
++ Preallocated_Stacks : constant Boolean := False;
++ Signed_Zeros : constant Boolean := True;
++ Stack_Check_Default : constant Boolean := False;
++ Stack_Check_Probes : constant Boolean := True;
++ Stack_Check_Limits : constant Boolean := False;
++ Support_64_Bit_Divides : constant Boolean := True;
++ Support_Aggregates : constant Boolean := True;
++ Support_Composite_Assign : constant Boolean := True;
++ Support_Composite_Compare : constant Boolean := True;
++ Support_Long_Shifts : constant Boolean := True;
++ Always_Compatible_Rep : constant Boolean := True;
++ Suppress_Standard_Library : constant Boolean := False;
++ Use_Ada_Main_Program_Name : constant Boolean := False;
++ ZCX_By_Default : constant Boolean := False;
++ GCC_ZCX_Support : constant Boolean := False;
++
++end System;
+--- gcc/ada/tracebak.c.orig
++++ gcc/ada/tracebak.c
+@@ -199,24 +199,10 @@
+
+ */
+
+-/*--------------------------- Darwin 8 or newer ----------------------------*/
+-#if defined (__APPLE__) \
+- && defined (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) \
+- && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1040
+-
+-#define USE_GCC_UNWINDER
++/*--------------------------- PPC AIX/Darwin ----------------------------*/
+
+-#if defined (__i386__) || defined (__x86_64__)
+-#define PC_ADJUST -2
+-#elif defined (__ppc__) || defined (__ppc64__)
+-#define PC_ADJUST -4
+-#else
+-#error Unhandled darwin architecture.
+-#endif
+-
+-/*------------------------ PPC AIX/Older Darwin -------------------------*/
+-#elif ((defined (_POWER) && defined (_AIX)) \
+- || (defined (__APPLE__) && defined (__ppc__)))
++#if ((defined (_POWER) && defined (_AIX)) || \
++(defined (__ppc__) && defined (__APPLE__)))
+
+ #define USE_GENERIC_UNWINDER
+
+@@ -304,6 +290,24 @@
+ window of frame N-1 (positive offset from fp), in which we retrieve the
+ saved return address. We then end up with our caller's return address. */
+
++/*---------------------------- x86 *BSD --------------------------------*/
++
++#elif defined (__i386__) && \
++ ( defined (__NetBSD__) \
++ || defined (__FreeBSD__) \
++ || defined (__OpenBSD__) \
++ || defined (__DragonFly__) )
++
++#define USE_GCC_UNWINDER
++/* The generic unwinder is not used for this target because the default
++ implementation doesn't unwind on the BSD platforms. AMD64 targets use the
++ gcc unwinder for all platforms, so let's keep i386 consistent with that.
++*/
++
++#define PC_ADJUST -2
++/* The minimum size of call instructions on this architecture is 2 bytes */
++
++
+ /*------------------------------- x86 ----------------------------------*/
+
+ #elif defined (i386)
+--- gcc/ada/gcc-interface/Makefile.in.orig
++++ gcc/ada/gcc-interface/Makefile.in
+@@ -1,5 +1,6 @@
+ # Makefile for GNU Ada Compiler (GNAT).
+ # Copyright (C) 1994-2010 Free Software Foundation, Inc.
++# Copyright (C) 2010, 2011 John Marino <www.dragonlace.net>
+
+ #This file is part of GCC.
+
+@@ -1010,6 +1011,7 @@
+ a-numaux.adb<a-numaux-x86.adb \
+ a-numaux.ads<a-numaux-x86.ads \
+ a-intnam.ads<a-intnam-solaris.ads \
++ g-trasym.adb<g-trasym-bsd.adb \
+ s-inmaop.adb<s-inmaop-posix.adb \
+ s-intman.adb<s-intman-solaris.adb \
+ s-osinte.adb<s-osinte-solaris.adb \
+@@ -1171,17 +1173,24 @@
+ LIBRARY_VERSION := $(LIB_VERSION)
+ endif
+
++
++# FREEBSD i386
++# TOOL_TARGET_PAIRS probably does nothing, moved to gnattools/configure.ac
+ ifeq ($(strip $(filter-out %86 freebsd%,$(arch) $(osys))),)
+ LIBGNAT_TARGET_PAIRS = \
++ a-exetim.adb<a-exetim-posix.adb \
++ a-exetim.ads<a-exetim-default.ads \
+ a-intnam.ads<a-intnam-freebsd.ads \
+ a-numaux.adb<a-numaux-x86.adb \
+ a-numaux.ads<a-numaux-x86.ads \
+ g-bytswa.adb<g-bytswa-x86.adb \
++ g-socthi.adb<g-socthi-bsd.adb \
++ g-trasym.adb<g-trasym-bsd.adb \
+ s-inmaop.adb<s-inmaop-posix.adb \
+ s-intman.adb<s-intman-posix.adb \
+ s-osinte.adb<s-osinte-freebsd.adb \
+- s-osinte.ads<s-osinte-freebsd.ads \
+- s-osprim.adb<s-osprim-posix.adb \
++ s-osinte.ads<s-osinte-freebsd32.ads \
++ s-osprim.adb<s-osprim-bsd32.adb \
+ s-taprop.adb<s-taprop-posix.adb \
+ s-taspri.ads<s-taspri-posix.ads \
+ s-tpopsp.adb<s-tpopsp-posix.adb \
+@@ -1191,12 +1200,324 @@
+ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb
+ GNATLIB_SHARED = gnatlib-shared-dual
+
++ EXTRA_GNATRTL_NONTASKING_OBJS=g-sse.o g-ssvety.o
++ EXTRA_GNATRTL_TASKING_OBJS=a-exetim.o
++
++ EH_MECHANISM=-gcc
++ THREADSLIB= -lpthread
++ GMEM_LIB = gmemlib
++ LIBRARY_VERSION := $(LIB_VERSION)
++endif
++
++
++# FREEBSD AMD64
++# TOOL_TARGET_PAIRS probably does nothing, moved to gnattools/configure.ac
++ifeq ($(strip $(filter-out x86_64 freebsd%,$(arch) $(osys))),)
++ LIBGNAT_TARGET_PAIRS = \
++ a-exetim.adb<a-exetim-posix.adb \
++ a-exetim.ads<a-exetim-default.ads \
++ a-intnam.ads<a-intnam-freebsd.ads \
++ a-numaux.adb<a-numaux-x86.adb \
++ a-numaux.ads<a-numaux-x86.ads \
++ g-bytswa.adb<g-bytswa-x86.adb \
++ g-socthi.adb<g-socthi-bsd.adb \
++ g-trasym.adb<g-trasym-bsd.adb \
++ s-inmaop.adb<s-inmaop-posix.adb \
++ s-intman.adb<s-intman-posix.adb \
++ s-osinte.adb<s-osinte-freebsd.adb \
++ s-osinte.ads<s-osinte-freebsd64.ads \
++ s-osprim.adb<s-osprim-bsd64.adb \
++ s-taprop.adb<s-taprop-posix.adb \
++ s-taspri.ads<s-taspri-posix.ads \
++ s-tpopsp.adb<s-tpopsp-posix.adb \
++ system.ads<system-freebsd-x86_64.ads
++
++ TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb
++ GNATLIB_SHARED = gnatlib-shared-dual
++
++ EXTRA_GNATRTL_NONTASKING_OBJS=g-sse.o g-ssvety.o
++ EXTRA_GNATRTL_TASKING_OBJS=a-exetim.o
++
++ EH_MECHANISM=-gcc
++ THREADSLIB= -lpthread
++ GMEM_LIB = gmemlib
++ LIBRARY_VERSION := $(LIB_VERSION)
++endif
++
++
++# DRAGONFLY i386
++# TOOL_TARGET_PAIRS probably does nothing, moved to gnattools/configure.ac
++ifeq ($(strip $(filter-out %86 dragonfly%,$(arch) $(osys))),)
++ LIBGNAT_TARGET_PAIRS = \
++ a-exetim.adb<a-exetim-posix.adb \
++ a-exetim.ads<a-exetim-default.ads \
++ a-intnam.ads<a-intnam-dragonfly.ads \
++ a-numaux.adb<a-numaux-x86.adb \
++ a-numaux.ads<a-numaux-x86.ads \
++ g-bytswa.adb<g-bytswa-x86.adb \
++ g-socthi.adb<g-socthi-bsd.adb \
++ g-trasym.adb<g-trasym-bsd.adb \
++ s-inmaop.adb<s-inmaop-posix.adb \
++ s-intman.adb<s-intman-posix.adb \
++ s-osinte.adb<s-osinte-dragonfly.adb \
++ s-osinte.ads<s-osinte-dragonfly.ads \
++ s-osprim.adb<s-osprim-posix.adb \
++ s-taprop.adb<s-taprop-posix.adb \
++ s-taspri.ads<s-taspri-posix.ads \
++ s-tpopsp.adb<s-tpopsp-posix.adb \
++ system.ads<system-dragonfly-x86.ads
++
++ TOOLS_TARGET_PAIRS = \
++ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb
++ GNATLIB_SHARED = gnatlib-shared-dual
++
++ EXTRA_GNATRTL_NONTASKING_OBJS=g-sse.o g-ssvety.o
++ EXTRA_GNATRTL_TASKING_OBJS=a-exetim.o
++
++ EH_MECHANISM=-gcc
++ THREADSLIB= -lpthread
++ GMEM_LIB = gmemlib
++ LIBRARY_VERSION := $(LIB_VERSION)
++endif
++
++
++# DRAGONFLY AMD64
++# TOOL_TARGET_PAIRS probably does nothing, moved to gnattools/configure.ac
++ifeq ($(strip $(filter-out x86_64 dragonfly%,$(arch) $(osys))),)
++ LIBGNAT_TARGET_PAIRS = \
++ a-exetim.adb<a-exetim-posix.adb \
++ a-exetim.ads<a-exetim-default.ads \
++ a-intnam.ads<a-intnam-dragonfly.ads \
++ a-numaux.adb<a-numaux-x86.adb \
++ a-numaux.ads<a-numaux-x86.ads \
++ g-bytswa.adb<g-bytswa-x86.adb \
++ g-socthi.adb<g-socthi-bsd.adb \
++ g-trasym.adb<g-trasym-bsd.adb \
++ s-inmaop.adb<s-inmaop-posix.adb \
++ s-intman.adb<s-intman-posix.adb \
++ s-osinte.adb<s-osinte-dragonfly.adb \
++ s-osinte.ads<s-osinte-dragonfly.ads \
++ s-osprim.adb<s-osprim-posix.adb \
++ s-taprop.adb<s-taprop-posix.adb \
++ s-taspri.ads<s-taspri-posix.ads \
++ s-tpopsp.adb<s-tpopsp-posix.adb \
++ system.ads<system-dragonfly-x86_64.ads
++
++ TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb
++ GNATLIB_SHARED = gnatlib-shared-dual
++
++ EXTRA_GNATRTL_NONTASKING_OBJS=g-sse.o g-ssvety.o
++ EXTRA_GNATRTL_TASKING_OBJS=a-exetim.o
++
++ EH_MECHANISM=-gcc
++ THREADSLIB= -lpthread
++ GMEM_LIB = gmemlib
++ LIBRARY_VERSION := $(LIB_VERSION)
++endif
++
++
++# OPENBSD i386
++# TOOL_TARGET_PAIRS probably does nothing, moved to gnattools/configure.ac
++ifeq ($(strip $(filter-out %86 openbsd%,$(arch) $(osys))),)
++ LIBGNAT_TARGET_PAIRS = \
++ a-exetim.adb<a-exetim-posix.adb \
++ a-exetim.ads<a-exetim-default.ads \
++ a-intnam.ads<a-intnam-openbsd.ads \
++ a-numaux.adb<a-numaux-x86.adb \
++ a-numaux.ads<a-numaux-x86.ads \
++ g-bytswa.adb<g-bytswa-x86.adb \
++ g-socthi.adb<g-socthi-bsd.adb \
++ g-trasym.adb<g-trasym-bsd.adb \
++ s-inmaop.adb<s-inmaop-posix.adb \
++ s-intman.adb<s-intman-posix.adb \
++ s-osinte.adb<s-osinte-openbsd.adb \
++ s-osinte.ads<s-osinte-openbsd.ads \
++ s-osprim.adb<s-osprim-bsd32.adb \
++ s-taprop.adb<s-taprop-posix.adb \
++ s-taspri.ads<s-taspri-posix.ads \
++ s-tpopsp.adb<s-tpopsp-posix.adb \
++ system.ads<system-openbsd-x86.ads
++
++ TOOLS_TARGET_PAIRS = \
++ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb
++ GNATLIB_SHARED = gnatlib-shared-dual
++
++ EXTRA_GNATRTL_NONTASKING_OBJS=g-sse.o g-ssvety.o
++ EXTRA_GNATRTL_TASKING_OBJS=a-exetim.o
++
++ EH_MECHANISM=
++ THREADSLIB= -lpthread
++ GMEM_LIB =
++ LIBRARY_VERSION := $(LIB_VERSION)
++endif
++
++
++# OPENBSD AMD64
++# TOOL_TARGET_PAIRS probably does nothing, moved to gnattools/configure.ac
++ifeq ($(strip $(filter-out x86_64 openbsd%,$(arch) $(osys))),)
++ LIBGNAT_TARGET_PAIRS = \
++ a-exetim.adb<a-exetim-posix.adb \
++ a-exetim.ads<a-exetim-default.ads \
++ a-intnam.ads<a-intnam-openbsd.ads \
++ a-numaux.adb<a-numaux-x86.adb \
++ a-numaux.ads<a-numaux-x86.ads \
++ g-bytswa.adb<g-bytswa-x86.adb \
++ g-socthi.adb<g-socthi-bsd.adb \
++ g-trasym.adb<g-trasym-bsd.adb \
++ s-inmaop.adb<s-inmaop-posix.adb \
++ s-intman.adb<s-intman-posix.adb \
++ s-osinte.adb<s-osinte-openbsd.adb \
++ s-osinte.ads<s-osinte-openbsd.ads \
++ s-osprim.adb<s-osprim-bsd32.adb \
++ s-taprop.adb<s-taprop-posix.adb \
++ s-taspri.ads<s-taspri-posix.ads \
++ s-tpopsp.adb<s-tpopsp-posix.adb \
++ system.ads<system-openbsd-x86_64.ads
++
++ TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb
++ GNATLIB_SHARED = gnatlib-shared-dual
++
++ EXTRA_GNATRTL_NONTASKING_OBJS=g-sse.o g-ssvety.o
++ EXTRA_GNATRTL_TASKING_OBJS=a-exetim.o
++
++ EH_MECHANISM=
++ THREADSLIB= -lpthread
++ GMEM_LIB =
++ LIBRARY_VERSION := $(LIB_VERSION)
++endif
++
++
++# NETBSD i386 (5+ only)
++# TOOL_TARGET_PAIRS probably does nothing, moved to gnattools/configure.ac
++ifeq ($(strip $(filter-out %86 netbsd%,$(arch) $(osys))),)
++ LIBGNAT_TARGET_PAIRS = \
++ a-exetim.adb<a-exetim-posix.adb \
++ a-exetim.ads<a-exetim-default.ads \
++ a-intnam.ads<a-intnam-netbsd.ads \
++ a-numaux.adb<a-numaux-x86.adb \
++ a-numaux.ads<a-numaux-x86.ads \
++ g-bytswa.adb<g-bytswa-x86.adb \
++ g-socthi.adb<g-socthi-netbsd.adb \
++ g-trasym.adb<g-trasym-bsd.adb \
++ s-inmaop.adb<s-inmaop-posix.adb \
++ s-intman.adb<s-intman-posix.adb \
++ s-osinte.adb<s-osinte-netbsd.adb \
++ s-taprop.adb<s-taprop-posix.adb \
++ s-taspri.ads<s-taspri-posix.ads \
++ s-tpopsp.adb<s-tpopsp-posix.adb \
++ system.ads<system-netbsd-x86.ads
++
++ ifeq ($(strip $(filter-out %86 netbsdelf5%,$(arch) $(osys))),)
++ LIBGNAT_TARGET_PAIRS+= \
++ s-osinte.ads<s-osinte-netbsd.ads \
++ s-osprim.adb<s-osprim-bsd32.adb
++ else
++ LIBGNAT_TARGET_PAIRS+= \
++ g-socthi.ads<g-socthi-netbsd6.ads \
++ s-osinte.ads<s-osinte-netbsd6.ads \
++ s-osprim.adb<s-osprim-bsdn6.adb
++ endif
++
++ TOOLS_TARGET_PAIRS = \
++ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb
++ GNATLIB_SHARED = gnatlib-shared-dual
++
++ EXTRA_GNATRTL_NONTASKING_OBJS=g-sse.o g-ssvety.o
++ EXTRA_GNATRTL_TASKING_OBJS=a-exetim.o
++
+ EH_MECHANISM=-gcc
+ THREADSLIB= -lpthread
+ GMEM_LIB = gmemlib
+ LIBRARY_VERSION := $(LIB_VERSION)
+ endif
+
++
++# NETBSD AMD64 (5+ only)
++# TOOL_TARGET_PAIRS probably does nothing, moved to gnattools/configure.ac
++ifeq ($(strip $(filter-out x86_64 netbsd%,$(arch) $(osys))),)
++ LIBGNAT_TARGET_PAIRS = \
++ a-exetim.adb<a-exetim-posix.adb \
++ a-exetim.ads<a-exetim-default.ads \
++ a-intnam.ads<a-intnam-netbsd.ads \
++ a-numaux.adb<a-numaux-x86.adb \
++ a-numaux.ads<a-numaux-x86.ads \
++ g-bytswa.adb<g-bytswa-x86.adb \
++ g-socthi.adb<g-socthi-netbsd.adb \
++ g-trasym.adb<g-trasym-bsd.adb \
++ s-inmaop.adb<s-inmaop-posix.adb \
++ s-intman.adb<s-intman-posix.adb \
++ s-osinte.adb<s-osinte-netbsd.adb \
++ s-taprop.adb<s-taprop-posix.adb \
++ s-taspri.ads<s-taspri-posix.ads \
++ s-tpopsp.adb<s-tpopsp-posix.adb \
++ system.ads<system-netbsd-x86_64.ads
++
++ ifeq ($(strip $(filter-out x86_64 netbsd5%,$(arch) $(osys))),)
++ LIBGNAT_TARGET_PAIRS+= \
++ s-osinte.ads<s-osinte-netbsd.ads \
++ s-osprim.adb<s-osprim-bsd32.adb
++ else
++ LIBGNAT_TARGET_PAIRS+= \
++ g-socthi.ads<g-socthi-netbsd6.ads \
++ s-osinte.ads<s-osinte-netbsd6.ads \
++ s-osprim.adb<s-osprim-bsdn6.adb
++ endif
++
++ TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb
++ GNATLIB_SHARED = gnatlib-shared-dual
++
++ EXTRA_GNATRTL_NONTASKING_OBJS=g-sse.o g-ssvety.o
++ EXTRA_GNATRTL_TASKING_OBJS=a-exetim.o
++
++ EH_MECHANISM=-gcc
++ THREADSLIB= -lpthread
++ GMEM_LIB = gmemlib
++ LIBRARY_VERSION := $(LIB_VERSION)
++endif
++
++
++# ANDROID (ARM)
++# TOOL_TARGET_PAIRS probably does nothing, moved to gnattools/configure.ac
++ifeq ($(strip $(filter-out arm% android eabi,$(targ))),)
++ LIBGNAT_TARGET_PAIRS = \
++ a-intnam.ads<a-intnam-linux.ads \
++ g-trasym.ads<g-trasym-unimplemented.ads \
++ g-trasym.adb<g-trasym-unimplemented.adb \
++ s-inmaop.adb<s-inmaop-posix.adb \
++ s-intman.adb<s-intman-posix.adb \
++ s-linux.ads<s-linux.ads \
++ s-osinte.adb<s-osinte-posix.adb \
++ s-osinte.ads<s-osinte-android.ads \
++ s-osprim.adb<s-osprim-posix.adb \
++ s-taprop.adb<s-taprop-linux.adb \
++ s-tasinf.ads<s-tasinf-linux.ads \
++ s-tasinf.adb<s-tasinf-linux.adb \
++ s-taspri.ads<s-taspri-posix-noaltstack.ads \
++ s-tpopsp.adb<s-tpopsp-posix-foreign.adb
++
++ ifeq ($(strip $(filter-out arm%b,$(arch))),)
++ LIBGNAT_TARGET_PAIRS += \
++ system.ads<system-linux-armeb.ads
++ else
++ LIBGNAT_TARGET_PAIRS += \
++ system.ads<system-linux-armel.ads
++ endif
++
++ TOOLS_TARGET_PAIRS = \
++ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
++ indepsw.adb<indepsw-gnu.adb
++
++ EXTRA_LIBGNAT_SRCS+= signal_android.c
++ EXTRA_LIBGNAT_OBJS+= signal_android.o
++ EXTRA_GNATRTL_TASKING_OBJS= s-linux.o
++ EH_MECHANISM=
++ THREADSLIB=
++ GNATLIB_SHARED= gnatlib-shared-dual
++ GMEM_LIB= gmemlib
++ LIBRARY_VERSION:= $(LIB_VERSION)
++endif
++
++
+ ifeq ($(strip $(filter-out s390% linux%,$(arch) $(osys))),)
+ LIBGNAT_TARGET_PAIRS_COMMON = \
+ a-intnam.ads<a-intnam-linux.ads \
+--- gnattools/configure.orig
++++ gnattools/configure
+@@ -5,6 +5,7 @@
+ # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+ # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
+ # Foundation, Inc.
++# Copyright (C) 2010 John Marino <draco@marino.st>
+ #
+ # This configure script is free software; the Free Software Foundation
+ # gives unlimited permission to copy, distribute and modify it.
+@@ -2058,7 +2059,27 @@
+ s390*-*-linux*)
+ TOOLS_TARGET_PAIRS="mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb"
+ ;;
+- *86-*-freebsd*)
++ *86-*-freebsd* | x86_64-*-freebsd*)
++ TOOLS_TARGET_PAIRS="\
++ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
++ indepsw.adb<indepsw-gnu.adb"
++ ;;
++ *86-*-dragonfly* | x86_64-*-dragonfly*)
++ TOOLS_TARGET_PAIRS="\
++ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
++ indepsw.adb<indepsw-gnu.adb"
++ ;;
++ *86-*-openbsd* | x86_64-*-openbsd*)
++ TOOLS_TARGET_PAIRS="\
++ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
++ indepsw.adb<indepsw-gnu.adb"
++ ;;
++ *86-*-netbsdelf* | x86_64-*-netbsd*)
++ TOOLS_TARGET_PAIRS="\
++ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
++ indepsw.adb<indepsw-gnu.adb"
++ ;;
++ arm*-android-eabi)
+ TOOLS_TARGET_PAIRS="\
+ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
+ indepsw.adb<indepsw-gnu.adb"
+--- gnattools/configure.ac.orig
++++ gnattools/configure.ac
+@@ -1,5 +1,6 @@
+ # Configure script for libada.
+ # Copyright 2003, 2004, 2009 Free Software Foundation, Inc.
++# Copyright 2010 John Marino <draco@marino.st>
+ #
+ # This file is free software; you can redistribute it and/or modify it
+ # under the terms of the GNU General Public License as published by
+@@ -98,7 +99,27 @@
+ s390*-*-linux*)
+ TOOLS_TARGET_PAIRS="mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb"
+ ;;
+- *86-*-freebsd*)
++ *86-*-freebsd* | x86_64-*-freebsd*)
++ TOOLS_TARGET_PAIRS="\
++ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
++ indepsw.adb<indepsw-gnu.adb"
++ ;;
++ *86-*-dragonfly* | x86_64-*-dragonfly*)
++ TOOLS_TARGET_PAIRS="\
++ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
++ indepsw.adb<indepsw-gnu.adb"
++ ;;
++ *86-*-openbsd* | x86_64-*-openbsd*)
++ TOOLS_TARGET_PAIRS="\
++ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
++ indepsw.adb<indepsw-gnu.adb"
++ ;;
++ *86-*-netbsdelf* | x86_64-*-netbsd*)
++ TOOLS_TARGET_PAIRS="\
++ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
++ indepsw.adb<indepsw-gnu.adb"
++ ;;
++ arm*-android-eabi)
+ TOOLS_TARGET_PAIRS="\
+ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
+ indepsw.adb<indepsw-gnu.adb"
diff --git a/lang/gnat-aux/files/diff-ada-testsuite b/lang/gnat-aux/files/diff-ada-testsuite
new file mode 100644
index 000000000000..e6b3c87938c0
--- /dev/null
+++ b/lang/gnat-aux/files/diff-ada-testsuite
@@ -0,0 +1,190 @@
+--- gcc/testsuite/ada/acats/run_acats.orig
++++ gcc/testsuite/ada/acats/run_acats
+@@ -5,20 +5,6 @@
+ exit 1
+ fi
+
+-# Provide which replacement.
+-#
+-# type -p is missing from Solaris 2 /bin/sh and /bin/ksh (ksh88), but both
+-# ksh93 and bash have it.
+-# type output format differs between ksh88 and ksh93, so avoid it if
+-# type -p is present. Unfortunately, HP-UX /bin/sh ignores -p with type.
+-# Fall back to whence which ksh88 and ksh93 provide, but bash does not.
+-
+-which () {
+- path=`type -p $* 2>/dev/null` && { echo $path | awk '{print $NF}'; return 0; }
+- path=`type $* 2>/dev/null` && { echo $path | awk '{print $NF}'; return 0; }
+- path=`whence $* 2>/dev/null` && { echo $path; return 0; }
+- return 1
+-}
+
+ # Set up environment to use the Ada compiler from the object tree
+
+--- gcc/testsuite/ada/acats/run_all.sh.orig
++++ gcc/testsuite/ada/acats/run_all.sh
+@@ -35,6 +35,14 @@
+ echo "$@" >> $dir/acats.log
+ }
+
++inform () {
++ printf "%04d %7s" $1 $2
++}
++
++disinform () {
++ printf "\r"
++}
++
+ dir=`${PWDCMD-pwd}`
+
+ if [ "$testdir" = "" ]; then
+@@ -197,6 +205,18 @@
+ glob_countn=0
+ glob_countok=0
+ glob_countu=0
++countdown=0
++
++for chapter in $chapters; do
++ if [ -d $dir/tests/$chapter ]; then
++ cd $dir/tests/$chapter
++ ls *.a *.ada *.adt *.am *.dep 2> /dev/null | sed -e 's/\(.*\)\..*/\1/g' | \
++ cut -c1-7 | sort | uniq | comm -23 - $dir/support/norun.lst \
++ > $dir/tests/$chapter/${chapter}.lst
++ countn=`wc -l < $dir/tests/$chapter/${chapter}.lst`
++ countdown=`expr $countdown + $countn`
++ fi
++done
+
+ for chapter in $chapters; do
+ display Running chapter $chapter ...
+@@ -207,10 +227,6 @@
+ continue
+ fi
+
+- cd $dir/tests/$chapter
+- ls *.a *.ada *.adt *.am *.dep 2> /dev/null | sed -e 's/\(.*\)\..*/\1/g' | \
+- cut -c1-7 | sort | uniq | comm -23 - $dir/support/norun.lst \
+- > $dir/tests/$chapter/${chapter}.lst
+ countn=`wc -l < $dir/tests/$chapter/${chapter}.lst`
+ glob_countn=`expr $glob_countn + $countn`
+ counti=0
+@@ -233,10 +249,13 @@
+ if [ $? -eq 0 ]; then
+ extraflags="$extraflags -gnat95"
+ fi
++ inform $countdown $i
++ countdown=`expr $countdown - 1`
+ test=$dir/tests/$chapter/$i
+ mkdir $test && cd $test >> $dir/acats.log 2>&1
+
+ if [ $? -ne 0 ]; then
++ disinform
+ display "FAIL: $i"
+ failed="${failed}${i} "
+ clean_dir
+@@ -260,6 +279,7 @@
+ cxh1001) extraflags="-a -f"; echo "pragma Normalize_Scalars;" > gnat.adc
+ esac
+ if [ "$main" = "" ]; then
++ disinform
+ display "FAIL: $i"
+ failed="${failed}${i} "
+ clean_dir
+@@ -268,6 +288,7 @@
+
+ target_gnatmake $extraflags -I$dir/support $main >> $dir/acats.log 2>&1
+ if [ $? -ne 0 ]; then
++ disinform
+ display "FAIL: $i"
+ failed="${failed}${i} "
+ clean_dir
+@@ -282,6 +303,7 @@
+ target_run $dir/tests/$chapter/$i/$binmain > $dir/tests/$chapter/$i/${i}.log 2>&1
+ cd $dir/tests/$chapter/$i
+ cat ${i}.log >> $dir/acats.log
++ disinform
+ egrep -e '(==== |\+\+\+\+ |\!\!\!\! )' ${i}.log > /dev/null 2>&1
+ if [ $? -ne 0 ]; then
+ grep 'tasking not implemented' ${i}.log > /dev/null 2>&1
+--- gcc/testsuite/gnat.dg/test_raise_from_pure.adb.orig
++++ gcc/testsuite/gnat.dg/test_raise_from_pure.adb
+@@ -1,4 +1,4 @@
+--- { dg-do run { xfail arm*-*-* } }
++-- { dg-do run { xfail arm*-*-* *-*-openbsd* } }
+ -- { dg-options "-O2" }
+
+ -- This is an optimization test and its failure is only a missed optimization.
+--- /dev/null
++++ gcc/testsuite/gnat.dg/unchecked_convert5.txt
+@@ -0,0 +1,9 @@
++The test "unchecked_converted5.adb" was deleted because it only
++supportes the following targets:
++
++ hppa*
++ sparc*
++ powerpc*
++
++Currently I'm not working with any of those, so until that changes, the
++test will be absent to lower the "unsupported" test number.
+--- /dev/null
++++ gcc/testsuite/gnat.dg/unchecked_convert6.txt
+@@ -0,0 +1,9 @@
++The test "unchecked_converted6.adb" was deleted because it only
++supportes the following targets:
++
++ hppa*
++ sparc*
++ powerpc*
++
++Currently I'm not working with any of those, so until that changes, the
++test will be absent to lower the "unsupported" test number.
+--- gcc/testsuite/gnat.dg/unchecked_convert5.adb
++++ /dev/null
+@@ -1,22 +0,0 @@
+--- { dg-do run { target hppa*-*-* sparc*-*-* powerpc*-*-* } }
+-
+-with Unchecked_Conversion;
+-
+-procedure Unchecked_Convert5 is
+-
+- subtype c_1 is string(1..1);
+-
+- function int2c1 is -- { dg-warning "different sizes" }
+- new unchecked_conversion (source => integer, target => c_1);
+-
+- c1 : c_1;
+-
+-begin
+-
+- c1 := int2c1(16#12#);
+-
+- if c1 (1) /= ASCII.Nul then
+- raise Program_Error;
+- end if;
+-
+-end;
+--- gcc/testsuite/gnat.dg/unchecked_convert6.adb
++++ /dev/null
+@@ -1,22 +0,0 @@
+--- { dg-do run { target hppa*-*-* sparc*-*-* powerpc*-*-* } }
+-
+-with Unchecked_Conversion;
+-
+-procedure Unchecked_Convert6 is
+-
+- subtype c_5 is string(1..5);
+-
+- function int2c5 is -- { dg-warning "different sizes" }
+- new unchecked_conversion (source => integer, target => c_5);
+-
+- c5 : c_5;
+-
+-begin
+-
+- c5 := int2c5(16#12#);
+-
+- if c5 (4) /= ASCII.DC2 then
+- raise Program_Error;
+- end if;
+-
+-end;
diff --git a/lang/gnat-aux/files/diff-core b/lang/gnat-aux/files/diff-core
new file mode 100644
index 000000000000..d6392393d3c2
--- /dev/null
+++ b/lang/gnat-aux/files/diff-core
@@ -0,0 +1,1903 @@
+--- gcc/config.gcc.orig
++++ gcc/config.gcc
+@@ -529,7 +529,7 @@
+ extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
+ fbsd_major=`echo ${target} | sed -e 's/.*freebsd//g' | sed -e 's/\..*//g'`
+ tm_defines="${tm_defines} FBSD_MAJOR=${fbsd_major}"
+- tmake_file="t-slibgcc-elf-ver t-freebsd"
++ tmake_file="t-slibgcc-elf-ver t-libc-ok t-libgcc-pic t-exceptions"
+ case ${enable_threads} in
+ no)
+ fbsd_tm_file="${fbsd_tm_file} freebsd-nthr.h"
+@@ -545,6 +545,9 @@
+ ;;
+ esac
+ ;;
++ gnat | single)
++ # Let these non-posix thread selections fall through if requested
++ ;;
+ *)
+ echo 'Unknown thread configuration for FreeBSD'
+ exit 1
+@@ -561,6 +564,39 @@
+ # need_64bit_hwint=yes # system compiler has this for all arch!
+ use_gcc_stdint=wrap
+ ;;
++*-*-dragonfly*)
++ gas=yes
++ gnu_ld=yes
++ extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
++ tmake_file="t-slibgcc-elf-ver t-libc-ok t-libgcc-pic t-exceptions"
++ case ${enable_threads} in
++ "" | yes | posix)
++ thread_file='posix'
++ ;;
++ no | gnat | single)
++ # Let these non-posix thread selections fall through if requested
++ ;;
++ *)
++ echo 'Unknown thread configuration for DragonFly BSD'
++ exit 1
++ ;;
++ esac
++ extra_options="$extra_options rpath.opt dragonfly.opt"
++ default_use_cxa_atexit=yes
++ ;;
++*-android-eabi*)
++ extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o"
++ gas=yes
++ gnu_ld=yes
++ case ${enable_threads} in
++ "" | yes | posix) thread_file='posix' ;;
++ esac
++ tm_defines="$tm_defines DEFAULT_LIBC=LIBC_BIONIC ANDROID_DEFAULT=1"
++ extra_options="$extra_options linux.opt linux-android.opt"
++ default_use_cxa_atexit=yes
++ use_gcc_tgmath=no
++ use_gcc_stdint=wrap
++ ;;
+ *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu)
+ extra_options="$extra_options gnu-user.opt"
+ extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o"
+@@ -618,9 +654,11 @@
+ esac
+ ;;
+ *-*-netbsd*)
+- tmake_file="t-slibgcc-elf-ver t-libc-ok t-netbsd t-libgcc-pic"
++ tmake_file="t-slibgcc-elf-ver t-libc-ok t-libgcc-pic t-exceptions"
+ gas=yes
+ gnu_ld=yes
++ nbsd_major=`echo ${target} | sed -e 's/.*netbsd\(elf\)\{0,1\}//g' | sed -e 's/\..*//g'`
++ tm_defines="${tm_defines} NBSD_MAJOR=${nbsd_major}"
+
+ # NetBSD 2.0 and later get POSIX threads enabled by default.
+ # Allow them to be explicitly enabled on any other version.
+@@ -657,12 +695,22 @@
+ esac
+ ;;
+ *-*-openbsd*)
++ gas=yes
++ gnu_ld=yes
++ # Do NOT add crt*.o extra parts!
+ tmake_file="t-libc-ok t-openbsd t-libgcc-pic"
+ case ${enable_threads} in
+- yes)
++ "" | yes | posix)
+ thread_file='posix'
+ tmake_file="${tmake_file} t-openbsd-thread"
+ ;;
++ no | gnat | single)
++ # Let these non-posix thread selections fall through
++ ;;
++ *)
++ echo 'Unknown thread configuration for OpenBSD'
++ exit 1
++ ;;
+ esac
+ case ${target} in
+ *-*-openbsd2.*|*-*-openbsd3.[012])
+@@ -793,6 +841,24 @@
+ tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
+ extra_parts="crtinit.o crtfini.o"
+ ;;
++arm*-android-eabi*)
++ case $target in
++ arm*b-*)
++ tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
++ ;;
++ esac
++ tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h"
++ tm_file="$tm_file arm/elf.h arm/linux-gas.h arm/linux-elf.h arm/bpabi.h arm/linux-eabi.h"
++ tm_file="$tm_file ../../libgcc/config/arm/bpabi-lib.h arm/aout.h arm/arm.h"
++
++ tmake_file="t-slibgcc-elf-ver t-linux arm/t-arm"
++ tmake_file="$tmake_file arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi t-slibgcc-libgcc"
++ tmake_file="$tmake_file arm/t-linux-androideabi arm/t-arm-softfp soft-fp/t-softfp"
++
++ # The BPABI long long divmod functions return a 128-bit value in registers r0-r3.
++ # Correctly modeling that requires the use of TImode.
++ need_64bit_hwint=yes
++ ;;
+ arm-wrs-vxworks)
+ tm_file="elfos.h arm/elf.h arm/aout.h ${tm_file} vx-common.h vxworks.h arm/vxworks.h"
+ extra_options="${extra_options} arm/vxworks.opt"
+@@ -1219,9 +1285,18 @@
+ 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"
+ tmake_file="${tmake_file} i386/t-crtstuff"
+ ;;
++i[34567]86-*-dragonfly*)
++ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h dragonfly.h dragonfly-stdint.h i386/dragonfly.h"
++ tmake_file="${tmake_file} i386/t-crtstuff"
++ ;;
++x86_64-*-dragonfly*)
++ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h dragonfly.h dragonfly-stdint.h i386/x86-64.h i386/dragonfly.h i386/dragonfly64.h"
++ tmake_file="${tmake_file} i386/t-crtstuff"
++ ;;
+ 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 netbsd-stdint.h"
+ extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
++ tmake_file="${tmake_file} i386/t-crtstuff"
+ ;;
+ i[34567]86-*-netbsd*)
+ tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h netbsd.h netbsd-aout.h i386/netbsd.h"
+@@ -1231,7 +1306,7 @@
+ use_collect2=yes
+ ;;
+ 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 netbsd-stdint.h"
+ extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
+ tmake_file="${tmake_file} i386/t-crtstuff"
+ ;;
+@@ -1247,8 +1322,12 @@
+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h"
+ tm_file="${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h i386/openbsdelf.h"
+ extra_options="${extra_options} openbsd.opt"
+- gas=yes
+- gnu_ld=yes
++ ;;
++x86_64-*-openbsd*)
++ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h"
++ tm_file="${tm_file} openbsd.h openbsd-libpthread.h i386/x86-64.h i386/openbsd64.h exec-stack.h"
++ extra_options="${extra_options} openbsd.opt"
++ tmake_file="${tmake_file} i386/t-crtstuff"
+ ;;
+ i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | i[34567]86-*-gnu* | i[34567]86-*-kopensolaris*-gnu)
+ # Intel 80386's running GNU/*
+@@ -3673,6 +3752,11 @@
+ i[34567]86-*-freebsd* | x86_64-*-freebsd*)
+ tmake_file="${tmake_file} i386/t-fprules-softfp soft-fp/t-softfp"
+ ;;
++ i[34567]86-*-dragonfly* | x86_64-*-dragonfly*)
++ tmake_file="${tmake_file} i386/t-fprules-softfp soft-fp/t-softfp"
++ ;;
++ i[34567]86-*-openbsd* | x86_64-*-openbsd*)
++ ;;
+ ia64*-*-linux*)
+ tmake_file="${tmake_file} ia64/t-fprules-softfp soft-fp/t-softfp"
+ ;;
+--- gcc/crtstuff.c.orig
++++ gcc/crtstuff.c
+@@ -79,11 +79,19 @@
+ }
+ #endif
+
++#if defined(TARGET_DL_ITERATE_PHDR) && \
++ ( defined(__FreeBSD__) \
++ || defined(__OpenBSD__) \
++ || defined(__NetBSD__) \
++ || defined(__DragonFly__))
++#define BSD_DL_ITERATE_PHDR_AVAILABLE
++#endif
++
+ #if defined(OBJECT_FORMAT_ELF) \
+ && !defined(OBJECT_FORMAT_FLAT) \
+ && defined(HAVE_LD_EH_FRAME_HDR) \
+ && !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \
+- && defined(__FreeBSD__) && __FreeBSD__ >= 7
++ && defined(BSD_DL_ITERATE_PHDR_AVAILABLE)
+ #include <link.h>
+ # define USE_PT_GNU_EH_FRAME
+ #endif
+--- gcc/DEV-PHASE.orig
++++ gcc/DEV-PHASE
+@@ -0,0 +1 @@
++release
+--- gcc/unwind-dw2-fde-glibc.c.orig
++++ gcc/unwind-dw2-fde-glibc.c
+@@ -53,13 +53,21 @@
+ #endif
+
+ #if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
+- && defined(__FreeBSD__) && __FreeBSD__ >= 7
++ && defined(TARGET_DL_ITERATE_PHDR) \
++ && (defined(__FreeBSD__) || defined(__DragonFly__))
+ # define ElfW __ElfN
+ # define USE_PT_GNU_EH_FRAME
+ #endif
+
+ #if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
+ && defined(TARGET_DL_ITERATE_PHDR) \
++ && (defined(__OpenBSD__) || defined(__NetBSD__))
++# define ElfW(n) Elf_##n
++# define USE_PT_GNU_EH_FRAME
++#endif
++
++#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
++ && defined(TARGET_DL_ITERATE_PHDR) \
+ && defined(__sun__) && defined(__svr4__)
+ # define USE_PT_GNU_EH_FRAME
+ #endif
+--- /dev/null
++++ gcc/config/dragonfly-stdint.h
+@@ -0,0 +1,56 @@
++/* Definitions for <stdint.h> types for DragonFly systems.
++ Copyright (C) 2009 Free Software Foundation, Inc.
++ Contributed by Gerald Pfeifer <gerald@pfeifer.com>.
++
++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.
++
++Under Section 7 of GPL version 3, you are granted additional
++permissions described in the GCC Runtime Library Exception, version
++3.1, as published by the Free Software Foundation.
++
++You should have received a copy of the GNU General Public License and
++a copy of the GCC Runtime Library Exception along with this program;
++see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
++<http://www.gnu.org/licenses/>. */
++
++#define SIG_ATOMIC_TYPE "int"
++
++#define INT8_TYPE "signed char"
++#define INT16_TYPE "short int"
++#define INT32_TYPE "int"
++#define INT64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int")
++#define UINT8_TYPE "unsigned char"
++#define UINT16_TYPE "short unsigned int"
++#define UINT32_TYPE "unsigned int"
++#define UINT64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int")
++
++#define INT_LEAST8_TYPE INT8_TYPE
++#define INT_LEAST16_TYPE INT16_TYPE
++#define INT_LEAST32_TYPE INT32_TYPE
++#define INT_LEAST64_TYPE INT64_TYPE
++#define UINT_LEAST8_TYPE UINT8_TYPE
++#define UINT_LEAST16_TYPE UINT16_TYPE
++#define UINT_LEAST32_TYPE UINT32_TYPE
++#define UINT_LEAST64_TYPE UINT64_TYPE
++
++#define INT_FAST8_TYPE INT32_TYPE
++#define INT_FAST16_TYPE INT32_TYPE
++#define INT_FAST32_TYPE INT32_TYPE
++#define INT_FAST64_TYPE INT64_TYPE
++#define UINT_FAST8_TYPE UINT32_TYPE
++#define UINT_FAST16_TYPE UINT32_TYPE
++#define UINT_FAST32_TYPE UINT32_TYPE
++#define UINT_FAST64_TYPE UINT64_TYPE
++
++#define INTPTR_TYPE (LONG_TYPE_SIZE == 64 ? INT64_TYPE : INT32_TYPE)
++#define UINTPTR_TYPE (LONG_TYPE_SIZE == 64 ? UINT64_TYPE : UINT32_TYPE)
+--- /dev/null
++++ gcc/config/dragonfly.h
+@@ -0,0 +1,141 @@
++/* Base configuration file for all DragonFly targets.
++ Copyright (C) 1999, 2000, 2001, 2007, 2008 Free Software Foundation, Inc.
++ Copyright (C) 2010-2012 John R. Marino <www.dragonlace.net>
++
++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/>. */
++
++/* Common DragonFly configuration.
++ All DragonFly architectures should include this file, which will specify
++ their commonalities.
++
++ Adapted from gcc/config/freebsd.h by
++ Joerg Sonnenberger <joerg@bec.de>
++
++ Adapted from gcc/config/i386/freebsd-elf.h by
++ David O'Brien <obrien@FreeBSD.org>.
++ Further work by David O'Brien <obrien@FreeBSD.org> and
++ Loren J. Rittle <ljrittle@acm.org>. */
++
++/* JRM: 15 Nov 2010
++ SWITCH_TAKES_ARG & WORD_SWITCH_TAKES_ARG removed due to poisoning.
++ http://gcc.gnu.org/ml/gcc-patches/2010-10/msg02102.html
++ http://gcc.gnu.org/ml/gcc-patches/2010-10/msg02373.html */
++
++#undef TARGET_OS_CPP_BUILTINS
++#define TARGET_OS_CPP_BUILTINS() \
++ do \
++ { \
++ builtin_define_std ("unix"); \
++ builtin_define ("__DragonFly__"); \
++ builtin_assert ("system=unix"); \
++ builtin_assert ("system=bsd"); \
++ builtin_assert ("system=DragonFly"); \
++ } \
++ while (0)
++
++#undef CPP_SPEC
++#define CPP_SPEC \
++ "%(cpp_cpu) %(cpp_arch) %{posix:-D_POSIX_SOURCE}"
++
++#undef STARTFILE_SPEC
++#define STARTFILE_SPEC \
++ "%{!shared: \
++ %{pg:gcrt1.o%s} \
++ %{!pg: \
++ %{p:gcrt1.o%s} \
++ %{!p: \
++ %{profile: gcrt1.o%s} \
++ %{!profile: \
++ %{pie: Scrt1.o%s;:crt1.o%s}}}}} \
++ crti.o%s \
++ %{shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
++
++#undef ENDFILE_SPEC
++#define ENDFILE_SPEC \
++ "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
++
++#undef LIB_SPEC
++#define LIB_SPEC \
++ "%{pthread:-lpthread} -lc"
++
++/* Provide a LINK_SPEC appropriate for DragonFly. Here we provide support
++ for the special GCC options -static and -shared, which allow us to
++ link things in one of these three modes by applying the appropriate
++ combinations of options at link-time.
++
++ When the -shared link option is used a final link is not being
++ done. */
++
++#define DFBSD_LINK_SPEC \
++ "%{p:%nconsider using '-pg' instead of '-p' with gprof(1)} \
++ %{v:-V} \
++ %{assert*} %{R*} %{rpath*} %{defsym*} \
++ %{shared:-Bshareable %{h*} %{soname*}} \
++ %{!shared: \
++ %{!static: \
++ %{rdynamic:-export-dynamic} \
++ -dynamic-linker %(dfbsd_dynamic_linker) } \
++ %{static:-Bstatic}} \
++ %{symbolic:-Bsymbolic}"
++
++#undef LINK_SPEC
++#define LINK_SPEC DFBSD_LINK_SPEC
++
++#define DFBSD_DYNAMIC_LINKER \
++ "/usr/libexec/ld-elf.so.2"
++
++#if defined(HAVE_LD_EH_FRAME_HDR)
++#define LINK_EH_SPEC \
++ "%{!static:--eh-frame-hdr}"
++#endif
++
++/* Use --as-needed -lgcc_s for eh support. */
++#ifdef HAVE_LD_AS_NEEDED
++#define USE_LD_AS_NEEDED 1
++#endif
++
++/************************[ Target stuff ]***********************************/
++
++/* All DragonFly Architectures support the ELF object file format. */
++#undef OBJECT_FORMAT_ELF
++#define OBJECT_FORMAT_ELF
++
++/* Don't assume anything about the header files. */
++#undef NO_IMPLICIT_EXTERN_C
++#define NO_IMPLICIT_EXTERN_C 1
++
++/* Follow DragonFly's standard headers (<machine/stdint.h>, etc...). */
++
++#undef WCHAR_TYPE
++#define WCHAR_TYPE "int"
++
++#undef WINT_TYPE
++#define WINT_TYPE "int"
++
++#define MATH_LIBRARY_PROFILE "m_p"
++
++/* Code generation parameters. */
++
++/* Use periods rather than dollar signs in special g++ assembler names.
++ This ensures the configuration knows our system correctly so we can link
++ with libraries compiled with the native cc. */
++#undef NO_DOLLAR_IN_LABEL
++
++/* Used by libgcc2.c. We support file locking with fcntl / F_SETLKW.
++ This enables the test coverage code to use file locking when exiting a
++ program, which avoids race conditions if the program has forked. */
++#define TARGET_POSIX_IO
+--- /dev/null
++++ gcc/config/dragonfly.opt
+@@ -0,0 +1,59 @@
++; DragonFlyBSD options.
++
++; Copyright (C) 2010
++; 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/>.
++
++; See the GCC internals manual (options.texi) for a description of this file's format.
++
++; Please try to keep this file in ASCII collating order.
++
++assert
++Driver Separate
++
++assert=
++Driver JoinedOrMissing
++
++defsym
++Driver Separate
++
++defsym=
++Driver JoinedOrMissing
++
++profile
++Driver
++
++pthread
++Driver
++
++rpath-link
++Driver Separate
++
++rpath-link=
++Driver JoinedOrMissing
++
++rpath=
++Driver JoinedOrMissing
++
++soname
++Driver Separate
++
++soname=
++Driver JoinedOrMissing
++
++; This comment is to ensure we retain the blank line above.
+--- /dev/null
++++ gcc/config/exec-stack.h
+@@ -0,0 +1,41 @@
++/* 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"); \
++}
++
+--- /dev/null
++++ gcc/config/netbsd-stdint.h
+@@ -0,0 +1,56 @@
++/* Definitions for <stdint.h> types for NetBSD systems.
++ Copyright (C) 2009 Free Software Foundation, Inc.
++ Contributed by Gerald Pfeifer <gerald@pfeifer.com>.
++
++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.
++
++Under Section 7 of GPL version 3, you are granted additional
++permissions described in the GCC Runtime Library Exception, version
++3.1, as published by the Free Software Foundation.
++
++You should have received a copy of the GNU General Public License and
++a copy of the GCC Runtime Library Exception along with this program;
++see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
++<http://www.gnu.org/licenses/>. */
++
++#define SIG_ATOMIC_TYPE "int"
++
++#define INT8_TYPE "signed char"
++#define INT16_TYPE "short int"
++#define INT32_TYPE "int"
++#define INT64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int")
++#define UINT8_TYPE "unsigned char"
++#define UINT16_TYPE "short unsigned int"
++#define UINT32_TYPE "unsigned int"
++#define UINT64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int")
++
++#define INT_LEAST8_TYPE INT8_TYPE
++#define INT_LEAST16_TYPE INT16_TYPE
++#define INT_LEAST32_TYPE INT32_TYPE
++#define INT_LEAST64_TYPE INT64_TYPE
++#define UINT_LEAST8_TYPE UINT8_TYPE
++#define UINT_LEAST16_TYPE UINT16_TYPE
++#define UINT_LEAST32_TYPE UINT32_TYPE
++#define UINT_LEAST64_TYPE UINT64_TYPE
++
++#define INT_FAST8_TYPE INT32_TYPE
++#define INT_FAST16_TYPE INT32_TYPE
++#define INT_FAST32_TYPE INT32_TYPE
++#define INT_FAST64_TYPE INT64_TYPE
++#define UINT_FAST8_TYPE UINT32_TYPE
++#define UINT_FAST16_TYPE UINT32_TYPE
++#define UINT_FAST32_TYPE UINT32_TYPE
++#define UINT_FAST64_TYPE UINT64_TYPE
++
++#define INTPTR_TYPE (LONG_TYPE_SIZE == 64 ? INT64_TYPE : INT32_TYPE)
++#define UINTPTR_TYPE (LONG_TYPE_SIZE == 64 ? UINT64_TYPE : UINT32_TYPE)
+--- gcc/config/netbsd.h.orig
++++ gcc/config/netbsd.h
+@@ -22,7 +22,7 @@
+ #define NETBSD_OS_CPP_BUILTINS_COMMON() \
+ do \
+ { \
+- builtin_define ("__NetBSD__"); \
++ builtin_define_with_int_value ("__NetBSD__", NBSD_MAJOR); \
+ builtin_define ("__unix__"); \
+ builtin_assert ("system=bsd"); \
+ builtin_assert ("system=unix"); \
+--- /dev/null
++++ gcc/config/t-exceptions
+@@ -0,0 +1,7 @@
++# Use unwind-dw2-fde-glibc
++# Required to utilize dl_iterate_phdr functionality
++
++LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-glibc.c \
++ $(srcdir)/unwind-sjlj.c $(srcdir)/gthr-gnat.c $(srcdir)/unwind-c.c
++LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h unwind-dw2-fde.c
++
+--- gcc/config/t-openbsd-thread.orig
++++ gcc/config/t-openbsd-thread
+@@ -1,3 +1,3 @@
+ # This is currently needed to compile libgcc2 for threads support
+-TARGET_LIBGCC2_CFLAGS=-pthread
++TARGET_LIBGCC2_CFLAGS += -pthread
+
+--- /dev/null
++++ gcc/config/i386/dragonfly-unwind.h
+@@ -0,0 +1,158 @@
++/* DWARF2 EH unwinding support for DragonFly BSD: AMD x86-64 and x86.
++ Copyright (C) 2010 John Marino <draco@marino.st> */
++
++/* Do code reading to identify a signal frame, and set the frame
++ state data appropriately. See unwind-dw2.c for the structs. */
++
++#include <sys/types.h>
++#include <sys/sysctl.h>
++#include <signal.h>
++#include <sys/ucontext.h>
++#include <machine/sigframe.h>
++
++
++#define REG_NAME(reg) sf_uc.uc_mcontext.mc_## reg
++
++#ifdef __x86_64__
++#define MD_FALLBACK_FRAME_STATE_FOR x86_64_dragonfly_fallback_frame_state
++
++
++static void
++x86_64_sigtramp_range (unsigned char **start, unsigned char **end)
++{
++ unsigned long ps_strings;
++ int mib[2];
++ size_t len;
++
++ mib[0] = CTL_KERN;
++ mib[1] = KERN_PS_STRINGS;
++ len = sizeof (ps_strings);
++ sysctl (mib, 2, &ps_strings, &len, NULL, 0);
++
++ *start = (unsigned char *)ps_strings - 32;
++ *end = (unsigned char *)ps_strings;
++}
++
++
++static _Unwind_Reason_Code
++x86_64_dragonfly_fallback_frame_state
++(struct _Unwind_Context *context, _Unwind_FrameState *fs)
++{
++ unsigned char *pc = context->ra;
++ unsigned char *sigtramp_start, *sigtramp_end;
++ struct sigframe *sf;
++ long new_cfa;
++
++ x86_64_sigtramp_range(&sigtramp_start, &sigtramp_end);
++ if (pc >= sigtramp_end || pc < sigtramp_start)
++ return _URC_END_OF_STACK;
++
++ sf = (struct sigframe *) context->cfa;
++ new_cfa = sf->REG_NAME(rsp);
++ fs->regs.cfa_how = CFA_REG_OFFSET;
++ /* Register 7 is rsp */
++ fs->regs.cfa_reg = 7;
++ fs->regs.cfa_offset = new_cfa - (long) context->cfa;
++
++ /* The SVR4 register numbering macros aren't usable in libgcc. */
++ fs->regs.reg[0].how = REG_SAVED_OFFSET;
++ fs->regs.reg[0].loc.offset = (long)&sf->REG_NAME(rax) - new_cfa;
++ fs->regs.reg[1].how = REG_SAVED_OFFSET;
++ fs->regs.reg[1].loc.offset = (long)&sf->REG_NAME(rdx) - new_cfa;
++ fs->regs.reg[2].how = REG_SAVED_OFFSET;
++ fs->regs.reg[2].loc.offset = (long)&sf->REG_NAME(rcx) - new_cfa;
++ fs->regs.reg[3].how = REG_SAVED_OFFSET;
++ fs->regs.reg[3].loc.offset = (long)&sf->REG_NAME(rbx) - new_cfa;
++ fs->regs.reg[4].how = REG_SAVED_OFFSET;
++ fs->regs.reg[4].loc.offset = (long)&sf->REG_NAME(rsi) - new_cfa;
++ fs->regs.reg[5].how = REG_SAVED_OFFSET;
++ fs->regs.reg[5].loc.offset = (long)&sf->REG_NAME(rdi) - new_cfa;
++ fs->regs.reg[6].how = REG_SAVED_OFFSET;
++ fs->regs.reg[6].loc.offset = (long)&sf->REG_NAME(rbp) - new_cfa;
++ fs->regs.reg[8].how = REG_SAVED_OFFSET;
++ fs->regs.reg[8].loc.offset = (long)&sf->REG_NAME(r8) - new_cfa;
++ fs->regs.reg[9].how = REG_SAVED_OFFSET;
++ fs->regs.reg[9].loc.offset = (long)&sf->REG_NAME(r9) - new_cfa;
++ fs->regs.reg[10].how = REG_SAVED_OFFSET;
++ fs->regs.reg[10].loc.offset = (long)&sf->REG_NAME(r10) - new_cfa;
++ fs->regs.reg[11].how = REG_SAVED_OFFSET;
++ fs->regs.reg[11].loc.offset = (long)&sf->REG_NAME(r11) - new_cfa;
++ fs->regs.reg[12].how = REG_SAVED_OFFSET;
++ fs->regs.reg[12].loc.offset = (long)&sf->REG_NAME(r12) - new_cfa;
++ fs->regs.reg[13].how = REG_SAVED_OFFSET;
++ fs->regs.reg[13].loc.offset = (long)&sf->REG_NAME(r13) - new_cfa;
++ fs->regs.reg[14].how = REG_SAVED_OFFSET;
++ fs->regs.reg[14].loc.offset = (long)&sf->REG_NAME(r14) - new_cfa;
++ fs->regs.reg[15].how = REG_SAVED_OFFSET;
++ fs->regs.reg[15].loc.offset = (long)&sf->REG_NAME(r15) - new_cfa;
++ fs->regs.reg[16].how = REG_SAVED_OFFSET;
++ fs->regs.reg[16].loc.offset = (long)&sf->REG_NAME(rip) - new_cfa;
++ fs->retaddr_column = 16;
++ fs->signal_frame = 1;
++ return _URC_NO_REASON;
++}
++
++#else /* Next section is for i386 */
++
++#define MD_FALLBACK_FRAME_STATE_FOR x86_dragonfly_fallback_frame_state
++
++
++static void
++x86_sigtramp_range (unsigned char **start, unsigned char **end)
++{
++ unsigned long ps_strings;
++ int mib[2];
++ size_t len;
++
++ mib[0] = CTL_KERN;
++ mib[1] = KERN_PS_STRINGS;
++ len = sizeof (ps_strings);
++ sysctl (mib, 2, &ps_strings, &len, NULL, 0);
++
++ *start = (unsigned char *)ps_strings - 128;
++ *end = (unsigned char *)ps_strings;
++}
++
++
++static _Unwind_Reason_Code
++x86_dragonfly_fallback_frame_state
++(struct _Unwind_Context *context, _Unwind_FrameState *fs)
++{
++ unsigned char *pc = context->ra;
++ unsigned char *sigtramp_start, *sigtramp_end;
++ struct sigframe *sf;
++ long new_cfa;
++
++ x86_sigtramp_range(&sigtramp_start, &sigtramp_end);
++
++ if (pc >= sigtramp_end || pc < sigtramp_start)
++ return _URC_END_OF_STACK;
++
++ sf = (struct sigframe *) context->cfa;
++ new_cfa = sf->REG_NAME(esp);
++ fs->regs.cfa_how = CFA_REG_OFFSET;
++ fs->regs.cfa_reg = 4;
++ fs->regs.cfa_offset = new_cfa - (long) context->cfa;
++
++ /* The SVR4 register numbering macros aren't usable in libgcc. */
++ fs->regs.reg[0].how = REG_SAVED_OFFSET;
++ fs->regs.reg[0].loc.offset = (long)&sf->REG_NAME(eax) - new_cfa;
++ fs->regs.reg[3].how = REG_SAVED_OFFSET;
++ fs->regs.reg[3].loc.offset = (long)&sf->REG_NAME(ebx) - new_cfa;
++ fs->regs.reg[1].how = REG_SAVED_OFFSET;
++ fs->regs.reg[1].loc.offset = (long)&sf->REG_NAME(ecx) - new_cfa;
++ fs->regs.reg[2].how = REG_SAVED_OFFSET;
++ fs->regs.reg[2].loc.offset = (long)&sf->REG_NAME(edx) - new_cfa;
++ fs->regs.reg[6].how = REG_SAVED_OFFSET;
++ fs->regs.reg[6].loc.offset = (long)&sf->REG_NAME(esi) - new_cfa;
++ fs->regs.reg[7].how = REG_SAVED_OFFSET;
++ fs->regs.reg[7].loc.offset = (long)&sf->REG_NAME(edi) - new_cfa;
++ fs->regs.reg[5].how = REG_SAVED_OFFSET;
++ fs->regs.reg[5].loc.offset = (long)&sf->REG_NAME(ebp) - new_cfa;
++ fs->regs.reg[8].how = REG_SAVED_OFFSET;
++ fs->regs.reg[8].loc.offset = (long)&sf->REG_NAME(eip) - new_cfa;
++ fs->retaddr_column = 8;
++ fs->signal_frame = 1;
++ return _URC_NO_REASON;
++}
++#endif /* ifdef __x86_64__ */
+--- /dev/null
++++ gcc/config/i386/dragonfly.h
+@@ -0,0 +1,107 @@
++/* Definitions for Intel 386 running DragonFly with ELF format
++ Copyright (C) 1996, 2000, 2002, 2004, 2007 Free Software Foundation, Inc.
++ Contributed by Eric Youngdale.
++ Modified for stabs-in-ELF by H.J. Lu.
++ Adapted from GNU/Linux version by John Polstra.
++ Continued development by David O'Brien <obrien@freebsd.org>
++ Copyright (C) 2010, 2011 John Marino <www.dragonlace.net>
++
++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/>. */
++
++
++#define TARGET_VERSION fprintf (stderr, " (i386 DragonFly/ELF)");
++
++/* Override the default comment-starter of "/". */
++#undef ASM_COMMENT_START
++#define ASM_COMMENT_START "#"
++
++#undef ASM_APP_ON
++#define ASM_APP_ON "#APP\n"
++
++#undef ASM_APP_OFF
++#define ASM_APP_OFF "#NO_APP\n"
++
++#undef DBX_REGISTER_NUMBER
++#define DBX_REGISTER_NUMBER(n) \
++ (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n])
++
++#undef NO_PROFILE_COUNTERS
++#define NO_PROFILE_COUNTERS 1
++
++/* Tell final.c that we don't need a label passed to mcount. */
++
++#undef MCOUNT_NAME
++#define MCOUNT_NAME ".mcount"
++
++/* Make gcc agree with <machine/ansi.h>. */
++
++#undef SIZE_TYPE
++#define SIZE_TYPE (TARGET_64BIT ? "long unsigned int" : "unsigned int")
++
++#undef PTRDIFF_TYPE
++#define PTRDIFF_TYPE (TARGET_64BIT ? "long int" : "int")
++
++#undef WCHAR_TYPE_SIZE
++#define WCHAR_TYPE_SIZE (TARGET_64BIT ? 32 : BITS_PER_WORD)
++
++#undef SUBTARGET_EXTRA_SPECS /* i386.h bogusly defines it. */
++#define SUBTARGET_EXTRA_SPECS \
++ { "dfbsd_dynamic_linker", DFBSD_DYNAMIC_LINKER }
++
++
++/* A C statement to output to the stdio stream FILE an assembler
++ command to advance the location counter to a multiple of 1<<LOG
++ bytes if it is within MAX_SKIP bytes.
++
++ This is used to align code labels according to Intel recommendations. */
++
++#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
++#undef ASM_OUTPUT_MAX_SKIP_ALIGN
++#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE, LOG, MAX_SKIP) \
++ if ((LOG) != 0) { \
++ if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
++ else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \
++ }
++#endif
++
++/* Don't default to pcc-struct-return, we want to retain compatibility with
++ older gcc versions AND pcc-struct-return is nonreentrant.
++ (even though the SVR4 ABI for the i386 says that records and unions are
++ returned in memory). */
++
++#undef DEFAULT_PCC_STRUCT_RETURN
++#define DEFAULT_PCC_STRUCT_RETURN 0
++
++/* DragonFly sets the rounding precision of the FPU to 53 bits, but GNAT
++ resets it to full precision. */
++#undef TARGET_96_ROUND_53_LONG_DOUBLE
++#define TARGET_96_ROUND_53_LONG_DOUBLE 0
++
++/* Put all *tf routines in libgcc. */
++#undef LIBGCC2_HAS_TF_MODE
++#define LIBGCC2_HAS_TF_MODE 1
++#define LIBGCC2_TF_CEXT q
++#define TF_SIZE 113
++
++/* Define this to be nonzero if static stack checking is supported. */
++#define STACK_CHECK_STATIC_BUILTIN 1
++
++/* Support for i386 has been removed from DragonFly for several releases */
++#define SUBTARGET32_DEFAULT_CPU "i486"
++
++/* Define location of OS-specific unwind support configuration. */
++#define MD_UNWIND_SUPPORT "config/i386/dragonfly-unwind.h"
+--- /dev/null
++++ gcc/config/i386/dragonfly64.h
+@@ -0,0 +1,5 @@
++/* Definitions for AMD x86_64 running DragonFly BSD with ELF Format */
++
++#undef TARGET_VERSION
++#define TARGET_VERSION fprintf (stderr, " (x86-64 DragonFly/ELF)");
++
+--- /dev/null
++++ gcc/config/i386/freebsd-unwind.h
+@@ -0,0 +1,184 @@
++/* DWARF2 EH unwinding support for FreeBSD: AMD x86-64 and x86.
++ Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
++ Copyright (C) 2010 John Marino <draco@marino.st>
++
++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.
++
++In addition to the permissions in the GNU General Public License, the
++Free Software Foundation gives you unlimited permission to link the
++compiled version of this file with other programs, and to distribute
++those programs without any restriction coming from the use of this
++file. (The General Public License restrictions do apply in other
++respects; for example, they cover modification of the file, and
++distribution when not linked into another program.)
++
++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, 51 Franklin Street, Fifth Floor,
++Boston, MA 02110-1301, USA. */
++
++/* Do code reading to identify a signal frame, and set the frame
++ state data appropriately. See unwind-dw2.c for the structs. */
++
++#include <sys/types.h>
++#include <sys/sysctl.h>
++#include <signal.h>
++#include <sys/ucontext.h>
++#include <machine/sigframe.h>
++
++
++#define REG_NAME(reg) sf_uc.uc_mcontext.mc_## reg
++
++#ifdef __x86_64__
++#define MD_FALLBACK_FRAME_STATE_FOR x86_64_freebsd_fallback_frame_state
++
++
++static void
++x86_64_sigtramp_range (unsigned char **start, unsigned char **end)
++{
++ unsigned long ps_strings;
++ int mib[2];
++ size_t len;
++
++ mib[0] = CTL_KERN;
++ mib[1] = KERN_PS_STRINGS;
++ len = sizeof (ps_strings);
++ sysctl (mib, 2, &ps_strings, &len, NULL, 0);
++
++ *start = (unsigned char *)ps_strings - 32;
++ *end = (unsigned char *)ps_strings;
++}
++
++
++static _Unwind_Reason_Code
++x86_64_freebsd_fallback_frame_state
++(struct _Unwind_Context *context, _Unwind_FrameState *fs)
++{
++ unsigned char *pc = context->ra;
++ unsigned char *sigtramp_start, *sigtramp_end;
++ struct sigframe *sf;
++ long new_cfa;
++
++ x86_64_sigtramp_range(&sigtramp_start, &sigtramp_end);
++ if (pc >= sigtramp_end || pc < sigtramp_start)
++ return _URC_END_OF_STACK;
++
++ sf = (struct sigframe *) context->cfa;
++ new_cfa = sf->REG_NAME(rsp);
++ fs->regs.cfa_how = CFA_REG_OFFSET;
++ /* Register 7 is rsp */
++ fs->regs.cfa_reg = 7;
++ fs->regs.cfa_offset = new_cfa - (long) context->cfa;
++
++ /* The SVR4 register numbering macros aren't usable in libgcc. */
++ fs->regs.reg[0].how = REG_SAVED_OFFSET;
++ fs->regs.reg[0].loc.offset = (long)&sf->REG_NAME(rax) - new_cfa;
++ fs->regs.reg[1].how = REG_SAVED_OFFSET;
++ fs->regs.reg[1].loc.offset = (long)&sf->REG_NAME(rdx) - new_cfa;
++ fs->regs.reg[2].how = REG_SAVED_OFFSET;
++ fs->regs.reg[2].loc.offset = (long)&sf->REG_NAME(rcx) - new_cfa;
++ fs->regs.reg[3].how = REG_SAVED_OFFSET;
++ fs->regs.reg[3].loc.offset = (long)&sf->REG_NAME(rbx) - new_cfa;
++ fs->regs.reg[4].how = REG_SAVED_OFFSET;
++ fs->regs.reg[4].loc.offset = (long)&sf->REG_NAME(rsi) - new_cfa;
++ fs->regs.reg[5].how = REG_SAVED_OFFSET;
++ fs->regs.reg[5].loc.offset = (long)&sf->REG_NAME(rdi) - new_cfa;
++ fs->regs.reg[6].how = REG_SAVED_OFFSET;
++ fs->regs.reg[6].loc.offset = (long)&sf->REG_NAME(rbp) - new_cfa;
++ fs->regs.reg[8].how = REG_SAVED_OFFSET;
++ fs->regs.reg[8].loc.offset = (long)&sf->REG_NAME(r8) - new_cfa;
++ fs->regs.reg[9].how = REG_SAVED_OFFSET;
++ fs->regs.reg[9].loc.offset = (long)&sf->REG_NAME(r9) - new_cfa;
++ fs->regs.reg[10].how = REG_SAVED_OFFSET;
++ fs->regs.reg[10].loc.offset = (long)&sf->REG_NAME(r10) - new_cfa;
++ fs->regs.reg[11].how = REG_SAVED_OFFSET;
++ fs->regs.reg[11].loc.offset = (long)&sf->REG_NAME(r11) - new_cfa;
++ fs->regs.reg[12].how = REG_SAVED_OFFSET;
++ fs->regs.reg[12].loc.offset = (long)&sf->REG_NAME(r12) - new_cfa;
++ fs->regs.reg[13].how = REG_SAVED_OFFSET;
++ fs->regs.reg[13].loc.offset = (long)&sf->REG_NAME(r13) - new_cfa;
++ fs->regs.reg[14].how = REG_SAVED_OFFSET;
++ fs->regs.reg[14].loc.offset = (long)&sf->REG_NAME(r14) - new_cfa;
++ fs->regs.reg[15].how = REG_SAVED_OFFSET;
++ fs->regs.reg[15].loc.offset = (long)&sf->REG_NAME(r15) - new_cfa;
++ fs->regs.reg[16].how = REG_SAVED_OFFSET;
++ fs->regs.reg[16].loc.offset = (long)&sf->REG_NAME(rip) - new_cfa;
++ fs->retaddr_column = 16;
++ fs->signal_frame = 1;
++ return _URC_NO_REASON;
++}
++
++#else /* Next section is for i386 */
++
++#define MD_FALLBACK_FRAME_STATE_FOR x86_freebsd_fallback_frame_state
++
++
++static void
++x86_sigtramp_range (unsigned char **start, unsigned char **end)
++{
++ unsigned long ps_strings;
++ int mib[2];
++ size_t len;
++
++ mib[0] = CTL_KERN;
++ mib[1] = KERN_PS_STRINGS;
++ len = sizeof (ps_strings);
++ sysctl (mib, 2, &ps_strings, &len, NULL, 0);
++
++ *start = (unsigned char *)ps_strings - 128;
++ *end = (unsigned char *)ps_strings;
++}
++
++
++static _Unwind_Reason_Code
++x86_freebsd_fallback_frame_state
++(struct _Unwind_Context *context, _Unwind_FrameState *fs)
++{
++ unsigned char *pc = context->ra;
++ unsigned char *sigtramp_start, *sigtramp_end;
++ struct sigframe *sf;
++ long new_cfa;
++
++ x86_sigtramp_range(&sigtramp_start, &sigtramp_end);
++
++ if (pc >= sigtramp_end || pc < sigtramp_start)
++ return _URC_END_OF_STACK;
++
++ sf = (struct sigframe *) context->cfa;
++ new_cfa = sf->REG_NAME(esp);
++ fs->regs.cfa_how = CFA_REG_OFFSET;
++ fs->regs.cfa_reg = 4;
++ fs->regs.cfa_offset = new_cfa - (long) context->cfa;
++
++ /* The SVR4 register numbering macros aren't usable in libgcc. */
++ fs->regs.reg[0].how = REG_SAVED_OFFSET;
++ fs->regs.reg[0].loc.offset = (long)&sf->REG_NAME(eax) - new_cfa;
++ fs->regs.reg[3].how = REG_SAVED_OFFSET;
++ fs->regs.reg[3].loc.offset = (long)&sf->REG_NAME(ebx) - new_cfa;
++ fs->regs.reg[1].how = REG_SAVED_OFFSET;
++ fs->regs.reg[1].loc.offset = (long)&sf->REG_NAME(ecx) - new_cfa;
++ fs->regs.reg[2].how = REG_SAVED_OFFSET;
++ fs->regs.reg[2].loc.offset = (long)&sf->REG_NAME(edx) - new_cfa;
++ fs->regs.reg[6].how = REG_SAVED_OFFSET;
++ fs->regs.reg[6].loc.offset = (long)&sf->REG_NAME(esi) - new_cfa;
++ fs->regs.reg[7].how = REG_SAVED_OFFSET;
++ fs->regs.reg[7].loc.offset = (long)&sf->REG_NAME(edi) - new_cfa;
++ fs->regs.reg[5].how = REG_SAVED_OFFSET;
++ fs->regs.reg[5].loc.offset = (long)&sf->REG_NAME(ebp) - new_cfa;
++ fs->regs.reg[8].how = REG_SAVED_OFFSET;
++ fs->regs.reg[8].loc.offset = (long)&sf->REG_NAME(eip) - new_cfa;
++ fs->retaddr_column = 8;
++ fs->signal_frame = 1;
++ return _URC_NO_REASON;
++}
++#endif /* ifdef __x86_64__ */
+--- gcc/config/i386/freebsd.h.orig
++++ gcc/config/i386/freebsd.h
+@@ -5,6 +5,7 @@
+ Modified for stabs-in-ELF by H.J. Lu.
+ Adapted from GNU/Linux version by John Polstra.
+ Continued development by David O'Brien <obrien@freebsd.org>
++ Copyright (C) 2010, 2011 John Marino <www.dragonlace.net>
+
+ This file is part of GCC.
+
+@@ -51,22 +52,22 @@
+
+ #undef SIZE_TYPE
+ #define SIZE_TYPE (TARGET_64BIT ? "long unsigned int" : "unsigned int")
+-
++
+ #undef PTRDIFF_TYPE
+ #define PTRDIFF_TYPE (TARGET_64BIT ? "long int" : "int")
+-
++
+ #undef WCHAR_TYPE_SIZE
+ #define WCHAR_TYPE_SIZE (TARGET_64BIT ? 32 : BITS_PER_WORD)
+
+ #undef SUBTARGET_EXTRA_SPECS /* i386.h bogusly defines it. */
+ #define SUBTARGET_EXTRA_SPECS \
+ { "fbsd_dynamic_linker", FBSD_DYNAMIC_LINKER }
+-
++
+ /* Provide a STARTFILE_SPEC appropriate for FreeBSD. Here we add
+- the magical crtbegin.o file (see crtstuff.c) which provides part
+- of the support for getting C++ file-scope static object constructed
++ the magical crtbegin.o file (see crtstuff.c) which provides part
++ of the support for getting C++ file-scope static object constructed
+ before entering `main'. */
+-
++
+ #undef STARTFILE_SPEC
+ #define STARTFILE_SPEC \
+ "%{!shared: \
+@@ -76,9 +77,9 @@
+ crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
+
+ /* Provide a ENDFILE_SPEC appropriate for FreeBSD. Here we tack on
+- the magical crtend.o file (see crtstuff.c) which provides part of
+- the support for getting C++ file-scope static object constructed
+- before entering `main', followed by a normal "finalizer" file,
++ the magical crtend.o file (see crtstuff.c) which provides part of
++ the support for getting C++ file-scope static object constructed
++ before entering `main', followed by a normal "finalizer" file,
+ `crtn.o'. */
+
+ #undef ENDFILE_SPEC
+@@ -129,10 +130,10 @@
+ #undef DEFAULT_PCC_STRUCT_RETURN
+ #define DEFAULT_PCC_STRUCT_RETURN 0
+
+-/* FreeBSD sets the rounding precision of the FPU to 53 bits. Let the
+- compiler get the contents of <float.h> and std::numeric_limits correct. */
++/* FreeBSD sets the rounding precision of the FPU to 53 bits, but GNAT
++ resets it to full precision. */
+ #undef TARGET_96_ROUND_53_LONG_DOUBLE
+-#define TARGET_96_ROUND_53_LONG_DOUBLE (!TARGET_64BIT)
++#define TARGET_96_ROUND_53_LONG_DOUBLE 0
+
+ /* Put all *tf routines in libgcc. */
+ #undef LIBGCC2_HAS_TF_MODE
+@@ -147,3 +148,39 @@
+ #if FBSD_MAJOR >= 6
+ #define SUBTARGET32_DEFAULT_CPU "i486"
+ #endif
++
++/* Define location of OS-specific unwind support configuration. */
++#define MD_UNWIND_SUPPORT "config/i386/freebsd-unwind.h"
++
++/* Through FreeBSD 8.2 at least, stack is denied execution rights by libthr
++ This only affects AMD64 since i386 ignores the nx bit (non-PAE)
++ However, it's still included in i386 because it's possible an AMD64
++ machine will be required to run a binary generated by i386 GNAT.
++ perms = PROT_READ | PROT_WRITE | PROT_EXEC;
++*/
++#define ENABLE_EXECUTE_STACK \
++extern void __enable_execute_stack (void *); \
++void \
++__enable_execute_stack (void *addr) \
++{ \
++ extern int getpagesize (void); \
++ extern int mprotect (void *, size_t, int); \
++ \
++ static int size; \
++ long mask; \
++ char *page, *ends; \
++ long page_addr = (long) addr; \
++ long ends_addr = (long) (addr + TRAMPOLINE_SIZE); \
++ int perms = 7; \
++ \
++ if (size == 0) \
++ { \
++ size = getpagesize(); \
++ } \
++ mask = ~((long) size - 1); \
++ page = (char *) (page_addr & mask); \
++ ends = (char *) ((ends_addr & mask) + size); \
++ (void) mprotect (page, ends - page, perms); \
++}
++
++
+--- gcc/config/i386/netbsd-elf.h.orig
++++ gcc/config/i386/netbsd-elf.h
+@@ -2,6 +2,7 @@
+ for i386/ELF NetBSD systems.
+ Copyright (C) 2001, 2002, 2004, 2007 Free Software Foundation, Inc.
+ Contributed by matthew green <mrg@eterna.com.au>
++ Copyright (C) 2010, 2011 John Marino <www.dragonlace.net>
+
+ This file is part of GCC.
+
+@@ -39,6 +40,7 @@
+
+ #undef LINK_SPEC
+ #define LINK_SPEC NETBSD_LINK_SPEC_ELF
++#define LINK_LIBGCC_SPEC "%D -R @EXEC_PREFIX@/lib"
+
+ #define NETBSD_ENTRY_POINT "__start"
+
+@@ -122,3 +124,14 @@
+ #define ENABLE_EXECUTE_STACK NETBSD_ENABLE_EXECUTE_STACK
+
+ #define TARGET_VERSION fprintf (stderr, " (NetBSD/i386 ELF)");
++
++/* ADDED FOR GNAT AUX SUPPORT */
++/* Define this to be nonzero if static stack checking is supported. */
++#define STACK_CHECK_STATIC_BUILTIN 1
++
++/* Define location of OS-specific unwind support configuration. */
++#define MD_UNWIND_SUPPORT "config/i386/netbsd-unwind.h"
++
++#if defined(HAVE_LD_EH_FRAME_HDR)
++#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
++#endif
+--- /dev/null
++++ gcc/config/i386/netbsd-unwind.h
+@@ -0,0 +1,169 @@
++/* DWARF2 EH unwinding support for x86 NetBSD
++ Copyright (C) 2010 John Marino (www.dragonlace.net) */
++
++/* Do code reading to identify a signal frame, and set the frame
++ state data appropriately. See unwind-dw2.c for the structs. */
++
++#include <sys/ucontext.h>
++#include <machine/frame.h>
++
++#define REG_NAME(reg) sf_uc.uc_mcontext.__gregs[_REG_## reg]
++
++#ifdef __x86_64__
++
++
++
++
++#define MD_FALLBACK_FRAME_STATE_FOR x86_64_netbsd_fallback_frame_state
++
++static _Unwind_Reason_Code
++x86_64_netbsd_fallback_frame_state
++(struct _Unwind_Context *context, _Unwind_FrameState *fs)
++{
++ /* signal_frame is sigframe_siginfo minus sf_ra handler return address */
++ struct signal_frame {
++ siginfo_t sf_si; /* actual saved siginfo */
++ ucontext_t sf_uc; /* actual saved ucontext */
++ };
++ struct signal_frame *sf;
++ long new_cfa;
++
++ /* We are looking for the following signal trampoline pattern. If we don't
++ find it, we are at the end of the stack and can't unwind.
++
++ <__sigtramp_siginfo_2+12>: mov $0xffffffffffffffff,%rdi
++ <__sigtramp_siginfo_2+19>: mov $0x1,%rax
++ <__sigtramp_siginfo_2+26>: syscall
++ */
++
++ if ( *(unsigned int *) (context->ra + 12) == 0xffc7c748
++ && *(unsigned int *) (context->ra + 16) == 0x48ffffff
++ && *(unsigned int *) (context->ra + 20) == 0x0001c0c7
++ && *(unsigned int *) (context->ra + 24) == 0x050f0000 )
++ {
++ sf = (struct signal_frame *) context->cfa;
++ new_cfa = sf->REG_NAME(RSP);
++ fs->regs.cfa_how = CFA_REG_OFFSET;
++ fs->regs.cfa_reg = 7;
++ fs->regs.cfa_offset = new_cfa - (long) context->cfa;
++ }
++ else
++ {
++ return _URC_END_OF_STACK;
++ }
++
++ /* The SVR4 register numbering macros aren't usable in libgcc. */
++ fs->regs.reg[ 0].how = REG_SAVED_OFFSET;
++ fs->regs.reg[ 0].loc.offset = (long)&sf->REG_NAME(RAX) - new_cfa;
++ fs->regs.reg[ 1].how = REG_SAVED_OFFSET;
++ fs->regs.reg[ 1].loc.offset = (long)&sf->REG_NAME(RDX) - new_cfa;
++ fs->regs.reg[ 2].how = REG_SAVED_OFFSET;
++ fs->regs.reg[ 2].loc.offset = (long)&sf->REG_NAME(RCX) - new_cfa;
++ fs->regs.reg[ 3].how = REG_SAVED_OFFSET;
++ fs->regs.reg[ 3].loc.offset = (long)&sf->REG_NAME(RBX) - new_cfa;
++ fs->regs.reg[ 4].how = REG_SAVED_OFFSET;
++ fs->regs.reg[ 4].loc.offset = (long)&sf->REG_NAME(RSI) - new_cfa;
++ fs->regs.reg[ 5].how = REG_SAVED_OFFSET;
++ fs->regs.reg[ 5].loc.offset = (long)&sf->REG_NAME(RDI) - new_cfa;
++ fs->regs.reg[ 6].how = REG_SAVED_OFFSET;
++ fs->regs.reg[ 6].loc.offset = (long)&sf->REG_NAME(RBP) - new_cfa;
++ fs->regs.reg[ 8].how = REG_SAVED_OFFSET;
++ fs->regs.reg[ 8].loc.offset = (long)&sf->REG_NAME(R8) - new_cfa;
++ fs->regs.reg[ 9].how = REG_SAVED_OFFSET;
++ fs->regs.reg[ 9].loc.offset = (long)&sf->REG_NAME(R9) - new_cfa;
++ fs->regs.reg[10].how = REG_SAVED_OFFSET;
++ fs->regs.reg[10].loc.offset = (long)&sf->REG_NAME(R10) - new_cfa;
++ fs->regs.reg[11].how = REG_SAVED_OFFSET;
++ fs->regs.reg[11].loc.offset = (long)&sf->REG_NAME(R11) - new_cfa;
++ fs->regs.reg[12].how = REG_SAVED_OFFSET;
++ fs->regs.reg[12].loc.offset = (long)&sf->REG_NAME(R12) - new_cfa;
++ fs->regs.reg[13].how = REG_SAVED_OFFSET;
++ fs->regs.reg[13].loc.offset = (long)&sf->REG_NAME(R13) - new_cfa;
++ fs->regs.reg[14].how = REG_SAVED_OFFSET;
++ fs->regs.reg[14].loc.offset = (long)&sf->REG_NAME(R14) - new_cfa;
++ fs->regs.reg[15].how = REG_SAVED_OFFSET;
++ fs->regs.reg[15].loc.offset = (long)&sf->REG_NAME(R15) - new_cfa;
++ fs->regs.reg[16].how = REG_SAVED_OFFSET;
++ fs->regs.reg[16].loc.offset = (long)&sf->REG_NAME(RIP) - new_cfa;
++ fs->retaddr_column = 16;
++ fs->signal_frame = 1;
++ return _URC_NO_REASON;
++}
++
++
++
++
++#else /* Next section is for i386 */
++
++
++
++
++#define MD_FALLBACK_FRAME_STATE_FOR x86_netbsd_fallback_frame_state
++
++static _Unwind_Reason_Code
++x86_netbsd_fallback_frame_state
++(struct _Unwind_Context *context, _Unwind_FrameState *fs)
++{
++ /* signal_frame is sigframe_siginfo minus sf_ra handler return address */
++ struct signal_frame {
++ int sf_signum; /* "signum" argument for handler" */
++ siginfo_t *sf_sip; /* "sip" argument for handler" */
++ ucontext_t *sf_ucp; /* "ucp" argument for handler" */
++ siginfo_t sf_si; /* actual saved siginfo */
++ ucontext_t sf_uc; /* actual saved ucontext */
++ };
++ struct signal_frame *sf;
++ long new_cfa;
++
++ /* We are looking for the following signal trampoline pattern. If we don't
++ find it, we are at the end of the stack and can't unwind.
++
++ <__sigtramp_siginfo_2+18>: movl $0xffffffff,0x4(%esp)
++ <__sigtramp_siginfo_2+26>: mov $0x1,%eax
++ <__sigtramp_siginfo_2+31>: int $0x80
++ */
++
++ if ( *(unsigned int *) (context->ra + 18) == 0x042444c7
++ && *(unsigned int *) (context->ra + 22) == 0xffffffff
++ && *(unsigned char *) (context->ra + 26) == 0xb8
++ && *(unsigned int *) (context->ra + 27) == 0x00000001
++ && *(unsigned short *) (context->ra + 31) == 0x80cd )
++ {
++ sf = (struct signal_frame *) context->cfa;
++ new_cfa = sf->REG_NAME(ESP);
++ fs->regs.cfa_how = CFA_REG_OFFSET;
++ fs->regs.cfa_reg = 4;
++ fs->regs.cfa_offset = new_cfa - (long) context->cfa;
++ }
++ else
++ {
++ return _URC_END_OF_STACK;
++ }
++
++ /* The SVR4 register numbering macros aren't usable in libgcc. */
++ fs->regs.reg[0].how = REG_SAVED_OFFSET;
++ fs->regs.reg[0].loc.offset = (long)&sf->REG_NAME(EAX) - new_cfa;
++ fs->regs.reg[3].how = REG_SAVED_OFFSET;
++ fs->regs.reg[3].loc.offset = (long)&sf->REG_NAME(EBX) - new_cfa;
++ fs->regs.reg[1].how = REG_SAVED_OFFSET;
++ fs->regs.reg[1].loc.offset = (long)&sf->REG_NAME(ECX) - new_cfa;
++ fs->regs.reg[2].how = REG_SAVED_OFFSET;
++ fs->regs.reg[2].loc.offset = (long)&sf->REG_NAME(EDX) - new_cfa;
++ fs->regs.reg[6].how = REG_SAVED_OFFSET;
++ fs->regs.reg[6].loc.offset = (long)&sf->REG_NAME(ESI) - new_cfa;
++ fs->regs.reg[7].how = REG_SAVED_OFFSET;
++ fs->regs.reg[7].loc.offset = (long)&sf->REG_NAME(EDI) - new_cfa;
++ fs->regs.reg[5].how = REG_SAVED_OFFSET;
++ fs->regs.reg[5].loc.offset = (long)&sf->REG_NAME(EBP) - new_cfa;
++ fs->regs.reg[8].how = REG_SAVED_OFFSET;
++ fs->regs.reg[8].loc.offset = (long)&sf->REG_NAME(EIP) - new_cfa;
++ fs->retaddr_column = 8;
++ fs->signal_frame = 1;
++ return _URC_NO_REASON;
++}
++
++
++
++
++#endif /* ifdef __x86_64__ */
++
+--- gcc/config/i386/netbsd64.h.orig
++++ gcc/config/i386/netbsd64.h
+@@ -2,6 +2,7 @@
+ for x86-64/ELF NetBSD systems.
+ Copyright (C) 2002, 2004, 2007 Free Software Foundation, Inc.
+ Contributed by Wasabi Systems, Inc.
++ Copyright (C) 2010, 2011 John Marino <www.dragonlace.net>
+
+ This file is part of GCC.
+
+@@ -70,3 +71,13 @@
+ #define ENABLE_EXECUTE_STACK NETBSD_ENABLE_EXECUTE_STACK
+
+ #define TARGET_VERSION fprintf (stderr, " (NetBSD/x86_64 ELF)");
++
++/* ADDED FOR GNAT AUX SUPPORT */
++/* Define this to be nonzero if static stack checking is supported. */
++#define STACK_CHECK_STATIC_BUILTIN 1
++
++#define MD_UNWIND_SUPPORT "config/i386/netbsd-unwind.h"
++
++#if defined(HAVE_LD_EH_FRAME_HDR)
++#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
++#endif
+--- /dev/null
++++ gcc/config/i386/openbsd-unwind32.h
+@@ -0,0 +1,77 @@
++/* DWARF2 EH unwinding support for x86 OpenBSD
++ Copyright (C) 2010 John Marino (www.dragonlace.net) */
++
++/* Do code reading to identify a signal frame, and set the frame
++ state data appropriately. See unwind-dw2.c for the structs. */
++
++#include <sys/param.h>
++#include <sys/sysctl.h>
++#include <machine/frame.h>
++/* machine/frame.h brings in sys/signal.h
++ sys/signal.h brings in machine/signal.h (sigcontext)
++ brings in sys/siginfo.h (siginfo_t) */
++
++
++#define REG_NAME(reg) sf_sc.sc_## reg
++#define MD_FALLBACK_FRAME_STATE_FOR x86_openbsd_fallback_frame_state
++
++
++static void
++x86_sigtramp_range (unsigned char **start, unsigned char **end)
++{
++ struct _ps_strings ps_strings;
++ int mib[2];
++ size_t len;
++
++ mib[0] = CTL_VM;
++ mib[1] = VM_PSSTRINGS;
++ len = sizeof (ps_strings);
++ sysctl (mib, 2, &ps_strings, &len, NULL, 0);
++
++ *start = (unsigned char *)ps_strings.val - 128;
++ *end = (unsigned char *)ps_strings.val;
++}
++
++
++static _Unwind_Reason_Code
++x86_openbsd_fallback_frame_state
++(struct _Unwind_Context *context, _Unwind_FrameState *fs)
++{
++ unsigned char *pc = context->ra;
++ unsigned char *sigtramp_start, *sigtramp_end;
++ struct sigframe *sf;
++ long new_cfa;
++
++ x86_sigtramp_range(&sigtramp_start, &sigtramp_end);
++
++ if (pc >= sigtramp_end || pc < sigtramp_start)
++ return _URC_END_OF_STACK;
++
++ sf = (struct sigframe *) context->cfa;
++ new_cfa = sf->REG_NAME(esp);
++
++ fs->regs.cfa_how = CFA_REG_OFFSET;
++ fs->regs.cfa_reg = 4;
++ fs->regs.cfa_offset = new_cfa - (long) context->cfa;
++
++ /* The SVR4 register numbering macros aren't usable in libgcc. */
++ fs->regs.reg[0].how = REG_SAVED_OFFSET;
++ fs->regs.reg[0].loc.offset = (long)&sf->REG_NAME(eax) - new_cfa;
++ fs->regs.reg[3].how = REG_SAVED_OFFSET;
++ fs->regs.reg[3].loc.offset = (long)&sf->REG_NAME(ebx) - new_cfa;
++ fs->regs.reg[1].how = REG_SAVED_OFFSET;
++ fs->regs.reg[1].loc.offset = (long)&sf->REG_NAME(ecx) - new_cfa;
++ fs->regs.reg[2].how = REG_SAVED_OFFSET;
++ fs->regs.reg[2].loc.offset = (long)&sf->REG_NAME(edx) - new_cfa;
++ fs->regs.reg[6].how = REG_SAVED_OFFSET;
++ fs->regs.reg[6].loc.offset = (long)&sf->REG_NAME(esi) - new_cfa;
++ fs->regs.reg[7].how = REG_SAVED_OFFSET;
++ fs->regs.reg[7].loc.offset = (long)&sf->REG_NAME(edi) - new_cfa;
++ fs->regs.reg[5].how = REG_SAVED_OFFSET;
++ fs->regs.reg[5].loc.offset = (long)&sf->REG_NAME(ebp) - new_cfa;
++ fs->regs.reg[8].how = REG_SAVED_OFFSET;
++ fs->regs.reg[8].loc.offset = (long)&sf->REG_NAME(eip) - new_cfa;
++ fs->retaddr_column = 8;
++ fs->signal_frame = 1;
++ return _URC_NO_REASON;
++}
+--- /dev/null
++++ gcc/config/i386/openbsd64.h
+@@ -0,0 +1,112 @@
++/* Definitions for AMD x86_64 running OpenBSD BSD with ELF Format */
++
++#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} \
++ %{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)
++
++/* ADDED FOR GNAT AUX SUPPORT */
++/* Define this to be nonzero if static stack checking is supported */
++#undef STACK_CHECK_STATIC_BUILTIN
++#define STACK_CHECK_STATIC_BUILTIN 1
++
++/* Ensure rounding is left to GNAT (Not required for AMD64) */
++#undef TARGET_96_ROUND_53_LONG_DOUBLE
++#define TARGET_96_ROUND_53_LONG_DOUBLE 1
++
+--- gcc/config/i386/openbsdelf.h.orig
++++ gcc/config/i386/openbsdelf.h
+@@ -1,6 +1,7 @@
+ /* Configuration for an OpenBSD i386 target.
+-
++
+ Copyright (C) 2005, 2007, 2009, 2010 Free Software Foundation, Inc.
++ Copyright (C) 2010, 2011 John Marino <www.dragonlace.net>
+
+ This file is part of GCC.
+
+@@ -82,7 +83,7 @@
+
+ /* 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. */
+@@ -132,3 +133,18 @@
+ -dynamic-linker /usr/libexec/ld.so"
+
+ #define OBSD_HAS_CORRECT_SPECS
++
++
++/* ADDED FOR GNAT AUX SUPPORT */
++/* Define this to be nonzero if static stack checking is supported */
++#undef STACK_CHECK_STATIC_BUILTIN
++#define STACK_CHECK_STATIC_BUILTIN 1
++
++/* Ensure rounding is left to GNAT (i386 only) */
++#undef TARGET_96_ROUND_53_LONG_DOUBLE
++#define TARGET_96_ROUND_53_LONG_DOUBLE 0
++
++/* Define location of OS-specific unwind support configuration.
++ Not required until OpenBSD changes from SJLJ to ZCX exceptions
++ When that happens, remove comments from first line and delete second line. */
++/*#define MD_UNWIND_SUPPORT "config/i386/openbsd-unwind32.h" */
+--- gcc/ginclude/stddef.h.orig
++++ gcc/ginclude/stddef.h
+@@ -1,5 +1,6 @@
+ /* Copyright (C) 1989, 1997, 1998, 1999, 2000, 2002, 2004, 2009
+ Free Software Foundation, Inc.
++ Copyright (C) 2010 John Marino <draco@marino.st>
+
+ This file is part of GCC.
+
+@@ -59,6 +60,10 @@
+ #include <sys/_types.h>
+ #endif
+
++#if defined (__DragonFly__)
++#include <sys/types.h>
++#endif
++
+ /* In 4.3bsd-net2, machine/ansi.h defines these symbols, which are
+ defined if the corresponding type is *not* defined.
+ FreeBSD-2.1 defines _MACHINE_ANSI_H_ instead of _ANSI_H_.
+@@ -136,6 +141,7 @@
+ #ifndef _BSD_PTRDIFF_T_
+ #ifndef ___int_ptrdiff_t_h
+ #ifndef _GCC_PTRDIFF_T
++#ifndef _PTRDIFF_T_DECLARED /* DragonFly BSD */
+ #define _PTRDIFF_T
+ #define _T_PTRDIFF_
+ #define _T_PTRDIFF
+@@ -144,10 +150,12 @@
+ #define _BSD_PTRDIFF_T_
+ #define ___int_ptrdiff_t_h
+ #define _GCC_PTRDIFF_T
++#define _PTRDIFF_T_DECLARED
+ #ifndef __PTRDIFF_TYPE__
+ #define __PTRDIFF_TYPE__ long int
+ #endif
+ typedef __PTRDIFF_TYPE__ ptrdiff_t;
++#endif /* _PTRDFF_T_DECLARED */
+ #endif /* _GCC_PTRDIFF_T */
+ #endif /* ___int_ptrdiff_t_h */
+ #endif /* _BSD_PTRDIFF_T_ */
+@@ -179,7 +187,7 @@
+ #ifndef _SIZE_T_DEFINED_
+ #ifndef _SIZE_T_DEFINED
+ #ifndef _BSD_SIZE_T_DEFINED_ /* Darwin */
+-#ifndef _SIZE_T_DECLARED /* FreeBSD 5 */
++#ifndef _SIZE_T_DECLARED /* FreeBSD 5, also DragonFly */
+ #ifndef ___int_size_t_h
+ #ifndef _GCC_SIZE_T
+ #ifndef _SIZET_
+@@ -196,12 +204,13 @@
+ #define _SIZE_T_DEFINED_
+ #define _SIZE_T_DEFINED
+ #define _BSD_SIZE_T_DEFINED_ /* Darwin */
+-#define _SIZE_T_DECLARED /* FreeBSD 5 */
++#define _SIZE_T_DECLARED /* FreeBSD 5, DragonFly */
+ #define ___int_size_t_h
+ #define _GCC_SIZE_T
+ #define _SIZET_
+-#if defined (__FreeBSD__) && (__FreeBSD__ >= 5)
+-/* __size_t is a typedef on FreeBSD 5!, must not trash it. */
++#if defined (__DragonFly__) || (defined (__FreeBSD__) && (__FreeBSD__ >= 5))
++/* __size_t is a typedef on FreeBSD 5!, must not trash it.
++ __size_t is also defined in <machine/stdint.h> on DragonFly BSD */
+ #else
+ #define __size_t
+ #endif
+@@ -253,7 +262,7 @@
+ #ifndef _BSD_WCHAR_T_
+ #ifndef _BSD_WCHAR_T_DEFINED_ /* Darwin */
+ #ifndef _BSD_RUNE_T_DEFINED_ /* Darwin */
+-#ifndef _WCHAR_T_DECLARED /* FreeBSD 5 */
++#ifndef _WCHAR_T_DECLARED /* FreeBSD 5, also DragonFly */
+ #ifndef _WCHAR_T_DEFINED_
+ #ifndef _WCHAR_T_DEFINED
+ #ifndef _WCHAR_T_H
+@@ -305,8 +314,10 @@
+ #endif
+ /* FreeBSD 5 can't be handled well using "traditional" logic above
+ since it no longer defines _BSD_RUNE_T_ yet still desires to export
+- rune_t in some cases... */
+-#if defined (__FreeBSD__) && (__FreeBSD__ >= 5)
++ rune_t in some cases...
++ DragonFly BSD inherited this quirk from FreeBSD 4.8.
++*/
++#if defined (__DragonFly__) || (defined (__FreeBSD__) && (__FreeBSD__ >= 5))
+ #if !defined (_ANSI_SOURCE) && !defined (_POSIX_SOURCE)
+ #if __BSD_VISIBLE
+ #ifndef _RUNE_T_DECLARED
+--- include/libiberty.h.orig
++++ include/libiberty.h
+@@ -2,6 +2,7 @@
+
+ Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+ 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
++ Copyright 2010, 2011 John Marino <http://www.dragonlace.net>
+
+ Note - certain prototypes declared in this header file are for
+ functions whoes implementation copyright does not belong to the
+@@ -102,7 +103,16 @@
+ to find the declaration so provide a fully prototyped one. If it
+ is 1, we found it so don't provide any declaration at all. */
+ #if !HAVE_DECL_BASENAME
+-#if defined (__GNU_LIBRARY__ ) || defined (__linux__) || defined (__FreeBSD__) || defined (__OpenBSD__) || defined(__NetBSD__) || defined (__CYGWIN__) || defined (__CYGWIN32__) || defined (__MINGW32__) || defined (HAVE_DECL_BASENAME)
++#if defined (__GNU_LIBRARY__) \
++ || defined (__linux__) \
++ || defined (__FreeBSD__) \
++ || defined (__OpenBSD__) \
++ || defined (__NetBSD__) \
++ || defined (__DragonFly__) \
++ || defined (__CYGWIN__) \
++ || defined (__CYGWIN32__) \
++ || defined (__MINGW32__) \
++ || defined (HAVE_DECL_BASENAME)
+ extern char *basename (const char *);
+ #else
+ /* Do not allow basename to be used if there is no prototype seen. We
+--- libgcc/config.host.orig
++++ libgcc/config.host
+@@ -1,6 +1,7 @@
+ # libgcc host-specific configuration file.
+ # Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+ # 2008, 2009, 2010 Free Software Foundation, Inc.
++# Copyright 2010-2012 John Marino <http://www.dragonlace.net>
+
+ #This file is part of GCC.
+
+@@ -166,6 +167,8 @@
+ ;;
+ *-*-openbsd*)
+ ;;
++*-*-dragonfly*)
++ ;;
+ *-*-rtems*)
+ ;;
+ *-*-vxworks*)
+@@ -287,6 +290,14 @@
+ x86_64-*-freebsd*)
+ tmake_file="${tmake_file} i386/t-freebsd"
+ ;;
++i[34567]86-*-dragonfly*)
++ # define symbol versions (same as FreeBSD)
++ tmake_file="${tmake_file} i386/t-dragonfly"
++ ;;
++x86_64-*-dragonfly*)
++ # define symbol versions (same as FreeBSD)
++ tmake_file="${tmake_file} i386/t-dragonfly"
++ ;;
+ i[34567]86-*-netbsdelf*)
+ ;;
+ i[34567]86-*-netbsd*)
+@@ -297,6 +308,8 @@
+ ;;
+ i[34567]86-*-openbsd*)
+ ;;
++x86_64-*-openbsd*)
++ ;;
+ i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | i[34567]86-*-gnu*)
+ extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
+ tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm"
+@@ -628,6 +641,9 @@
+ tmake_file="${tmake_file} t-softfp i386/${host_address}/t-fprules-softfp"
+ fi
+ ;;
++i[34567]86-*-dragonfly* | i[34567]86-*-netbsdelf*)
++ tmake_file="${tmake_file} t-softfp i386/32/t-fprules-softfp"
++ ;;
+ esac
+
+ case ${host} in
+--- /dev/null
++++ libgcc/config/i386/t-dragonfly
+@@ -0,0 +1,2 @@
++# Add support for the introduction of 128-bit long double.
++SHLIB_MAPFILES += $(srcdir)/config/i386/libgcc-bsd.ver
+--- gcc/configure.orig
++++ gcc/configure
+@@ -25843,6 +25843,20 @@
+ gcc_cv_target_dl_iterate_phdr=no
+ fi
+ ;;
++ *-*-dragonfly* | *-*-freebsd*)
++ if grep dl_iterate_phdr $target_header_dir/sys/link_elf.h > /dev/null 2>&1; then
++ gcc_cv_target_dl_iterate_phdr=yes
++ else
++ gcc_cv_target_dl_iterate_phdr=no
++ fi
++ ;;
++# *-*-netbsd* | *-*-openbsd*)
++# if grep dl_iterate_phdr $target_header_dir/link_elf.h > /dev/null 2>&1; then
++# gcc_cv_target_dl_iterate_phdr=yes
++# else
++# gcc_cv_target_dl_iterate_phdr=no
++# fi
++# ;;
+ esac
+
+ if test x$gcc_cv_target_dl_iterate_phdr = xyes; then
+--- gcc/Makefile.in.orig
++++ gcc/Makefile.in
+@@ -4322,7 +4322,7 @@
+ DESTDIR=$(@D) \
+ $(SHELL) $(srcdir)/doc/install.texi2html
+
+-MANFILES = doc/gcov.1 doc/cpp.1 doc/gcc.1 doc/gfdl.7 doc/gpl.7 doc/fsf-funding.7
++MANFILES = doc/gcov.1 doc/cpp.1 doc/gcc.1
+
+ generated-manpages: man
+
+@@ -4474,7 +4474,7 @@
+ # Install the driver last so that the window when things are
+ # broken is small.
+ install: install-common $(INSTALL_HEADERS) \
+- install-cpp install-man install-info install-@POSUB@ \
++ install-cpp install-man install-@POSUB@ \
+ install-driver install-lto-wrapper
+
+ ifeq ($(enable_plugin),yes)
+@@ -4665,10 +4665,7 @@
+ install-man: lang.install-man \
+ $(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext) \
+ $(DESTDIR)$(man1dir)/$(CPP_INSTALL_NAME)$(man1ext) \
+- $(DESTDIR)$(man1dir)/$(GCOV_INSTALL_NAME)$(man1ext) \
+- $(DESTDIR)$(man7dir)/fsf-funding$(man7ext) \
+- $(DESTDIR)$(man7dir)/gfdl$(man7ext) \
+- $(DESTDIR)$(man7dir)/gpl$(man7ext)
++ $(DESTDIR)$(man1dir)/$(GCOV_INSTALL_NAME)$(man1ext)
+
+ $(DESTDIR)$(man7dir)/%$(man7ext): doc/%.7 installdirs
+ -rm -f $@
+--- configure.orig
++++ configure
+@@ -14200,7 +14200,7 @@
+ _ACEOF
+ if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+-$as_echo "yes" >&6; }; stage1_cflags="$stage1_cflags -fkeep-inline-functions"
++$as_echo "yes" >&6; };
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ $as_echo "no" >&6; }
diff --git a/lang/gnat-aux/files/diff-cxx b/lang/gnat-aux/files/diff-cxx
new file mode 100644
index 000000000000..681373a359b1
--- /dev/null
+++ b/lang/gnat-aux/files/diff-cxx
@@ -0,0 +1,917 @@
+--- libstdc++-v3/acinclude.m4.orig
++++ libstdc++-v3/acinclude.m4
+@@ -1753,7 +1753,7 @@
+ AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
+ GLIBCXX_ENABLE(clocale,auto,[[[=MODEL]]],
+ [use MODEL for target locale package],
+- [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
++ [permit generic|gnu|ieee_1003.1-2001|darwin|dragonfly|yes|no|auto])
+
+ # Deal with gettext issues. Default to not using it (=no) until we detect
+ # support for it later. Let the user turn it off via --e/d, but let that
+@@ -1780,6 +1780,9 @@
+ darwin* | freebsd*)
+ enable_clocale_flag=darwin
+ ;;
++ dragonfly*)
++ enable_clocale_flag_dragonfly
++ ;;
+ *)
+ enable_clocale_flag=generic
+ ;;
+@@ -1864,7 +1867,22 @@
+ CTIME_CC=config/locale/generic/time_members.cc
+ CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
+ ;;
++ dragonfly)
++ AC_MSG_RESULT(darwin or freebsd)
+
++ CLOCALE_H=config/locale/generic/c_locale.h
++ CLOCALE_CC=config/locale/dragonfly/c_locale.cc
++ CCODECVT_CC=config/locale/generic/codecvt_members.cc
++ CCOLLATE_CC=config/locale/generic/collate_members.cc
++ CCTYPE_CC=config/locale/dragonfly/ctype_members.cc
++ CMESSAGES_H=config/locale/generic/messages_members.h
++ CMESSAGES_CC=config/locale/generic/messages_members.cc
++ CMONEY_CC=config/locale/generic/monetary_members.cc
++ CNUMERIC_CC=config/locale/generic/numeric_members.cc
++ CTIME_H=config/locale/generic/time_members.h
++ CTIME_CC=config/locale/generic/time_members.cc
++ CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
++ ;;
+ gnu)
+ AC_MSG_RESULT(gnu)
+
+--- libstdc++-v3/configure.orig
++++ libstdc++-v3/configure
+@@ -15638,7 +15638,7 @@
+ if test "${enable_clocale+set}" = set; then :
+ enableval=$enable_clocale;
+ case "$enableval" in
+- generic|gnu|ieee_1003.1-2001|yes|no|auto) ;;
++ generic|gnu|ieee_1003.1-2001|darwin|dragonfly|yes|no|auto) ;;
+ *) as_fn_error "Unknown argument to enable/disable clocale" "$LINENO" 5 ;;
+ esac
+
+@@ -15676,6 +15676,9 @@
+ darwin* | freebsd*)
+ enable_clocale_flag=darwin
+ ;;
++ dragonfly*)
++ enable_clocale_flag=dragonfly
++ ;;
+ *)
+ enable_clocale_flag=generic
+ ;;
+@@ -15813,7 +15816,23 @@
+ CTIME_CC=config/locale/generic/time_members.cc
+ CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
+ ;;
++ dragonfly)
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: dragonfly" >&5
++$as_echo "darwin or freebsd" >&6; }
+
++ CLOCALE_H=config/locale/generic/c_locale.h
++ CLOCALE_CC=config/locale/dragonfly/c_locale.cc
++ CCODECVT_CC=config/locale/generic/codecvt_members.cc
++ CCOLLATE_CC=config/locale/generic/collate_members.cc
++ CCTYPE_CC=config/locale/dragonfly/ctype_members.cc
++ CMESSAGES_H=config/locale/generic/messages_members.h
++ CMESSAGES_CC=config/locale/generic/messages_members.cc
++ CMONEY_CC=config/locale/generic/monetary_members.cc
++ CNUMERIC_CC=config/locale/generic/numeric_members.cc
++ CTIME_H=config/locale/generic/time_members.h
++ CTIME_CC=config/locale/generic/time_members.cc
++ CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
++ ;;
+ gnu)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: gnu" >&5
+ $as_echo "gnu" >&6; }
+--- libstdc++-v3/configure.host.orig
++++ libstdc++-v3/configure.host
+@@ -233,6 +233,9 @@
+ os_include_dir="os/djgpp"
+ error_constants_dir="os/djgpp"
+ ;;
++ dragonfly*)
++ os_include_dir="os/bsd/dragonfly"
++ ;;
+ freebsd*)
+ os_include_dir="os/bsd/freebsd"
+ ;;
+--- /dev/null
++++ libstdc++-v3/config/locale/dragonfly/c_locale.cc
+@@ -0,0 +1,300 @@
++// Wrapper for underlying C-language localization -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
++// Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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.
++
++// This library 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.
++
++// Under Section 7 of GPL version 3, you are granted additional
++// permissions described in the GCC Runtime Library Exception, version
++// 3.1, as published by the Free Software Foundation.
++
++// You should have received a copy of the GNU General Public License and
++// a copy of the GCC Runtime Library Exception along with this program;
++// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
++// <http://www.gnu.org/licenses/>.
++
++//
++// ISO C++ 14882: 22.8 Standard locale categories.
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <cerrno> // For errno
++#include <cmath> // For isinf, finite, finitef, fabs
++#include <cstdlib> // For strof, strtold
++#include <cstring>
++#include <cstdio>
++#include <locale>
++#include <limits>
++
++#ifdef _GLIBCXX_HAVE_IEEEFP_H
++#include <ieeefp.h>
++#endif
++
++namespace std _GLIBCXX_VISIBILITY(default)
++{
++_GLIBCXX_BEGIN_NAMESPACE_VERSION
++
++ template<>
++ void
++ __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
++ const __c_locale&) throw()
++ {
++ // Assumes __s formatted for "C" locale.
++ char* __old = setlocale(LC_ALL, 0);
++ const size_t __len = strlen(__old) + 1;
++ char* __sav = new char[__len];
++ memcpy(__sav, __old, __len);
++ setlocale(LC_ALL, "C");
++ char* __sanity;
++ bool __overflow = false;
++
++#if !__FLT_HAS_INFINITY__
++ errno = 0;
++#endif
++
++#ifdef _GLIBCXX_HAVE_STRTOF
++ __v = strtof(__s, &__sanity);
++#else
++ double __d = strtod(__s, &__sanity);
++ __v = static_cast<float>(__d);
++#ifdef _GLIBCXX_HAVE_FINITEF
++ if (!finitef (__v))
++ __overflow = true;
++#elif defined (_GLIBCXX_HAVE_FINITE)
++ if (!finite (static_cast<double> (__v)))
++ __overflow = true;
++#elif defined (_GLIBCXX_HAVE_ISINF)
++ if (isinf (static_cast<double> (__v)))
++ __overflow = true;
++#else
++ if (fabs(__d) > numeric_limits<float>::max())
++ __overflow = true;
++#endif
++#endif // _GLIBCXX_HAVE_STRTOF
++
++ // _GLIBCXX_RESOLVE_LIB_DEFECTS
++ // 23. Num_get overflow result.
++ if (__sanity == __s || *__sanity != '\0')
++ {
++ __v = 0.0f;
++ __err = ios_base::failbit;
++ }
++ else if (__overflow
++#if __FLT_HAS_INFINITY__
++ || __v == numeric_limits<float>::infinity()
++ || __v == -numeric_limits<float>::infinity()
++#else
++ || ((__v > 1.0f || __v < -1.0f) && errno == ERANGE)
++#endif
++ )
++ {
++ if (__v > 0.0f)
++ __v = numeric_limits<float>::max();
++ else
++ __v = -numeric_limits<float>::max();
++ __err = ios_base::failbit;
++ }
++
++ setlocale(LC_ALL, __sav);
++ delete [] __sav;
++ }
++
++ template<>
++ void
++ __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
++ const __c_locale&) throw()
++ {
++ // Assumes __s formatted for "C" locale.
++ char* __old = setlocale(LC_ALL, 0);
++ const size_t __len = strlen(__old) + 1;
++ char* __sav = new char[__len];
++ memcpy(__sav, __old, __len);
++ setlocale(LC_ALL, "C");
++ char* __sanity;
++
++#if !__DBL_HAS_INFINITY__
++ errno = 0;
++#endif
++
++ __v = strtod(__s, &__sanity);
++
++ // _GLIBCXX_RESOLVE_LIB_DEFECTS
++ // 23. Num_get overflow result.
++ if (__sanity == __s || *__sanity != '\0')
++ {
++ __v = 0.0;
++ __err = ios_base::failbit;
++ }
++ else if (
++#if __DBL_HAS_INFINITY__
++ __v == numeric_limits<double>::infinity()
++ || __v == -numeric_limits<double>::infinity())
++#else
++ (__v > 1.0 || __v < -1.0) && errno == ERANGE)
++#endif
++ {
++ if (__v > 0.0)
++ __v = numeric_limits<double>::max();
++ else
++ __v = -numeric_limits<double>::max();
++ __err = ios_base::failbit;
++ }
++
++ setlocale(LC_ALL, __sav);
++ delete [] __sav;
++ }
++
++ template<>
++ void
++ __convert_to_v(const char* __s, long double& __v,
++ ios_base::iostate& __err, const __c_locale&) throw()
++ {
++ // Assumes __s formatted for "C" locale.
++ char* __old = setlocale(LC_ALL, 0);
++ const size_t __len = strlen(__old) + 1;
++ char* __sav = new char[__len];
++ memcpy(__sav, __old, __len);
++ setlocale(LC_ALL, "C");
++
++#if !__LDBL_HAS_INFINITY__
++ errno = 0;
++#endif
++
++#if defined(_GLIBCXX_HAVE_STRTOLD) && !defined(_GLIBCXX_HAVE_BROKEN_STRTOLD)
++ char* __sanity;
++ __v = strtold(__s, &__sanity);
++
++ // _GLIBCXX_RESOLVE_LIB_DEFECTS
++ // 23. Num_get overflow result.
++ if (__sanity == __s || *__sanity != '\0')
++#else
++ typedef char_traits<char>::int_type int_type;
++ int __p = sscanf(__s, "%Lf", &__v);
++
++ if (!__p || static_cast<int_type>(__p) == char_traits<char>::eof())
++#endif
++ {
++ __v = 0.0l;
++ __err = ios_base::failbit;
++ }
++ else if (
++#if __LDBL_HAS_INFINITY__
++ __v == numeric_limits<long double>::infinity()
++ || __v == -numeric_limits<long double>::infinity())
++#else
++ (__v > 1.0l || __v < -1.0l) && errno == ERANGE)
++#endif
++ {
++ if (__v > 0.0l)
++ __v = numeric_limits<long double>::max();
++ else
++ __v = -numeric_limits<long double>::max();
++ __err = ios_base::failbit;
++ }
++
++ setlocale(LC_ALL, __sav);
++ delete [] __sav;
++ }
++
++
++ /* DragonFly's implemenation of setlocale won't accept something like
++ "de_DE". According to nls manpage, the expected format is:
++ language[_territory][.codeset][@modifier], but it seems that both
++ the _territory and .codeset components are required.
++
++ As an attempt to correct for this, we'll tack on ".UTF-8" if
++ a period is not detected in the locale string.
++
++ There are no locales with modifiers on DragonFly so if found, they
++ will just be stripped off silently. e.g "de_DE@euro" will be reduced
++ to "de_DE". The UTF-8 default would be added after that.
++ */
++
++ void
++ locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s,
++ __c_locale)
++ {
++ const size_t size__s = (__s == NULL) ? 1 : strlen (__s);
++ const char UTF8[] = ".UTF-8";
++ char localspec[size__s + 6 + 1];
++
++ if (__s == NULL) {
++ localspec[0] = NULL;
++ } else {
++ strcpy (localspec, __s);
++ char * pch = strchr (localspec, '@');
++ if (pch != NULL)
++ *pch = 0;
++
++ if ( (strchr (__s, '.') == NULL)
++ && (strcmp (__s, "C") != 0)
++ && (strcmp (__s, "POSIX") != 0))
++ strncat (localspec, UTF8, 6);
++ }
++
++ const char * result = std::setlocale(LC_ALL, localspec);
++
++ if ((strcmp(result, "C") != 0) && (strcmp (result, localspec) != 0))
++ __throw_runtime_error(__N("locale::facet::_S_create_c_locale "
++ "name not valid"));
++ __cloc = 0;
++ }
++
++ void
++ locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
++ { __cloc = 0; }
++
++ __c_locale
++ locale::facet::_S_clone_c_locale(__c_locale&) throw()
++ { return __c_locale(); }
++
++ __c_locale
++ locale::facet::_S_lc_ctype_c_locale(__c_locale, const char*)
++ { return __c_locale(); }
++
++_GLIBCXX_END_NAMESPACE_VERSION
++} // namespace
++
++namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
++{
++_GLIBCXX_BEGIN_NAMESPACE_VERSION
++
++ const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
++ {
++ "LC_CTYPE",
++ "LC_NUMERIC",
++ "LC_TIME",
++ "LC_COLLATE",
++ "LC_MONETARY",
++ "LC_MESSAGES"
++ };
++
++_GLIBCXX_END_NAMESPACE_VERSION
++} // namespace
++
++namespace std _GLIBCXX_VISIBILITY(default)
++{
++_GLIBCXX_BEGIN_NAMESPACE_VERSION
++
++ const char* const* const locale::_S_categories = __gnu_cxx::category_names;
++
++_GLIBCXX_END_NAMESPACE_VERSION
++} // namespace
++
++// XXX GLIBCXX_ABI Deprecated
++#ifdef _GLIBCXX_LONG_DOUBLE_COMPAT
++#define _GLIBCXX_LDBL_COMPAT(dbl, ldbl) \
++ extern "C" void ldbl (void) __attribute__ ((alias (#dbl)))
++_GLIBCXX_LDBL_COMPAT(_ZSt14__convert_to_vIdEvPKcRT_RSt12_Ios_IostateRKPi, _ZSt14__convert_to_vIeEvPKcRT_RSt12_Ios_IostateRKPi);
++#endif // _GLIBCXX_LONG_DOUBLE_COMPAT
+--- /dev/null
++++ libstdc++-v3/config/locale/dragonfly/ctype_members.cc
+@@ -0,0 +1,172 @@
++// std::ctype implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
++// Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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.
++
++// This library 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.
++
++// Under Section 7 of GPL version 3, you are granted additional
++// permissions described in the GCC Runtime Library Exception, version
++// 3.1, as published by the Free Software Foundation.
++
++// You should have received a copy of the GNU General Public License and
++// a copy of the GCC Runtime Library Exception along with this program;
++// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
++// <http://www.gnu.org/licenses/>.
++
++//
++// ISO C++ 14882: 22.2.1.1.2 ctype virtual functions.
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <bits/c++locale_internal.h>
++#include <cstdlib>
++#include <cstring>
++#include <cstdio>
++
++namespace std _GLIBCXX_VISIBILITY(default)
++{
++ // NB: The other ctype<char> specializations are in src/locale.cc and
++ // various /config/os/* files.
++
++ ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
++ : ctype<char>(0, false, __refs)
++ {
++ if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
++ {
++ this->_S_destroy_c_locale(this->_M_c_locale_ctype);
++ this->_S_create_c_locale(this->_M_c_locale_ctype, __s);
++ }
++ }
++
++ ctype_byname<char>::~ctype_byname()
++ { }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++ ctype<wchar_t>::__wmask_type
++ ctype<wchar_t>::_M_convert_to_wmask(const mask /* __m */) const throw()
++ {
++ // This routine never gets called on DragonFly.
++ return 0;
++ };
++
++ wchar_t
++ ctype<wchar_t>::do_toupper(wchar_t __c) const
++ { return towupper(__c); }
++
++ const wchar_t*
++ ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
++ {
++ while (__lo < __hi)
++ {
++ *__lo = towupper(*__lo);
++ ++__lo;
++ }
++ return __hi;
++ }
++
++ wchar_t
++ ctype<wchar_t>::do_tolower(wchar_t __c) const
++ { return towlower(__c); }
++
++ const wchar_t*
++ ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
++ {
++ while (__lo < __hi)
++ {
++ *__lo = towlower(*__lo);
++ ++__lo;
++ }
++ return __hi;
++ }
++
++ wchar_t
++ ctype<wchar_t>::
++ do_widen(char __c) const
++ { return _M_widen[static_cast<unsigned char>(__c)]; }
++
++ const char*
++ ctype<wchar_t>::
++ do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
++ {
++ while (__lo < __hi)
++ {
++ *__dest = _M_widen[static_cast<unsigned char>(*__lo)];
++ ++__lo;
++ ++__dest;
++ }
++ return __hi;
++ }
++
++ char
++ ctype<wchar_t>::
++ do_narrow(wchar_t __wc, char __dfault) const
++ {
++ if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
++ return _M_narrow[__wc];
++ const int __c = wctob(__wc);
++ return (__c == EOF ? __dfault : static_cast<char>(__c));
++ }
++
++ const wchar_t*
++ ctype<wchar_t>::
++ do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault,
++ char* __dest) const
++ {
++ if (_M_narrow_ok)
++ while (__lo < __hi)
++ {
++ if (*__lo >= 0 && *__lo < 128)
++ *__dest = _M_narrow[*__lo];
++ else
++ {
++ const int __c = wctob(*__lo);
++ *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
++ }
++ ++__lo;
++ ++__dest;
++ }
++ else
++ while (__lo < __hi)
++ {
++ const int __c = wctob(*__lo);
++ *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
++ ++__lo;
++ ++__dest;
++ }
++ return __hi;
++ }
++
++ void
++ ctype<wchar_t>::_M_initialize_ctype() throw()
++ {
++ wint_t __i;
++ for (__i = 0; __i < 128; ++__i)
++ {
++ const int __c = wctob(__i);
++ if (__c == EOF)
++ break;
++ else
++ _M_narrow[__i] = static_cast<char>(__c);
++ }
++ if (__i == 128)
++ _M_narrow_ok = true;
++ else
++ _M_narrow_ok = false;
++ for (size_t __i = 0;
++ __i < sizeof(_M_widen) / sizeof(wint_t); ++__i)
++ _M_widen[__i] = btowc(__i);
++ }
++#endif // _GLIBCXX_USE_WCHAR_T
++}
+--- /dev/null
++++ libstdc++-v3/config/os/bsd/dragonfly/ctype_base.h
+@@ -0,0 +1,60 @@
++// Locale support -*- C++ -*-
++
++// Copyright (C) 2000, 2003, 2009, 2010 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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.
++
++// This library 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.
++
++// Under Section 7 of GPL version 3, you are granted additional
++// permissions described in the GCC Runtime Library Exception, version
++// 3.1, as published by the Free Software Foundation.
++
++// You should have received a copy of the GNU General Public License and
++// a copy of the GCC Runtime Library Exception along with this program;
++// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
++// <http://www.gnu.org/licenses/>.
++
++//
++// ISO C++ 14882: 22.1 Locales
++//
++
++// Information as gleaned from /usr/include/ctype.h on DragonFly.
++// Full details can be found from git repo at:
++// http://gitweb.dragonflybsd.org/dragonfly.git/blob_plain/HEAD:/include/ctype.h
++
++namespace std _GLIBCXX_VISIBILITY(default)
++{
++_GLIBCXX_BEGIN_NAMESPACE_VERSION
++
++ /// @brief Base class for ctype.
++ struct ctype_base
++ {
++ // Non-standard typedefs.
++ typedef const unsigned char* __to_type;
++
++ // NB: Offsets into ctype<char>::_M_table force a particular size
++ // on the mask type. Because of this, we don't use an enum.
++ typedef uint16_t mask;
++ static const mask upper = _CTYPEMASK_U;
++ static const mask lower = _CTYPEMASK_L;
++ static const mask alpha = _CTYPEMASK_A;
++ static const mask digit = _CTYPEMASK_D;
++ static const mask xdigit = _CTYPEMASK_X;
++ static const mask space = _CTYPEMASK_S;
++ static const mask print = _CTYPEMASK_R;
++ static const mask graph = _CTYPEMASK_G;
++ static const mask cntrl = _CTYPEMASK_C;
++ static const mask punct = _CTYPEMASK_P;
++ static const mask alnum = _CTYPEMASK_A | _CTYPEMASK_D;
++ };
++
++_GLIBCXX_END_NAMESPACE_VERSION
++} // namespace
+--- /dev/null
++++ libstdc++-v3/config/os/bsd/dragonfly/ctype_inline.h
+@@ -0,0 +1,127 @@
++// Locale support -*- C++ -*-
++
++// Copyright (C) 2000, 2003, 2004, 2005, 2009, 2010
++// Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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.
++
++// This library 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.
++
++// Under Section 7 of GPL version 3, you are granted additional
++// permissions described in the GCC Runtime Library Exception, version
++// 3.1, as published by the Free Software Foundation.
++
++// You should have received a copy of the GNU General Public License and
++// a copy of the GCC Runtime Library Exception along with this program;
++// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
++// <http://www.gnu.org/licenses/>.
++
++/** @file bits/ctype_inline.h
++ * This is an internal header file, included by other library headers.
++ * Do not attempt to use it directly. @headername{locale}
++ */
++
++//
++// ISO C++ 14882: 22.1 Locales
++//
++
++// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
++// functions go in ctype.cc
++
++namespace std _GLIBCXX_VISIBILITY(default)
++{
++_GLIBCXX_BEGIN_NAMESPACE_VERSION
++
++ bool
++ ctype<char>::
++ is(mask __m, char __c) const
++ { return _M_table[(unsigned char)(__c)] & __m; }
++
++ const char*
++ ctype<char>::
++ is(const char* __low, const char* __high, mask* __vec) const
++ {
++ while (__low < __high)
++ *__vec++ = _M_table[*__low++];
++ return __high;
++ }
++
++ const char*
++ ctype<char>::
++ scan_is(mask __m, const char* __low, const char* __high) const
++ {
++ while (__low < __high && !this->is(__m, *__low))
++ ++__low;
++ return __low;
++ }
++
++ const char*
++ ctype<char>::
++ scan_not(mask __m, const char* __low, const char* __high) const
++ {
++ while (__low < __high && this->is(__m, *__low) != 0)
++ ++__low;
++ return __low;
++ }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++ inline bool
++ ctype<wchar_t>::
++ do_is(mask __m, wchar_t __c) const
++ {
++ return __libc_ctype_ [__c + 1] & __m;
++ }
++
++ inline const wchar_t*
++ ctype<wchar_t>::
++ do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
++ {
++ for (; __lo < __hi; ++__vec, ++__lo)
++ {
++ mask __m = 0;
++ if (isupper (*__lo)) __m |= _CTYPEMASK_U;
++ if (islower (*__lo)) __m |= _CTYPEMASK_L;
++ if (isdigit (*__lo)) __m |= _CTYPEMASK_D;
++ if (isspace (*__lo)) __m |= _CTYPEMASK_S;
++ if (ispunct (*__lo)) __m |= _CTYPEMASK_P;
++ if (isblank (*__lo)) __m |= _CTYPEMASK_B;
++ if (iscntrl (*__lo)) __m |= _CTYPEMASK_C;
++ if (isalpha (*__lo)) __m |= _CTYPEMASK_A;
++ if (isgraph (*__lo)) __m |= _CTYPEMASK_G;
++ if (isprint (*__lo)) __m |= _CTYPEMASK_R;
++ if (isxdigit(*__lo)) __m |= _CTYPEMASK_X;
++ /* alnum already covered = alpha | digit */
++
++ *__vec = __m;
++ }
++ return __hi;
++ }
++
++ inline const wchar_t*
++ ctype<wchar_t>::
++ do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
++ {
++ while (__lo < __hi && !(__libc_ctype_ [*__lo + 1] & __m))
++ ++__lo;
++ return __lo;
++ }
++
++ inline const wchar_t*
++ ctype<wchar_t>::
++ do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
++ {
++ while (__lo < __hi && (__libc_ctype_ [*__lo + 1] & __m))
++ ++__lo;
++ return __lo;
++ }
++#endif
++
++_GLIBCXX_END_NAMESPACE_VERSION
++} // namespace
+--- /dev/null
++++ libstdc++-v3/config/os/bsd/dragonfly/ctype_noninline.h
+@@ -0,0 +1,94 @@
++// Locale support -*- C++ -*-
++
++// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2009, 2010
++// Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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.
++
++// This library 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.
++
++// Under Section 7 of GPL version 3, you are granted additional
++// permissions described in the GCC Runtime Library Exception, version
++// 3.1, as published by the Free Software Foundation.
++
++// You should have received a copy of the GNU General Public License and
++// a copy of the GCC Runtime Library Exception along with this program;
++// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
++// <http://www.gnu.org/licenses/>.
++
++/** @file bits/ctype_noninline.h
++ * This is an internal header file, included by other library headers.
++ * Do not attempt to use it directly. @headername{locale}
++ */
++
++//
++// ISO C++ 14882: 22.1 Locales
++//
++
++// Information as gleaned from /usr/include/ctype.h
++
++ extern "C" const __uint16_t __libc_C_ctype_[];
++
++ const ctype_base::mask*
++ ctype<char>::classic_table() throw()
++ { return __libc_C_ctype_ + 1; }
++
++ ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
++ size_t __refs)
++ : facet(__refs), _M_del(__table != 0 && __del),
++ _M_toupper(NULL), _M_tolower(NULL),
++ _M_table(__table ? __table : classic_table())
++ {
++ memset(_M_widen, 0, sizeof(_M_widen));
++ _M_widen_ok = 0;
++ memset(_M_narrow, 0, sizeof(_M_narrow));
++ _M_narrow_ok = 0;
++ }
++
++ ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
++ : facet(__refs), _M_del(__table != 0 && __del),
++ _M_toupper(NULL), _M_tolower(NULL),
++ _M_table(__table ? __table : classic_table())
++ {
++ memset(_M_widen, 0, sizeof(_M_widen));
++ _M_widen_ok = 0;
++ memset(_M_narrow, 0, sizeof(_M_narrow));
++ _M_narrow_ok = 0;
++ }
++
++ char
++ ctype<char>::do_toupper(char __c) const
++ { return ::toupper((int) __c); }
++
++ const char*
++ ctype<char>::do_toupper(char* __low, const char* __high) const
++ {
++ while (__low < __high)
++ {
++ *__low = ::toupper((int) *__low);
++ ++__low;
++ }
++ return __high;
++ }
++
++ char
++ ctype<char>::do_tolower(char __c) const
++ { return ::tolower((int) __c); }
++
++ const char*
++ ctype<char>::do_tolower(char* __low, const char* __high) const
++ {
++ while (__low < __high)
++ {
++ *__low = ::tolower((int) *__low);
++ ++__low;
++ }
++ return __high;
++ }
+--- /dev/null
++++ libstdc++-v3/config/os/bsd/dragonfly/os_defines.h
+@@ -0,0 +1,45 @@
++// Specific definitions for BSD -*- C++ -*-
++
++// Copyright (C) 2000, 2009, 2010 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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.
++
++// This library 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.
++
++// Under Section 7 of GPL version 3, you are granted additional
++// permissions described in the GCC Runtime Library Exception, version
++// 3.1, as published by the Free Software Foundation.
++
++// You should have received a copy of the GNU General Public License and
++// a copy of the GCC Runtime Library Exception along with this program;
++// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
++// <http://www.gnu.org/licenses/>.
++
++/** @file bits/os_defines.h
++ * This is an internal header file, included by other library headers.
++ * Do not attempt to use it directly. @headername{iosfwd}
++ */
++
++#ifndef _GLIBCXX_OS_DEFINES
++#define _GLIBCXX_OS_DEFINES 1
++
++// System-specific #define, typedefs, corrections, etc, go here. This
++// file will come before all others.
++
++/* FreeBSD approach, likely a mistake for DragonFly.
++#define _GLIBCXX_USE_C99_CHECK 1
++#define _GLIBCXX_USE_C99_DYNAMIC (!(__ISO_C_VISIBLE >= 1999))
++#define _GLIBCXX_USE_C99_LONG_LONG_CHECK 1
++#define _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC (_GLIBCXX_USE_C99_DYNAMIC || !defined __LONG_LONG_SUPPORTED)
++#define _GLIBCXX_USE_C99_FLOAT_TRANSCENDENTALS_CHECK 1
++#define _GLIBCXX_USE_C99_FLOAT_TRANSCENDENTALS_DYNAMIC defined _XOPEN_SOURCE
++*/
++
++#endif
diff --git a/lang/gnat-aux/files/diff-cxx-testsuite b/lang/gnat-aux/files/diff-cxx-testsuite
new file mode 100644
index 000000000000..16f2953280d9
--- /dev/null
+++ b/lang/gnat-aux/files/diff-cxx-testsuite
@@ -0,0 +1,4547 @@
+--- gcc/testsuite/g++.dg/cdce3.C.orig
++++ gcc/testsuite/g++.dg/cdce3.C
+@@ -1,4 +1,4 @@
+-/* { dg-do run } */
++/* { dg-do run { target { ! "*-*-freebsd* *-*-dragonfly* *-*-netbsd*" } } } */
+ /* { dg-require-effective-target c99_runtime } */
+ /* { dg-skip-if "exp2* missing despite C99 runtime" { alpha*-dec-osf5* } } */
+ /* { dg-options "-O2 -fmath-errno -fdump-tree-cdce-details -DGNU_EXTENSION -DLARGE_LONG_DOUBLE -lm" { target { pow10 && large_long_double } } } */
+--- gcc/testsuite/g++.dg/uninit-pred-3_b.C.orig
++++ gcc/testsuite/g++.dg/uninit-pred-3_b.C
+@@ -65,7 +65,7 @@
+
+ void P (int64 t)
+ {
+- int cc; /* { dg-excess-errors "note: 'cc' was declared here" } */
++ int cc;
+ if (!GetC (&cc))
+ return;
+
+--- gcc/testsuite/gcc.dg/builtins-config.h.orig
++++ gcc/testsuite/gcc.dg/builtins-config.h
+@@ -13,8 +13,14 @@
+ /* PA HP-UX doesn't have the entire C99 runtime. */
+ #elif defined(__AVR__)
+ /* AVR doesn't have the entire C99 runtime. */
+-#elif defined(__FreeBSD__) && (__FreeBSD__ < 9)
+-/* FreeBSD up to version 8 lacks support for cexp and friends. */
++#elif defined(__FreeBSD__) && (__FreeBSD__ < 10)
++/* FreeBSD up to version 9 lacks support for cexp and friends. */
++#elif defined(__DragonFly__)
++/* As of DragonFly 2.13, Full C99 support is not available.
++ It has the same libm functionality as FreeBSD, which is missing
++ several long-double functions. */
++#elif defined(__NetBSD__)
++/* As of NetBSD 5.99, libm is nowhere close to supporting C99 */
+ #elif defined(__netware__)
+ /* NetWare doesn't have the entire C99 runtime. */
+ #elif defined(__vxworks)
+--- libstdc++-v3/testsuite/17_intro/headers/c++1998/stdc++.cc.orig
++++ libstdc++-v3/testsuite/17_intro/headers/c++1998/stdc++.cc
+@@ -1,5 +1,5 @@
+ // FreeBSD wants warning clean system headers:
+-// { dg-options "-Wall -Wsystem-headers" { target *-*-freebsd* } }
++// { dg-options "-Wall -Wsystem-headers" { target *-*-freebsd* *-*-dragonfly* } }
+ // { dg-do compile }
+ // 1999-05-12 bkoz
+
+--- libstdc++-v3/testsuite/17_intro/headers/c++1998/stdc++_multiple_inclusion.cc.orig
++++ libstdc++-v3/testsuite/17_intro/headers/c++1998/stdc++_multiple_inclusion.cc
+@@ -1,5 +1,5 @@
+ // FreeBSD wants warning clean system headers:
+-// { dg-options "-Wall -Wsystem-headers" { target *-*-freebsd* } }
++// { dg-options "-Wall -Wsystem-headers" { target *-*-freebsd* *-*-dragonfly* } }
+ // { dg-do compile }
+ // 1999-05-12 bkoz
+
+--- libstdc++-v3/testsuite/17_intro/headers/c++200x/stdc++.cc.orig
++++ libstdc++-v3/testsuite/17_intro/headers/c++200x/stdc++.cc
+@@ -1,5 +1,5 @@
+ // FreeBSD wants warning clean system headers:
+-// { dg-options "-Wall -Wsystem-headers" { target *-*-freebsd* } }
++// { dg-options "-Wall -Wsystem-headers" { target *-*-freebsd* *-*-dragonfly* } }
+ // { dg-options "-std=gnu++0x" }
+ // { dg-do compile }
+
+--- libstdc++-v3/testsuite/17_intro/headers/c++200x/stdc++_multiple_inclusion.cc.orig
++++ libstdc++-v3/testsuite/17_intro/headers/c++200x/stdc++_multiple_inclusion.cc
+@@ -1,5 +1,5 @@
+ // FreeBSD wants warning clean system headers:
+-// { dg-options "-Wall -Wsystem-headers" { target *-*-freebsd* } }
++// { dg-options "-Wall -Wsystem-headers" { target *-*-freebsd* *-*-dragonfly* } }
+ // { dg-options "-std=gnu++0x" }
+ // { dg-do compile }
+
+--- libstdc++-v3/testsuite/18_support/pthread_guard.cc.orig
++++ libstdc++-v3/testsuite/18_support/pthread_guard.cc
+@@ -16,8 +16,8 @@
+ // with this library; see the file COPYING3. If not see
+ // <http://www.gnu.org/licenses/>.
+
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* } }
+-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-darwin* alpha*-*-osf* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* } }
++// { dg-options "-pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-darwin* alpha*-*-osf* } }
+
+ #include <cstdlib>
+ #include <pthread.h>
+--- libstdc++-v3/testsuite/20_util/shared_ptr/thread/default_weaktoshared.cc.orig
++++ libstdc++-v3/testsuite/20_util/shared_ptr/thread/default_weaktoshared.cc
+@@ -17,8 +17,8 @@
+
+ // 20.6.6.2 Template class shared_ptr [util.smartptr.shared]
+
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options "-pthread -std=gnu++0x" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options "-pthread -std=gnu++0x" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options "-pthreads -std=gnu++0x" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+
+--- libstdc++-v3/testsuite/20_util/shared_ptr/thread/mutex_weaktoshared.cc.orig
++++ libstdc++-v3/testsuite/20_util/shared_ptr/thread/mutex_weaktoshared.cc
+@@ -17,8 +17,8 @@
+
+ // 20.6.6.2 Template class shared_ptr [util.smartptr.shared]
+
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+
+--- libstdc++-v3/testsuite/21_strings/basic_string/pthread18185.cc.orig
++++ libstdc++-v3/testsuite/21_strings/basic_string/pthread18185.cc
+@@ -16,8 +16,8 @@
+ // with this library; see the file COPYING3. If not see
+ // <http://www.gnu.org/licenses/>.
+
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options "-pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options "-pthreads" { target *-*-solaris* } }
+
+ #include <ext/new_allocator.h>
+--- libstdc++-v3/testsuite/21_strings/basic_string/pthread4.cc.orig
++++ libstdc++-v3/testsuite/21_strings/basic_string/pthread4.cc
+@@ -20,8 +20,8 @@
+ // with this library; see the file COPYING3. If not see
+ // <http://www.gnu.org/licenses/>.
+
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options "-pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options "-pthreads" { target *-*-solaris* } }
+
+ #include <string>
+--- libstdc++-v3/testsuite/22_locale/locale/cons/12658_thread-1.cc.orig
++++ libstdc++-v3/testsuite/22_locale/locale/cons/12658_thread-1.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options "-pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options "-pthreads" { target *-*-solaris* } }
+ // { dg-require-namedlocale "en_US" }
+ // { dg-require-namedlocale "fr_FR" }
+--- libstdc++-v3/testsuite/22_locale/locale/cons/12658_thread-2.cc.orig
++++ libstdc++-v3/testsuite/22_locale/locale/cons/12658_thread-2.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options "-pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options "-pthreads" { target *-*-solaris* } }
+ // { dg-require-namedlocale "en_US" }
+ // { dg-require-namedlocale "fr_FR" }
+--- libstdc++-v3/testsuite/23_containers/list/pthread1.cc.orig
++++ libstdc++-v3/testsuite/23_containers/list/pthread1.cc
+@@ -18,8 +18,8 @@
+ // with this library; see the file COPYING3. If not see
+ // <http://www.gnu.org/licenses/>.
+
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options "-pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options "-pthreads" { target *-*-solaris* } }
+
+ // This multi-threading C++/STL/POSIX code adheres to rules outlined here:
+--- libstdc++-v3/testsuite/23_containers/list/pthread5.cc.orig
++++ libstdc++-v3/testsuite/23_containers/list/pthread5.cc
+@@ -20,8 +20,8 @@
+ // with this library; see the file COPYING3. If not see
+ // <http://www.gnu.org/licenses/>.
+
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options "-pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options "-pthreads" { target *-*-solaris* } }
+
+ #include <vector>
+--- libstdc++-v3/testsuite/23_containers/map/pthread6.cc.orig
++++ libstdc++-v3/testsuite/23_containers/map/pthread6.cc
+@@ -19,8 +19,8 @@
+ // with this library; see the file COPYING3. If not see
+ // <http://www.gnu.org/licenses/>.
+
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options "-pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options "-pthreads" { target *-*-solaris* } }
+
+ #include <string>
+--- libstdc++-v3/testsuite/23_containers/vector/debug/multithreaded_swap.cc.orig
++++ libstdc++-v3/testsuite/23_containers/vector/debug/multithreaded_swap.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/26_numerics/headers/cmath/c_math_dynamic.cc.orig
++++ libstdc++-v3/testsuite/26_numerics/headers/cmath/c_math_dynamic.cc
+@@ -19,7 +19,7 @@
+
+
+ // { dg-do link }
+-// { dg-options "-D_XOPEN_SOURCE" { target *-*-freebsd* } }
++// { dg-options "-D_XOPEN_SOURCE" { target *-*-freebsd* *-*-dragonfly* } }
+
+ #include <cmath>
+
+--- libstdc++-v3/testsuite/27_io/basic_ofstream/pthread2.cc.orig
++++ libstdc++-v3/testsuite/27_io/basic_ofstream/pthread2.cc
+@@ -19,8 +19,8 @@
+ // with this library; see the file COPYING3. If not see
+ // <http://www.gnu.org/licenses/>.
+
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options "-pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options "-pthreads" { target *-*-solaris* } }
+
+ #include <fstream>
+--- libstdc++-v3/testsuite/27_io/basic_ostringstream/pthread3.cc.orig
++++ libstdc++-v3/testsuite/27_io/basic_ostringstream/pthread3.cc
+@@ -19,8 +19,8 @@
+ // with this library; see the file COPYING3. If not see
+ // <http://www.gnu.org/licenses/>.
+
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options "-pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options "-pthreads" { target *-*-solaris* } }
+
+ #include <sstream>
+--- libstdc++-v3/testsuite/30_threads/async/42819.cc.orig
++++ libstdc++-v3/testsuite/30_threads/async/42819.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/async/any.cc.orig
++++ libstdc++-v3/testsuite/30_threads/async/any.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/async/async.cc.orig
++++ libstdc++-v3/testsuite/30_threads/async/async.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/async/sync.cc.orig
++++ libstdc++-v3/testsuite/30_threads/async/sync.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/call_once/39909.cc.orig
++++ libstdc++-v3/testsuite/30_threads/call_once/39909.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/call_once/call_once1.cc.orig
++++ libstdc++-v3/testsuite/30_threads/call_once/call_once1.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/condition_variable/cons/1.cc.orig
++++ libstdc++-v3/testsuite/30_threads/condition_variable/cons/1.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/condition_variable/members/1.cc.orig
++++ libstdc++-v3/testsuite/30_threads/condition_variable/members/1.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/condition_variable/members/2.cc.orig
++++ libstdc++-v3/testsuite/30_threads/condition_variable/members/2.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/condition_variable/native_handle/typesizes.cc.orig
++++ libstdc++-v3/testsuite/30_threads/condition_variable/native_handle/typesizes.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/condition_variable_any/cons/1.cc.orig
++++ libstdc++-v3/testsuite/30_threads/condition_variable_any/cons/1.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/condition_variable_any/members/1.cc.orig
++++ libstdc++-v3/testsuite/30_threads/condition_variable_any/members/1.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/condition_variable_any/members/2.cc.orig
++++ libstdc++-v3/testsuite/30_threads/condition_variable_any/members/2.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/future/cons/move.cc.orig
++++ libstdc++-v3/testsuite/30_threads/future/cons/move.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/future/members/45133.cc.orig
++++ libstdc++-v3/testsuite/30_threads/future/members/45133.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/future/members/get.cc.orig
++++ libstdc++-v3/testsuite/30_threads/future/members/get.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/future/members/get2.cc.orig
++++ libstdc++-v3/testsuite/30_threads/future/members/get2.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/future/members/valid.cc.orig
++++ libstdc++-v3/testsuite/30_threads/future/members/valid.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/future/members/wait.cc.orig
++++ libstdc++-v3/testsuite/30_threads/future/members/wait.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/future/members/wait_for.cc.orig
++++ libstdc++-v3/testsuite/30_threads/future/members/wait_for.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/future/members/wait_until.cc.orig
++++ libstdc++-v3/testsuite/30_threads/future/members/wait_until.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/lock/1.cc.orig
++++ libstdc++-v3/testsuite/30_threads/lock/1.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/lock/2.cc.orig
++++ libstdc++-v3/testsuite/30_threads/lock/2.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/lock/3.cc.orig
++++ libstdc++-v3/testsuite/30_threads/lock/3.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/lock/4.cc.orig
++++ libstdc++-v3/testsuite/30_threads/lock/4.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/lock_guard/cons/1.cc.orig
++++ libstdc++-v3/testsuite/30_threads/lock_guard/cons/1.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/mutex/cons/1.cc.orig
++++ libstdc++-v3/testsuite/30_threads/mutex/cons/1.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/mutex/dest/destructor_locked.cc.orig
++++ libstdc++-v3/testsuite/30_threads/mutex/dest/destructor_locked.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/mutex/lock/1.cc.orig
++++ libstdc++-v3/testsuite/30_threads/mutex/lock/1.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/mutex/native_handle/1.cc.orig
++++ libstdc++-v3/testsuite/30_threads/mutex/native_handle/1.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/mutex/native_handle/typesizes.cc.orig
++++ libstdc++-v3/testsuite/30_threads/mutex/native_handle/typesizes.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/mutex/try_lock/1.cc.orig
++++ libstdc++-v3/testsuite/30_threads/mutex/try_lock/1.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/mutex/try_lock/2.cc.orig
++++ libstdc++-v3/testsuite/30_threads/mutex/try_lock/2.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/mutex/unlock/1.cc.orig
++++ libstdc++-v3/testsuite/30_threads/mutex/unlock/1.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/packaged_task/cons/1.cc.orig
++++ libstdc++-v3/testsuite/30_threads/packaged_task/cons/1.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/packaged_task/cons/2.cc.orig
++++ libstdc++-v3/testsuite/30_threads/packaged_task/cons/2.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/packaged_task/cons/alloc.cc.orig
++++ libstdc++-v3/testsuite/30_threads/packaged_task/cons/alloc.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/packaged_task/cons/move.cc.orig
++++ libstdc++-v3/testsuite/30_threads/packaged_task/cons/move.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/packaged_task/cons/move_assign.cc.orig
++++ libstdc++-v3/testsuite/30_threads/packaged_task/cons/move_assign.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/packaged_task/members/get_future.cc.orig
++++ libstdc++-v3/testsuite/30_threads/packaged_task/members/get_future.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/packaged_task/members/get_future2.cc.orig
++++ libstdc++-v3/testsuite/30_threads/packaged_task/members/get_future2.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke.cc.orig
++++ libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke2.cc.orig
++++ libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke2.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke3.cc.orig
++++ libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke3.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke4.cc.orig
++++ libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke4.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke5.cc.orig
++++ libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke5.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/packaged_task/members/reset.cc.orig
++++ libstdc++-v3/testsuite/30_threads/packaged_task/members/reset.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/packaged_task/members/reset2.cc.orig
++++ libstdc++-v3/testsuite/30_threads/packaged_task/members/reset2.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/packaged_task/members/swap.cc.orig
++++ libstdc++-v3/testsuite/30_threads/packaged_task/members/swap.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/packaged_task/members/valid.cc.orig
++++ libstdc++-v3/testsuite/30_threads/packaged_task/members/valid.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/promise/cons/1.cc.orig
++++ libstdc++-v3/testsuite/30_threads/promise/cons/1.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/promise/cons/alloc.cc.orig
++++ libstdc++-v3/testsuite/30_threads/promise/cons/alloc.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/promise/cons/move.cc.orig
++++ libstdc++-v3/testsuite/30_threads/promise/cons/move.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/promise/cons/move_assign.cc.orig
++++ libstdc++-v3/testsuite/30_threads/promise/cons/move_assign.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/promise/members/get_future.cc.orig
++++ libstdc++-v3/testsuite/30_threads/promise/members/get_future.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/promise/members/get_future2.cc.orig
++++ libstdc++-v3/testsuite/30_threads/promise/members/get_future2.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/promise/members/set_exception.cc.orig
++++ libstdc++-v3/testsuite/30_threads/promise/members/set_exception.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/promise/members/set_exception2.cc.orig
++++ libstdc++-v3/testsuite/30_threads/promise/members/set_exception2.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/promise/members/set_value.cc.orig
++++ libstdc++-v3/testsuite/30_threads/promise/members/set_value.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/promise/members/set_value2.cc.orig
++++ libstdc++-v3/testsuite/30_threads/promise/members/set_value2.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/promise/members/set_value3.cc.orig
++++ libstdc++-v3/testsuite/30_threads/promise/members/set_value3.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/promise/members/swap.cc.orig
++++ libstdc++-v3/testsuite/30_threads/promise/members/swap.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/recursive_mutex/cons/1.cc.orig
++++ libstdc++-v3/testsuite/30_threads/recursive_mutex/cons/1.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc.orig
++++ libstdc++-v3/testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/recursive_mutex/lock/1.cc.orig
++++ libstdc++-v3/testsuite/30_threads/recursive_mutex/lock/1.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/recursive_mutex/native_handle/1.cc.orig
++++ libstdc++-v3/testsuite/30_threads/recursive_mutex/native_handle/1.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/recursive_mutex/native_handle/typesizes.cc.orig
++++ libstdc++-v3/testsuite/30_threads/recursive_mutex/native_handle/typesizes.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/recursive_mutex/try_lock/1.cc.orig
++++ libstdc++-v3/testsuite/30_threads/recursive_mutex/try_lock/1.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/recursive_mutex/try_lock/2.cc.orig
++++ libstdc++-v3/testsuite/30_threads/recursive_mutex/try_lock/2.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/recursive_mutex/unlock/1.cc.orig
++++ libstdc++-v3/testsuite/30_threads/recursive_mutex/unlock/1.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/cons/1.cc.orig
++++ libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/cons/1.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/dest/destructor_locked.cc.orig
++++ libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/dest/destructor_locked.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/lock/1.cc.orig
++++ libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/lock/1.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/lock/2.cc.orig
++++ libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/lock/2.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/native_handle/1.cc.orig
++++ libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/native_handle/1.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/native_handle/typesizes.cc.orig
++++ libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/native_handle/typesizes.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock/1.cc.orig
++++ libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock/1.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock/2.cc.orig
++++ libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock/2.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options "-std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options "-std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options "-std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options "-std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_for/1.cc.orig
++++ libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_for/1.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_for/2.cc.orig
++++ libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_for/2.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_for/3.cc.orig
++++ libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_for/3.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_until/1.cc.orig
++++ libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_until/1.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_until/2.cc.orig
++++ libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_until/2.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/unlock/1.cc.orig
++++ libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/unlock/1.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/shared_future/cons/move.cc.orig
++++ libstdc++-v3/testsuite/30_threads/shared_future/cons/move.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/shared_future/members/45133.cc.orig
++++ libstdc++-v3/testsuite/30_threads/shared_future/members/45133.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/shared_future/members/get.cc.orig
++++ libstdc++-v3/testsuite/30_threads/shared_future/members/get.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/shared_future/members/get2.cc.orig
++++ libstdc++-v3/testsuite/30_threads/shared_future/members/get2.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/shared_future/members/valid.cc.orig
++++ libstdc++-v3/testsuite/30_threads/shared_future/members/valid.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/shared_future/members/wait.cc.orig
++++ libstdc++-v3/testsuite/30_threads/shared_future/members/wait.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/shared_future/members/wait_for.cc.orig
++++ libstdc++-v3/testsuite/30_threads/shared_future/members/wait_for.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/shared_future/members/wait_until.cc.orig
++++ libstdc++-v3/testsuite/30_threads/shared_future/members/wait_until.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/this_thread/1.cc.orig
++++ libstdc++-v3/testsuite/30_threads/this_thread/1.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/this_thread/2.cc.orig
++++ libstdc++-v3/testsuite/30_threads/this_thread/2.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/this_thread/3.cc.orig
++++ libstdc++-v3/testsuite/30_threads/this_thread/3.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/this_thread/4.cc.orig
++++ libstdc++-v3/testsuite/30_threads/this_thread/4.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/thread/cons/1.cc.orig
++++ libstdc++-v3/testsuite/30_threads/thread/cons/1.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/thread/cons/2.cc.orig
++++ libstdc++-v3/testsuite/30_threads/thread/cons/2.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/thread/cons/3.cc.orig
++++ libstdc++-v3/testsuite/30_threads/thread/cons/3.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/thread/cons/4.cc.orig
++++ libstdc++-v3/testsuite/30_threads/thread/cons/4.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/thread/cons/5.cc.orig
++++ libstdc++-v3/testsuite/30_threads/thread/cons/5.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/thread/cons/6.cc.orig
++++ libstdc++-v3/testsuite/30_threads/thread/cons/6.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/thread/cons/7.cc.orig
++++ libstdc++-v3/testsuite/30_threads/thread/cons/7.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/thread/cons/8.cc.orig
++++ libstdc++-v3/testsuite/30_threads/thread/cons/8.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/thread/cons/9.cc.orig
++++ libstdc++-v3/testsuite/30_threads/thread/cons/9.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/thread/cons/moveable.cc.orig
++++ libstdc++-v3/testsuite/30_threads/thread/cons/moveable.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/thread/members/1.cc.orig
++++ libstdc++-v3/testsuite/30_threads/thread/members/1.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/thread/members/2.cc.orig
++++ libstdc++-v3/testsuite/30_threads/thread/members/2.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/thread/members/3.cc.orig
++++ libstdc++-v3/testsuite/30_threads/thread/members/3.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/thread/members/4.cc.orig
++++ libstdc++-v3/testsuite/30_threads/thread/members/4.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/thread/members/5.cc.orig
++++ libstdc++-v3/testsuite/30_threads/thread/members/5.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/thread/members/hardware_concurrency.cc.orig
++++ libstdc++-v3/testsuite/30_threads/thread/members/hardware_concurrency.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/thread/swap/1.cc.orig
++++ libstdc++-v3/testsuite/30_threads/thread/swap/1.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/timed_mutex/cons/1.cc.orig
++++ libstdc++-v3/testsuite/30_threads/timed_mutex/cons/1.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/timed_mutex/dest/destructor_locked.cc.orig
++++ libstdc++-v3/testsuite/30_threads/timed_mutex/dest/destructor_locked.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/timed_mutex/lock/1.cc.orig
++++ libstdc++-v3/testsuite/30_threads/timed_mutex/lock/1.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/timed_mutex/native_handle/1.cc.orig
++++ libstdc++-v3/testsuite/30_threads/timed_mutex/native_handle/1.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/timed_mutex/native_handle/typesizes.cc.orig
++++ libstdc++-v3/testsuite/30_threads/timed_mutex/native_handle/typesizes.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock/1.cc.orig
++++ libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock/1.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock/2.cc.orig
++++ libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock/2.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_for/1.cc.orig
++++ libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_for/1.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_for/2.cc.orig
++++ libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_for/2.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_for/3.cc.orig
++++ libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_for/3.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_until/1.cc.orig
++++ libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_until/1.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_until/2.cc.orig
++++ libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_until/2.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/timed_mutex/unlock/1.cc.orig
++++ libstdc++-v3/testsuite/30_threads/timed_mutex/unlock/1.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/try_lock/1.cc.orig
++++ libstdc++-v3/testsuite/30_threads/try_lock/1.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/try_lock/2.cc.orig
++++ libstdc++-v3/testsuite/30_threads/try_lock/2.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/try_lock/3.cc.orig
++++ libstdc++-v3/testsuite/30_threads/try_lock/3.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/try_lock/4.cc.orig
++++ libstdc++-v3/testsuite/30_threads/try_lock/4.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/unique_lock/cons/1.cc.orig
++++ libstdc++-v3/testsuite/30_threads/unique_lock/cons/1.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/unique_lock/cons/2.cc.orig
++++ libstdc++-v3/testsuite/30_threads/unique_lock/cons/2.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/unique_lock/cons/3.cc.orig
++++ libstdc++-v3/testsuite/30_threads/unique_lock/cons/3.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/unique_lock/cons/4.cc.orig
++++ libstdc++-v3/testsuite/30_threads/unique_lock/cons/4.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/unique_lock/cons/5.cc.orig
++++ libstdc++-v3/testsuite/30_threads/unique_lock/cons/5.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/unique_lock/cons/6.cc.orig
++++ libstdc++-v3/testsuite/30_threads/unique_lock/cons/6.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/unique_lock/locking/1.cc.orig
++++ libstdc++-v3/testsuite/30_threads/unique_lock/locking/1.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/unique_lock/locking/2.cc.orig
++++ libstdc++-v3/testsuite/30_threads/unique_lock/locking/2.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/unique_lock/locking/3.cc.orig
++++ libstdc++-v3/testsuite/30_threads/unique_lock/locking/3.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/unique_lock/locking/4.cc.orig
++++ libstdc++-v3/testsuite/30_threads/unique_lock/locking/4.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/unique_lock/modifiers/1.cc.orig
++++ libstdc++-v3/testsuite/30_threads/unique_lock/modifiers/1.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/30_threads/unique_lock/modifiers/2.cc.orig
++++ libstdc++-v3/testsuite/30_threads/unique_lock/modifiers/2.cc
+@@ -1,5 +1,5 @@
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+ // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+ // { dg-require-cstdint "" }
+--- libstdc++-v3/testsuite/ext/rope/pthread7-rope.cc.orig
++++ libstdc++-v3/testsuite/ext/rope/pthread7-rope.cc
+@@ -18,8 +18,8 @@
+ // with this library; see the file COPYING3. If not see
+ // <http://www.gnu.org/licenses/>.
+
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options "-pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options "-pthreads" { target *-*-solaris* } }
+
+ #include <ext/rope>
+--- libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/thread/default_weaktoshared.cc.orig
++++ libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/thread/default_weaktoshared.cc
+@@ -17,8 +17,8 @@
+
+ // TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
+
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options "-pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options "-pthreads" { target *-*-solaris* } }
+
+ #include <tr1/memory>
+--- libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/thread/mutex_weaktoshared.cc.orig
++++ libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/thread/mutex_weaktoshared.cc
+@@ -17,8 +17,8 @@
+
+ // TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
+
+-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
+-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } }
++// { dg-options "-pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } }
+ // { dg-options "-pthreads" { target *-*-solaris* } }
+
+ #include <tr1/memory>
+--- libstdc++-v3/testsuite/lib/libstdc++.exp.orig
++++ libstdc++-v3/testsuite/lib/libstdc++.exp
+@@ -865,17 +865,18 @@
+ set f [open $src "w"]
+ puts $f "#include <locale>"
+ puts $f "#include <cstdio>"
+- puts $f "using namespace std;"
++ puts $f "using namespace std;"
+ puts $f "int main (int argc, char** argv)"
+ puts $f "{"
++ puts $f " const char* mlx = *(argv + 1);"
+ puts $f " try"
+ puts $f " {"
+- puts $f " locale(*(argv + 1));"
++ puts $f " locale((char*)(mlx));"
+ puts $f " return 0;"
+ puts $f " }"
+ puts $f " catch(...)"
+ puts $f " {"
+- puts $f " printf(\"locale '%s' not supported\\n\", *(argv + 1));"
++ puts $f " printf(\"locale '%s' not supported\\n\", mlx);"
+ puts $f " return 1;"
+ puts $f " }"
+ puts $f "}"
+--- libstdc++-v3/testsuite/23_containers/deque/debug/assign4_neg.cc.orig
++++ libstdc++-v3/testsuite/23_containers/deque/debug/assign4_neg.cc
+@@ -15,6 +15,7 @@
+ // with this library; see the file COPYING3. If not see
+ // <http://www.gnu.org/licenses/>.
+ //
++// { dg-require-debug-mode "" }
+ // { dg-do run { xfail *-*-* } }
+
+ #include <debug/deque>
+--- libstdc++-v3/testsuite/23_containers/deque/debug/construct4_neg.cc.orig
++++ libstdc++-v3/testsuite/23_containers/deque/debug/construct4_neg.cc
+@@ -15,6 +15,7 @@
+ // with this library; see the file COPYING3. If not see
+ // <http://www.gnu.org/licenses/>.
+ //
++// { dg-require-debug-mode "" }
+ // { dg-do run { xfail *-*-* } }
+
+ #include <debug/deque>
+--- libstdc++-v3/testsuite/23_containers/deque/debug/insert4_neg.cc.orig
++++ libstdc++-v3/testsuite/23_containers/deque/debug/insert4_neg.cc
+@@ -15,6 +15,7 @@
+ // with this library; see the file COPYING3. If not see
+ // <http://www.gnu.org/licenses/>.
+ //
++// { dg-require-debug-mode "" }
+ // { dg-do run { xfail *-*-* } }
+
+ #include <debug/deque>
+--- libstdc++-v3/testsuite/23_containers/list/debug/assign4_neg.cc.orig
++++ libstdc++-v3/testsuite/23_containers/list/debug/assign4_neg.cc
+@@ -15,6 +15,7 @@
+ // with this library; see the file COPYING3. If not see
+ // <http://www.gnu.org/licenses/>.
+ //
++// { dg-require-debug-mode "" }
+ // { dg-do run { xfail *-*-* } }
+
+ #include <debug/list>
+--- libstdc++-v3/testsuite/23_containers/list/debug/construct4_neg.cc.orig
++++ libstdc++-v3/testsuite/23_containers/list/debug/construct4_neg.cc
+@@ -15,6 +15,7 @@
+ // with this library; see the file COPYING3. If not see
+ // <http://www.gnu.org/licenses/>.
+ //
++// { dg-require-debug-mode "" }
+ // { dg-do run { xfail *-*-* } }
+
+ #include <debug/list>
+--- libstdc++-v3/testsuite/23_containers/list/debug/insert4_neg.cc.orig
++++ libstdc++-v3/testsuite/23_containers/list/debug/insert4_neg.cc
+@@ -15,6 +15,7 @@
+ // with this library; see the file COPYING3. If not see
+ // <http://www.gnu.org/licenses/>.
+ //
++// { dg-require-debug-mode "" }
+ // { dg-do run { xfail *-*-* } }
+
+ #include <debug/list>
+--- libstdc++-v3/testsuite/23_containers/map/debug/construct4_neg.cc.orig
++++ libstdc++-v3/testsuite/23_containers/map/debug/construct4_neg.cc
+@@ -15,6 +15,7 @@
+ // with this library; see the file COPYING3. If not see
+ // <http://www.gnu.org/licenses/>.
+ //
++// { dg-require-debug-mode "" }
+ // { dg-do run { xfail *-*-* } }
+
+ #include <debug/map>
+--- libstdc++-v3/testsuite/23_containers/map/debug/insert4_neg.cc.orig
++++ libstdc++-v3/testsuite/23_containers/map/debug/insert4_neg.cc
+@@ -15,6 +15,7 @@
+ // with this library; see the file COPYING3. If not see
+ // <http://www.gnu.org/licenses/>.
+ //
++// { dg-require-debug-mode "" }
+ // { dg-do run { xfail *-*-* } }
+
+ #include <debug/map>
+--- libstdc++-v3/testsuite/23_containers/multimap/debug/construct4_neg.cc.orig
++++ libstdc++-v3/testsuite/23_containers/multimap/debug/construct4_neg.cc
+@@ -15,6 +15,7 @@
+ // with this library; see the file COPYING3. If not see
+ // <http://www.gnu.org/licenses/>.
+ //
++// { dg-require-debug-mode "" }
+ // { dg-do run { xfail *-*-* } }
+
+ #include <debug/map>
+--- libstdc++-v3/testsuite/23_containers/multimap/debug/insert4_neg.cc.orig
++++ libstdc++-v3/testsuite/23_containers/multimap/debug/insert4_neg.cc
+@@ -15,6 +15,7 @@
+ // with this library; see the file COPYING3. If not see
+ // <http://www.gnu.org/licenses/>.
+ //
++// { dg-require-debug-mode "" }
+ // { dg-do run { xfail *-*-* } }
+
+ #include <debug/map>
+--- libstdc++-v3/testsuite/23_containers/multiset/debug/construct4_neg.cc.orig
++++ libstdc++-v3/testsuite/23_containers/multiset/debug/construct4_neg.cc
+@@ -15,6 +15,7 @@
+ // with this library; see the file COPYING3. If not see
+ // <http://www.gnu.org/licenses/>.
+ //
++// { dg-require-debug-mode "" }
+ // { dg-do run { xfail *-*-* } }
+
+ #include <debug/set>
+--- libstdc++-v3/testsuite/23_containers/multiset/debug/insert4_neg.cc.orig
++++ libstdc++-v3/testsuite/23_containers/multiset/debug/insert4_neg.cc
+@@ -15,6 +15,7 @@
+ // with this library; see the file COPYING3. If not see
+ // <http://www.gnu.org/licenses/>.
+ //
++// { dg-require-debug-mode "" }
+ // { dg-do run { xfail *-*-* } }
+
+ #include <debug/set>
+--- libstdc++-v3/testsuite/23_containers/set/debug/construct4_neg.cc.orig
++++ libstdc++-v3/testsuite/23_containers/set/debug/construct4_neg.cc
+@@ -15,6 +15,7 @@
+ // with this library; see the file COPYING3. If not see
+ // <http://www.gnu.org/licenses/>.
+ //
++// { dg-require-debug-mode "" }
+ // { dg-do run { xfail *-*-* } }
+
+ #include <debug/set>
+--- libstdc++-v3/testsuite/23_containers/set/debug/insert4_neg.cc.orig
++++ libstdc++-v3/testsuite/23_containers/set/debug/insert4_neg.cc
+@@ -15,6 +15,7 @@
+ // with this library; see the file COPYING3. If not see
+ // <http://www.gnu.org/licenses/>.
+ //
++// { dg-require-debug-mode "" }
+ // { dg-do run { xfail *-*-* } }
+
+ #include <debug/set>
+--- libstdc++-v3/testsuite/23_containers/unordered_map/debug/construct4_neg.cc.orig
++++ libstdc++-v3/testsuite/23_containers/unordered_map/debug/construct4_neg.cc
+@@ -15,6 +15,7 @@
+ // with this library; see the file COPYING3. If not see
+ // <http://www.gnu.org/licenses/>.
+ //
++// { dg-require-debug-mode "" }
+ // { dg-options "-std=gnu++0x" }
+ // { dg-do run { xfail *-*-* } }
+
+--- libstdc++-v3/testsuite/23_containers/unordered_map/debug/insert4_neg.cc.orig
++++ libstdc++-v3/testsuite/23_containers/unordered_map/debug/insert4_neg.cc
+@@ -15,6 +15,7 @@
+ // with this library; see the file COPYING3. If not see
+ // <http://www.gnu.org/licenses/>.
+ //
++// { dg-require-debug-mode "" }
+ // { dg-options "-std=gnu++0x" }
+ // { dg-do run { xfail *-*-* } }
+
+--- libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/construct4_neg.cc.orig
++++ libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/construct4_neg.cc
+@@ -15,6 +15,7 @@
+ // with this library; see the file COPYING3. If not see
+ // <http://www.gnu.org/licenses/>.
+ //
++// { dg-require-debug-mode "" }
+ // { dg-options "-std=gnu++0x" }
+ // { dg-do run { xfail *-*-* } }
+
+--- libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/insert4_neg.cc.orig
++++ libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/insert4_neg.cc
+@@ -15,6 +15,7 @@
+ // with this library; see the file COPYING3. If not see
+ // <http://www.gnu.org/licenses/>.
+ //
++// { dg-require-debug-mode "" }
+ // { dg-options "-std=gnu++0x" }
+ // { dg-do run { xfail *-*-* } }
+
+--- libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/construct4_neg.cc.orig
++++ libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/construct4_neg.cc
+@@ -15,6 +15,7 @@
+ // with this library; see the file COPYING3. If not see
+ // <http://www.gnu.org/licenses/>.
+ //
++// { dg-require-debug-mode "" }
+ // { dg-options "-std=gnu++0x" }
+ // { dg-do run { xfail *-*-* } }
+
+--- libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/insert4_neg.cc.orig
++++ libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/insert4_neg.cc
+@@ -15,6 +15,7 @@
+ // with this library; see the file COPYING3. If not see
+ // <http://www.gnu.org/licenses/>.
+ //
++// { dg-require-debug-mode "" }
+ // { dg-options "-std=gnu++0x" }
+ // { dg-do run { xfail *-*-* } }
+
+--- libstdc++-v3/testsuite/23_containers/unordered_set/debug/construct4_neg.cc.orig
++++ libstdc++-v3/testsuite/23_containers/unordered_set/debug/construct4_neg.cc
+@@ -15,6 +15,7 @@
+ // with this library; see the file COPYING3. If not see
+ // <http://www.gnu.org/licenses/>.
+ //
++// { dg-require-debug-mode "" }
+ // { dg-options "-std=gnu++0x" }
+ // { dg-do run { xfail *-*-* } }
+
+--- libstdc++-v3/testsuite/23_containers/unordered_set/debug/insert4_neg.cc.orig
++++ libstdc++-v3/testsuite/23_containers/unordered_set/debug/insert4_neg.cc
+@@ -15,6 +15,7 @@
+ // with this library; see the file COPYING3. If not see
+ // <http://www.gnu.org/licenses/>.
+ //
++// { dg-require-debug-mode "" }
+ // { dg-options "-std=gnu++0x" }
+ // { dg-do run { xfail *-*-* } }
+
+--- libstdc++-v3/testsuite/23_containers/vector/debug/assign4_neg.cc.orig
++++ libstdc++-v3/testsuite/23_containers/vector/debug/assign4_neg.cc
+@@ -15,6 +15,7 @@
+ // with this library; see the file COPYING3. If not see
+ // <http://www.gnu.org/licenses/>.
+ //
++// { dg-require-debug-mode "" }
+ // { dg-do run { xfail *-*-* } }
+
+ #include <debug/vector>
+--- libstdc++-v3/testsuite/23_containers/vector/debug/construct4_neg.cc.orig
++++ libstdc++-v3/testsuite/23_containers/vector/debug/construct4_neg.cc
+@@ -15,6 +15,7 @@
+ // with this library; see the file COPYING3. If not see
+ // <http://www.gnu.org/licenses/>.
+ //
++// { dg-require-debug-mode "" }
+ // { dg-do run { xfail *-*-* } }
+
+ #include <debug/vector>
+--- libstdc++-v3/testsuite/23_containers/vector/debug/insert4_neg.cc.orig
++++ libstdc++-v3/testsuite/23_containers/vector/debug/insert4_neg.cc
+@@ -15,6 +15,7 @@
+ // with this library; see the file COPYING3. If not see
+ // <http://www.gnu.org/licenses/>.
+ //
++// { dg-require-debug-mode "" }
+ // { dg-do run { xfail *-*-* } }
+
+ #include <debug/vector>
+--- libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/2.cc.orig
++++ libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/2.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "en_US.ISO-8859-1" }
++// { dg-require-namedlocale "en_US.ISO8859-1" }
+
+ // 2003-02-06 Petur Runolfsson <peturr02@ru.is>
+
+@@ -27,14 +27,14 @@
+ // Required instantiation
+ // codecvt<wchar_t, char, mbstate_t>
+ //
+-// Baseline test in ISO-8859-1 locale
++// Baseline test in ISO8859-1 locale
+ void test02()
+ {
+ using namespace std;
+ bool test __attribute__((unused)) = true;
+ typedef codecvt<wchar_t, char, mbstate_t> w_codecvt;
+
+- locale loc = locale("en_US.ISO-8859-1");
++ locale loc = locale("en_US.ISO8859-1");
+ locale::global(loc);
+ const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
+
+--- libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/3.cc.orig
++++ libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/3.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "en_US.ISO-8859-15" }
++// { dg-require-namedlocale "en_US.ISO8859-15" }
+
+ // 2003-02-06 Petur Runolfsson <peturr02@ru.is>
+
+@@ -27,14 +27,14 @@
+ // Required instantiation
+ // codecvt<wchar_t, char, mbstate_t>
+ //
+-// Baseline test in ISO-8859-15 locale
++// Baseline test in ISO8859-15 locale
+ void test03()
+ {
+ using namespace std;
+ bool test __attribute__((unused)) = true;
+ typedef codecvt<wchar_t, char, mbstate_t> w_codecvt;
+
+- locale loc = locale("en_US.ISO-8859-15");
++ locale loc = locale("en_US.ISO8859-15");
+ locale::global(loc);
+ const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
+
+--- libstdc++-v3/testsuite/22_locale/codecvt/encoding/wchar_t/2.cc.orig
++++ libstdc++-v3/testsuite/22_locale/codecvt/encoding/wchar_t/2.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "en_US.ISO-8859-1" }
++// { dg-require-namedlocale "en_US.ISO8859-1" }
+
+ // 2003-02-06 Petur Runolfsson <peturr02@ru.is>
+
+@@ -27,19 +27,19 @@
+ // Required instantiation
+ // codecvt<wchar_t, char, mbstate_t>
+ //
+-// Test do_encoding with ISO-8859-1 locale.
++// Test do_encoding with ISO8859-1 locale.
+ void test02()
+ {
+ using namespace std;
+ typedef codecvt<wchar_t, char, mbstate_t> w_codecvt;
+ bool test __attribute__((unused)) = true;
+
+- locale loc = locale("en_US.ISO-8859-1");
++ locale loc = locale("en_US.ISO8859-1");
+ locale::global(loc);
+ const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
+
+ int i = cvt->encoding();
+- VERIFY( i == 1 ); // ISO-8859-1 is a single-byte encoding
++ VERIFY( i == 1 ); // ISO8859-1 is a single-byte encoding
+ }
+
+ int main ()
+--- libstdc++-v3/testsuite/22_locale/codecvt/encoding/wchar_t/3.cc.orig
++++ libstdc++-v3/testsuite/22_locale/codecvt/encoding/wchar_t/3.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "en_US.ISO-8859-15" }
++// { dg-require-namedlocale "en_US.ISO8859-15" }
+
+ // 2003-02-06 Petur Runolfsson <peturr02@ru.is>
+
+@@ -27,19 +27,19 @@
+ // Required instantiation
+ // codecvt<wchar_t, char, mbstate_t>
+ //
+-// Test do_encoding with ISO-8859-15 locale.
++// Test do_encoding with ISO8859-15 locale.
+ void test03()
+ {
+ using namespace std;
+ typedef codecvt<wchar_t, char, mbstate_t> w_codecvt;
+ bool test __attribute__((unused)) = true;
+
+- locale loc = locale("en_US.ISO-8859-15");
++ locale loc = locale("en_US.ISO8859-15");
+ locale::global(loc);
+ const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
+
+ int i = cvt->encoding();
+- VERIFY( i == 1 ); // ISO-8859-15 is a single-byte encoding
++ VERIFY( i == 1 ); // ISO8859-15 is a single-byte encoding
+ }
+
+ int main ()
+--- libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/2.cc.orig
++++ libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/2.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "en_US.ISO-8859-1" }
++// { dg-require-namedlocale "en_US.ISO8859-1" }
+
+ // 2003-02-06 Petur Runolfsson <peturr02@ru.is>
+
+@@ -41,7 +41,7 @@
+ // Required instantiation
+ // codecvt<wchar_t, char, mbstate_t>
+ //
+-// Baseline test for ISO-8859-1. Converts entire charset.
++// Baseline test for ISO8859-1. Converts entire charset.
+ void test02()
+ {
+ using namespace std;
+@@ -90,7 +90,7 @@
+ wmemset(i_ref, 0xdeadbeef, size + 1);
+ int_type* ito_next;
+
+- locale loc = locale("en_US.ISO-8859-1");
++ locale loc = locale("en_US.ISO8859-1");
+ locale::global(loc);
+ const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
+
+--- libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/3.cc.orig
++++ libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/3.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "en_US.ISO-8859-15" }
++// { dg-require-namedlocale "en_US.ISO8859-15" }
+
+ // 2003-02-06 Petur Runolfsson <peturr02@ru.is>
+
+@@ -41,7 +41,7 @@
+ // Required instantiation
+ // codecvt<wchar_t, char, mbstate_t>
+ //
+-// Baseline test for ISO-8859-15. Converts entire charset.
++// Baseline test for ISO8859-15. Converts entire charset.
+ void test03()
+ {
+ using namespace std;
+@@ -104,7 +104,7 @@
+ wmemset(i_ref, 0xdeadbeef, size + 1);
+ int_type* ito_next;
+
+- locale loc = locale("en_US.ISO-8859-15");
++ locale loc = locale("en_US.ISO8859-15");
+ locale::global(loc);
+ const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
+
+--- libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/2.cc.orig
++++ libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/2.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "en_US.ISO-8859-1" }
++// { dg-require-namedlocale "en_US.ISO8859-1" }
+
+ // 2003-02-06 Petur Runolfsson <peturr02@ru.is>
+
+@@ -63,7 +63,7 @@
+ "\xff";
+ int size = strlen(e_lit);
+
+- locale loc = locale("en_US.ISO-8859-1");
++ locale loc = locale("en_US.ISO8859-1");
+ locale::global(loc);
+ const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
+
+--- libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/3.cc.orig
++++ libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/3.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "en_US.ISO-8859-15" }
++// { dg-require-namedlocale "en_US.ISO8859-15" }
+
+ // 2003-02-06 Petur Runolfsson <peturr02@ru.is>
+
+@@ -63,7 +63,7 @@
+ "\xff";
+ int size = strlen(e_lit);
+
+- locale loc = locale("en_US.ISO-8859-15");
++ locale loc = locale("en_US.ISO8859-15");
+ locale::global(loc);
+ const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
+
+--- libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/2.cc.orig
++++ libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/2.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "en_US.ISO-8859-1" }
++// { dg-require-namedlocale "en_US.ISO8859-1" }
+
+ // 2003-02-06 Petur Runolfsson <peturr02@ru.is>
+
+@@ -32,12 +32,12 @@
+ bool test __attribute__((unused)) = true;
+ typedef codecvt<wchar_t, char, mbstate_t> w_codecvt;
+
+- locale loc = locale("en_US.ISO-8859-1");
++ locale loc = locale("en_US.ISO8859-1");
+ locale::global(loc);
+ const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
+
+ int k = cvt->max_length();
+- VERIFY( k == 1 ); // ISO-8859-1 is a single-byte encoding
++ VERIFY( k == 1 ); // ISO8859-1 is a single-byte encoding
+ }
+
+ int main ()
+--- libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/3.cc.orig
++++ libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/3.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "en_US.ISO-8859-15" }
++// { dg-require-namedlocale "en_US.ISO8859-15" }
+
+ // 2003-02-06 Petur Runolfsson <peturr02@ru.is>
+
+@@ -32,12 +32,12 @@
+ bool test __attribute__((unused)) = true;
+ typedef codecvt<wchar_t, char, mbstate_t> w_codecvt;
+
+- locale loc = locale("en_US.ISO-8859-15");
++ locale loc = locale("en_US.ISO8859-15");
+ locale::global(loc);
+ const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
+
+ int k = cvt->max_length();
+- VERIFY( k == 1 ); // ISO-8859-15 is a single-byte encoding
++ VERIFY( k == 1 ); // ISO8859-15 is a single-byte encoding
+ }
+
+ int main ()
+--- libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/2.cc.orig
++++ libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/2.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "en_US.ISO-8859-1" }
++// { dg-require-namedlocale "en_US.ISO8859-1" }
+
+ // 2003-02-06 Petur Runolfsson <peturr02@ru.is>
+
+@@ -88,7 +88,7 @@
+ memset(e_ref, 0xf0, size + 1);
+ ext_type* eto_next;
+
+- locale loc = locale("en_US.ISO-8859-1");
++ locale loc = locale("en_US.ISO8859-1");
+ locale::global(loc);
+ const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
+
+--- libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/3.cc.orig
++++ libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/3.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "en_US.ISO-8859-15" }
++// { dg-require-namedlocale "en_US.ISO8859-15" }
+
+ // 2003-02-06 Petur Runolfsson <peturr02@ru.is>
+
+@@ -102,7 +102,7 @@
+ memset(e_ref, 0xf0, size + 1);
+ ext_type* eto_next;
+
+- locale loc = locale("en_US.ISO-8859-15");
++ locale loc = locale("en_US.ISO8859-15");
+ locale::global(loc);
+ const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
+
+--- libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/7.cc.orig
++++ libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/7.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "en_US.ISO-8859-1" }
++// { dg-require-namedlocale "en_US.ISO8859-1" }
+
+ // 2003-02-06 Petur Runolfsson <peturr02@ru.is>
+
+@@ -60,7 +60,7 @@
+ memset(e_ref, 0xf0, size + 1);
+ ext_type* eto_next;
+
+- locale loc = locale("en_US.ISO-8859-1");
++ locale loc = locale("en_US.ISO8859-1");
+ locale::global(loc);
+ const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
+
+--- libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/2.cc.orig
++++ libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/2.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "en_US.ISO-8859-1" }
++// { dg-require-namedlocale "en_US.ISO8859-1" }
+
+ // 2003-02-06 Petur Runolfsson <peturr02@ru.is>
+
+@@ -73,7 +73,7 @@
+ memset(e_ref, 0xf0, size + 1);
+ ext_type* eto_next;
+
+- locale loc = locale("en_US.ISO-8859-1");
++ locale loc = locale("en_US.ISO8859-1");
+ locale::global(loc);
+ const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
+
+--- libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/3.cc.orig
++++ libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/3.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "en_US.ISO-8859-15" }
++// { dg-require-namedlocale "en_US.ISO8859-15" }
+
+ // 2003-02-06 Petur Runolfsson <peturr02@ru.is>
+
+@@ -87,7 +87,7 @@
+ memset(e_ref, 0xf0, size + 1);
+ ext_type* eto_next;
+
+- locale loc = locale("en_US.ISO-8859-15");
++ locale loc = locale("en_US.ISO8859-15");
+ locale::global(loc);
+ const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
+
+--- libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/2.cc.orig
++++ libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/2.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "en_US.ISO-8859-1" }
++// { dg-require-namedlocale "en_US.ISO8859-1" }
+
+ // 2003-03-12 Petur Runolfsson <peturr02@ru.is>
+
+@@ -31,7 +31,7 @@
+ using namespace std;
+ bool test __attribute__((unused)) = true;
+
+- locale loc = locale("en_US.ISO-8859-1");
++ locale loc = locale("en_US.ISO8859-1");
+ const ctype<wchar_t>& wct = use_facet<ctype<wchar_t> >(loc);
+
+ char c = 0xff;
+--- libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/9520.cc.orig
++++ libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/9520.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "de_DE.ISO-8859-15@euro" }
++// { dg-require-namedlocale "de_DE.ISO8859-15@euro" }
+
+ // 2003-05-03 Petur Runolfsson <peturr02@ru.is>
+
+@@ -36,7 +36,7 @@
+ putc(static_cast<unsigned char>(i), file);
+ fclose(file);
+
+- locale loc (locale("de_DE.ISO-8859-15@euro"));
++ locale loc (locale("de_DE.ISO8859-15@euro"));
+ wchar_t buf[1];
+ wfilebuf fb;
+ fb.pubimbue(loc);
+--- libstdc++-v3/testsuite/27_io/objects/wchar_t/9520.cc.orig
++++ libstdc++-v3/testsuite/27_io/objects/wchar_t/9520.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "de_DE.ISO-8859-15@euro" }
++// { dg-require-namedlocale "de_DE.ISO8859-15@euro" }
+
+ // 2003-04-30 Petur Runolfsson <peturr02@ru.is>
+
+@@ -35,7 +35,7 @@
+ putc(static_cast<unsigned char>(i), file);
+ fclose(file);
+
+- locale loc (locale("de_DE.ISO-8859-15@euro"));
++ locale loc (locale("de_DE.ISO8859-15@euro"));
+ locale::global(loc); // Set locale for stdin
+
+ VERIFY( freopen(name, "r", stdin) );
+--- libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/char/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/char/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -32,6 +32,6 @@
+ using namespace __gnu_test;
+ func_callback two;
+ two.push_back(&test01);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -32,6 +32,6 @@
+ using namespace __gnu_test;
+ func_callback two;
+ two.push_back(&test01);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/codecvt/encoding/char/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/codecvt/encoding/char/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -32,6 +32,6 @@
+ using namespace __gnu_test;
+ func_callback two;
+ two.push_back(&test01);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/codecvt/encoding/wchar_t/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/codecvt/encoding/wchar_t/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -32,6 +32,6 @@
+ using namespace __gnu_test;
+ func_callback two;
+ two.push_back(&test01);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/codecvt/in/char/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/codecvt/in/char/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -32,6 +32,6 @@
+ using namespace __gnu_test;
+ func_callback two;
+ two.push_back(&test01);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -32,6 +32,6 @@
+ using namespace __gnu_test;
+ func_callback two;
+ two.push_back(&test01);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/codecvt/length/char/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/codecvt/length/char/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -32,6 +32,6 @@
+ using namespace __gnu_test;
+ func_callback two;
+ two.push_back(&test01);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -32,6 +32,6 @@
+ using namespace __gnu_test;
+ func_callback two;
+ two.push_back(&test01);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/codecvt/max_length/char/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/codecvt/max_length/char/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -32,6 +32,6 @@
+ using namespace __gnu_test;
+ func_callback two;
+ two.push_back(&test01);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -32,6 +32,6 @@
+ using namespace __gnu_test;
+ func_callback two;
+ two.push_back(&test01);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/codecvt/out/char/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/codecvt/out/char/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -32,6 +32,6 @@
+ using namespace __gnu_test;
+ func_callback two;
+ two.push_back(&test01);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -32,6 +32,6 @@
+ using namespace __gnu_test;
+ func_callback two;
+ two.push_back(&test01);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/codecvt/unshift/char/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/codecvt/unshift/char/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -32,6 +32,6 @@
+ using namespace __gnu_test;
+ func_callback two;
+ two.push_back(&test01);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -32,6 +32,6 @@
+ using namespace __gnu_test;
+ func_callback two;
+ two.push_back(&test01);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/collate/compare/char/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/collate/compare/char/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+ // { dg-require-namedlocale "fr_FR" }
+ // { dg-require-namedlocale "en_US" }
+ // { dg-require-namedlocale "de_DE" }
+@@ -40,6 +40,6 @@
+ func_callback two;
+ two.push_back(&test01);
+ two.push_back(&test02);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/wrapped_locale.cc
+@@ -2,7 +2,7 @@
+ // { dg-xfail-if "" { "*-*-hpux11.23" } { "*" } { "" } } */
+ // { dg-options "-finput-charset=ISO8859-1" }
+ // { dg-require-iconv "ISO8859-1" }
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+ // { dg-require-namedlocale "en_US" }
+ // { dg-require-namedlocale "fr_FR" }
+ // { dg-require-namedlocale "de_DE" }
+@@ -44,6 +44,6 @@
+ func_callback two;
+ two.push_back(&test01);
+ two.push_back(&test02);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/collate/hash/char/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/collate/hash/char/wrapped_locale.cc
+@@ -1,7 +1,7 @@
+ // { dg-require-namedlocale "en_US" }
+ // { dg-require-namedlocale "fr_FR" }
+ // { dg-require-namedlocale "de_DE" }
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -40,6 +40,6 @@
+ func_callback two;
+ two.push_back(&test01);
+ two.push_back(&test02);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/collate/hash/wchar_t/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/collate/hash/wchar_t/wrapped_locale.cc
+@@ -2,7 +2,7 @@
+ // { dg-xfail-if "" { "*-*-hpux11.23" } { "*" } { "" } } */
+ // { dg-options "-finput-charset=ISO8859-1" }
+ // { dg-require-iconv "ISO8859-1" }
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+ // { dg-require-namedlocale "en_US" }
+ // { dg-require-namedlocale "fr_FR" }
+ // { dg-require-namedlocale "de_DE" }
+@@ -44,6 +44,6 @@
+ func_callback two;
+ two.push_back(&test01);
+ two.push_back(&test02);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/collate/transform/char/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/collate/transform/char/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+ // { dg-require-namedlocale "en_US" }
+ // { dg-require-namedlocale "fr_FR" }
+ // { dg-require-namedlocale "de_DE" }
+@@ -35,6 +35,6 @@
+ using namespace __gnu_test;
+ func_callback two;
+ two.push_back(&test02);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/collate/transform/wchar_t/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/collate/transform/wchar_t/wrapped_locale.cc
+@@ -2,7 +2,7 @@
+ // { dg-xfail-if "" { "*-*-hpux11.23" } { "*" } { "" } } */
+ // { dg-options "-finput-charset=ISO8859-1" }
+ // { dg-require-iconv "ISO8859-1" }
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+ // { dg-require-namedlocale "en_US" }
+ // { dg-require-namedlocale "fr_FR" }
+ // { dg-require-namedlocale "de_DE" }
+@@ -39,6 +39,6 @@
+ using namespace __gnu_test;
+ func_callback two;
+ two.push_back(&test02);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/ctype/cons/char/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/ctype/cons/char/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -32,6 +32,6 @@
+ using namespace __gnu_test;
+ func_callback two;
+ two.push_back(&test01);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/ctype/is/char/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/ctype/is/char/wrapped_locale.cc
+@@ -1,5 +1,5 @@
+ // { dg-require-namedlocale "de_DE" }
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -43,6 +43,6 @@
+ two.push_back(&test01);
+ two.push_back(&test02);
+ two.push_back(&test03);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/ctype/is/wchar_t/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/ctype/is/wchar_t/wrapped_locale.cc
+@@ -1,5 +1,5 @@
+ // { dg-require-namedlocale "de_DE" }
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -38,6 +38,6 @@
+ func_callback two;
+ two.push_back(&test01);
+ two.push_back(&test02);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/ctype/narrow/char/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/ctype/narrow/char/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -37,6 +37,6 @@
+ func_callback two;
+ two.push_back(&test01);
+ two.push_back(&test02);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/ctype/narrow/wchar_t/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/ctype/narrow/wchar_t/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -37,6 +37,6 @@
+ func_callback two;
+ two.push_back(&test01);
+ two.push_back(&test02);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/ctype/scan/char/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/ctype/scan/char/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -32,6 +32,6 @@
+ using namespace __gnu_test;
+ func_callback two;
+ two.push_back(&test01);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/ctype/scan/wchar_t/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/ctype/scan/wchar_t/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -32,6 +32,6 @@
+ using namespace __gnu_test;
+ func_callback two;
+ two.push_back(&test01);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/ctype/to/char/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/ctype/to/char/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -32,6 +32,6 @@
+ using namespace __gnu_test;
+ func_callback two;
+ two.push_back(&test01);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/ctype/to/wchar_t/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/ctype/to/wchar_t/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -32,6 +32,6 @@
+ using namespace __gnu_test;
+ func_callback two;
+ two.push_back(&test01);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/ctype/widen/char/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/ctype/widen/char/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -32,6 +32,6 @@
+ using namespace __gnu_test;
+ func_callback two;
+ two.push_back(&test01);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -32,6 +32,6 @@
+ using namespace __gnu_test;
+ func_callback two;
+ two.push_back(&test01);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/locale/cons/40184.cc.orig
++++ libstdc++-v3/testsuite/22_locale/locale/cons/40184.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+
+ // Copyright (C) 2009 Free Software Foundation
+ //
+@@ -29,7 +29,7 @@
+ using namespace std;
+ bool test __attribute__((unused)) = true;
+
+- locale locf(locale("C"), "ja_JP.eucjp", locale::monetary);
++ locale locf(locale("C"), "ja_JP.eucJP", locale::monetary);
+
+ const moneypunct<wchar_t, false>& mpf =
+ use_facet<moneypunct<wchar_t, false> >(locf);
+@@ -40,7 +40,7 @@
+
+ VERIFY( mpf.curr_symbol() == mpf_copy.curr_symbol() );
+
+- locale loct(locale("C"), "ja_JP.eucjp", locale::monetary);
++ locale loct(locale("C"), "ja_JP.eucJP", locale::monetary);
+
+ const moneypunct<wchar_t, true>& mpt =
+ use_facet<moneypunct<wchar_t, true> >(loct);
+--- libstdc++-v3/testsuite/22_locale/messages/members/char/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/messages/members/char/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+ // { dg-require-namedlocale "de_DE" }
+ // { dg-require-namedlocale "fr_FR" }
+ // { dg-require-namedlocale "en_US" }
+@@ -45,6 +45,6 @@
+ two.push_back(&test01);
+ two.push_back(&test02);
+ two.push_back(&test03);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/money_get/get/char/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/money_get/get/char/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+ // { dg-require-namedlocale "de_DE@euro" }
+ // { dg-require-namedlocale "en_HK" }
+
+@@ -69,6 +69,6 @@
+ two.push_back(&test06);
+ two.push_back(&test07);
+ two.push_back(&test08);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+ // { dg-require-namedlocale "de_DE@euro" }
+ // { dg-require-namedlocale "en_HK" }
+
+@@ -69,6 +69,6 @@
+ two.push_back(&test06);
+ two.push_back(&test07);
+ two.push_back(&test08);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/money_put/put/char/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/money_put/put/char/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+ // { dg-require-namedlocale "de_DE@euro" }
+ // { dg-require-namedlocale "en_HK" }
+
+@@ -59,6 +59,6 @@
+ two.push_back(&test04);
+ two.push_back(&test05);
+ two.push_back(&test06);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+ // { dg-require-namedlocale "de_DE@euro" }
+ // { dg-require-namedlocale "en_HK" }
+
+@@ -59,6 +59,6 @@
+ two.push_back(&test04);
+ two.push_back(&test05);
+ two.push_back(&test06);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/moneypunct/members/char/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/moneypunct/members/char/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+ // { dg-require-namedlocale "de_DE" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+@@ -38,6 +38,6 @@
+ func_callback two;
+ two.push_back(&test01);
+ two.push_back(&test02);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/moneypunct/members/wchar_t/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/moneypunct/members/wchar_t/wrapped_locale.cc
+@@ -1,5 +1,5 @@
+ // { dg-require-namedlocale "de_DE" }
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -38,6 +38,6 @@
+ func_callback two;
+ two.push_back(&test01);
+ two.push_back(&test02);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/num_get/get/char/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/num_get/get/char/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+ // { dg-require-namedlocale "de_DE" }
+ // { dg-require-namedlocale "en_HK" }
+
+@@ -59,6 +59,6 @@
+ two.push_back(&test04);
+ two.push_back(&test05);
+ two.push_back(&test06);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+ // { dg-require-namedlocale "de_DE" }
+ // { dg-require-namedlocale "en_HK" }
+
+@@ -59,6 +59,6 @@
+ two.push_back(&test04);
+ two.push_back(&test05);
+ two.push_back(&test06);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/num_put/put/char/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/num_put/put/char/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+ // { dg-require-namedlocale "de_DE" }
+ // { dg-require-namedlocale "en_HK" }
+ // { dg-require-namedlocale "es_ES" }
+@@ -55,6 +55,6 @@
+ two.push_back(&test03);
+ two.push_back(&test04);
+ two.push_back(&test05);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+ // { dg-require-namedlocale "de_DE" }
+ // { dg-require-namedlocale "en_HK" }
+
+@@ -54,6 +54,6 @@
+ two.push_back(&test03);
+ two.push_back(&test04);
+ two.push_back(&test05);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/numpunct/members/char/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/numpunct/members/char/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+ // { dg-require-namedlocale "de_DE" }
+ // { dg-require-namedlocale "en_US" }
+ // { dg-require-namedlocale "is_IS" }
+@@ -40,6 +40,6 @@
+ func_callback two;
+ two.push_back(&test01);
+ two.push_back(&test02);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/numpunct/members/wchar_t/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/numpunct/members/wchar_t/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+ // { dg-require-namedlocale "de_DE" }
+ // { dg-require-namedlocale "en_US" }
+ // { dg-require-namedlocale "is_IS" }
+@@ -40,6 +40,6 @@
+ func_callback two;
+ two.push_back(&test01);
+ two.push_back(&test02);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/time_get/date_order/char/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_get/date_order/char/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -32,6 +32,6 @@
+ using namespace __gnu_test;
+ func_callback two;
+ two.push_back(&test01);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/time_get/date_order/wchar_t/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_get/date_order/wchar_t/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -32,6 +32,6 @@
+ using namespace __gnu_test;
+ func_callback two;
+ two.push_back(&test01);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/time_get/get_date/char/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_get/get_date/char/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+ // { dg-require-namedlocale "de_DE" }
+ // { dg-require-namedlocale "en_HK" }
+
+@@ -44,6 +44,6 @@
+ two.push_back(&test01);
+ two.push_back(&test02);
+ two.push_back(&test03);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+ // { dg-require-namedlocale "de_DE" }
+ // { dg-require-namedlocale "en_HK" }
+
+@@ -44,6 +44,6 @@
+ two.push_back(&test01);
+ two.push_back(&test02);
+ two.push_back(&test03);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+ // { dg-require-namedlocale "de_DE" }
+ // { dg-require-namedlocale "en_HK" }
+
+@@ -44,6 +44,6 @@
+ two.push_back(&test01);
+ two.push_back(&test02);
+ two.push_back(&test03);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+ // { dg-require-namedlocale "de_DE" }
+ // { dg-require-namedlocale "en_HK" }
+
+@@ -44,6 +44,6 @@
+ two.push_back(&test01);
+ two.push_back(&test02);
+ two.push_back(&test03);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/time_get/get_time/char/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_get/get_time/char/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+ // { dg-require-namedlocale "de_DE" }
+ // { dg-require-namedlocale "en_HK" }
+
+@@ -44,6 +44,6 @@
+ two.push_back(&test01);
+ two.push_back(&test02);
+ two.push_back(&test03);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+ // { dg-require-namedlocale "de_DE" }
+ // { dg-require-namedlocale "en_HK" }
+
+@@ -44,6 +44,6 @@
+ two.push_back(&test01);
+ two.push_back(&test02);
+ two.push_back(&test03);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+ // { dg-require-namedlocale "de_DE" }
+ // { dg-require-namedlocale "en_HK" }
+
+@@ -44,6 +44,6 @@
+ two.push_back(&test01);
+ two.push_back(&test02);
+ two.push_back(&test03);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/wrapped_locale.cc
+@@ -1,6 +1,6 @@
+ // { dg-require-namedlocale "en_HK" }
+ // { dg-require-namedlocale "de_DE" }
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -44,6 +44,6 @@
+ two.push_back(&test01);
+ two.push_back(&test02);
+ two.push_back(&test03);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/time_get/get_year/char/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_get/get_year/char/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -37,6 +37,6 @@
+ func_callback two;
+ two.push_back(&test01);
+ two.push_back(&test03);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/time_get/get_year/wchar_t/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_get/get_year/wchar_t/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -37,6 +37,6 @@
+ func_callback two;
+ two.push_back(&test01);
+ two.push_back(&test03);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/time_put/put/char/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_put/put/char/wrapped_locale.cc
+@@ -80,6 +80,6 @@
+ two.push_back(&test08);
+ two.push_back(&test09);
+ two.push_back(&test10);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/wrapped_locale.cc
+@@ -2,7 +2,7 @@
+ // { dg-require-namedlocale "en_HK" }
+ // { dg-require-namedlocale "es_ES" }
+ // { dg-require-namedlocale "fr_FR@euro" }
+-// { dg-require-namedlocale "ja_JP.eucjp" }
++// { dg-require-namedlocale "ja_JP.eucJP" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -81,6 +81,6 @@
+ two.push_back(&test08);
+ two.push_back(&test09);
+ two.push_back(&test10);
+- run_tests_wrapped_locale("ja_JP.eucjp", two);
++ run_tests_wrapped_locale("ja_JP.eucJP", two);
+ return 0;
+ }
+--- libstdc++-v3/testsuite/22_locale/money_get/get/char/16.cc.orig
++++ libstdc++-v3/testsuite/22_locale/money_get/get/char/16.cc
+@@ -1,5 +1,5 @@
+ // { dg-require-namedlocale "de_DE@euro" }
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2004-03-02 Paolo Carlini <pcarlini@suse.de>
+
+@@ -37,7 +37,7 @@
+ // basic construction
+ locale loc_c = locale::classic();
+ locale loc_de = locale("de_DE@euro");
+- locale loc_hk = locale("en_HK");
++ locale loc_hk = locale("zh_HK");
+ VERIFY( loc_hk != loc_de );
+ VERIFY( loc_c != loc_hk );
+
+--- libstdc++-v3/testsuite/22_locale/money_get/get/char/18.cc.orig
++++ libstdc++-v3/testsuite/22_locale/money_get/get/char/18.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2004-03-15 Paolo Carlini <pcarlini@suse.de>
+
+@@ -36,7 +36,7 @@
+
+ // basic construction
+ locale loc_c = locale::classic();
+- locale loc_hk = locale("en_HK");
++ locale loc_hk = locale("zh_HK");
+ VERIFY( loc_c != loc_hk );
+
+ iterator_type end, end01, end02;
+--- libstdc++-v3/testsuite/22_locale/money_get/get/char/2.cc.orig
++++ libstdc++-v3/testsuite/22_locale/money_get/get/char/2.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2001-09-12 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -35,7 +35,7 @@
+
+ // basic construction
+ locale loc_c = locale::classic();
+- locale loc_hk = locale("en_HK");
++ locale loc_hk = locale("zh_HK");
+ VERIFY( loc_c != loc_hk );
+
+ // total EPA budget FY 2002
+@@ -80,7 +80,7 @@
+ VERIFY( result11 == digits4 );
+ VERIFY( err11 == ios_base::eofbit );
+
+- // for the "en_HK" locale the parsing of the very same input streams must
++ // for the "zh_HK" locale the parsing of the very same input streams must
+ // be successful without showbase too, since the symbol field appears in
+ // the first positions in the format and the symbol, when present, must be
+ // consumed.
+--- libstdc++-v3/testsuite/22_locale/money_get/get/char/4.cc.orig
++++ libstdc++-v3/testsuite/22_locale/money_get/get/char/4.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2001-09-12 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -35,7 +35,7 @@
+
+ // basic construction
+ locale loc_c = locale::classic();
+- locale loc_hk = locale("en_HK");
++ locale loc_hk = locale("zh_HK");
+ VERIFY( loc_c != loc_hk );
+
+ // input less than frac_digits
+--- libstdc++-v3/testsuite/22_locale/money_get/get/char/wrapped_env.cc.orig
++++ libstdc++-v3/testsuite/22_locale/money_get/get/char/wrapped_env.cc
+@@ -1,6 +1,6 @@
+ // { dg-require-namedlocale "de_DE" }
+ // { dg-require-namedlocale "de_DE@euro" }
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+--- libstdc++-v3/testsuite/22_locale/money_get/get/char/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/money_get/get/char/wrapped_locale.cc
+@@ -1,6 +1,6 @@
+ // { dg-require-namedlocale "ja_JP.eucjp" }
+ // { dg-require-namedlocale "de_DE@euro" }
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+--- libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/16.cc.orig
++++ libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/16.cc
+@@ -1,5 +1,5 @@
+ // { dg-require-namedlocale "de_DE@euro" }
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2004-03-02 Paolo Carlini <pcarlini@suse.de>
+
+@@ -37,7 +37,7 @@
+ // basic construction
+ locale loc_c = locale::classic();
+ locale loc_de = locale("de_DE@euro");
+- locale loc_hk = locale("en_HK");
++ locale loc_hk = locale("zh_HK");
+ VERIFY( loc_hk != loc_de );
+ VERIFY( loc_c != loc_hk );
+
+--- libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/18.cc.orig
++++ libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/18.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2004-03-15 Paolo Carlini <pcarlini@suse.de>
+
+@@ -36,7 +36,7 @@
+
+ // basic construction
+ locale loc_c = locale::classic();
+- locale loc_hk = locale("en_HK");
++ locale loc_hk = locale("zh_HK");
+ VERIFY( loc_c != loc_hk );
+
+ iterator_type end, end01, end02;
+--- libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/2.cc.orig
++++ libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/2.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2001-09-12 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -35,7 +35,7 @@
+
+ // basic construction
+ locale loc_c = locale::classic();
+- locale loc_hk = locale("en_HK");
++ locale loc_hk = locale("zh_HK");
+ VERIFY( loc_c != loc_hk );
+
+ // total EPA budget FY 2002
+@@ -80,7 +80,7 @@
+ VERIFY( result11 == digits4 );
+ VERIFY( err11 == ios_base::eofbit );
+
+- // for the "en_HK" locale the parsing of the very same input streams must
++ // for the "zh_HK" locale the parsing of the very same input streams must
+ // be successful without showbase too, since the symbol field appears in
+ // the first positions in the format and the symbol, when present, must be
+ // consumed.
+--- libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/4.cc.orig
++++ libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/4.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2001-09-12 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -35,7 +35,7 @@
+
+ // basic construction
+ locale loc_c = locale::classic();
+- locale loc_hk = locale("en_HK");
++ locale loc_hk = locale("zh_HK");
+ VERIFY( loc_c != loc_hk );
+
+ // input less than frac_digits
+--- libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/wrapped_env.cc.orig
++++ libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/wrapped_env.cc
+@@ -1,6 +1,6 @@
+ // { dg-require-namedlocale "de_DE" }
+ // { dg-require-namedlocale "de_DE@euro" }
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+--- libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/wrapped_locale.cc
+@@ -1,6 +1,6 @@
+ // { dg-require-namedlocale "ja_JP.eucjp" }
+ // { dg-require-namedlocale "de_DE@euro" }
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+--- libstdc++-v3/testsuite/22_locale/money_put/put/char/2.cc.orig
++++ libstdc++-v3/testsuite/22_locale/money_put/put/char/2.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2001-08-27 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -36,7 +36,7 @@
+
+ // basic construction
+ locale loc_c = locale::classic();
+- locale loc_hk = locale("en_HK");
++ locale loc_hk = locale("zh_HK");
+ VERIFY( loc_c != loc_hk );
+
+ // sanity check the data is correct.
+--- libstdc++-v3/testsuite/22_locale/money_put/put/char/wrapped_env.cc.orig
++++ libstdc++-v3/testsuite/22_locale/money_put/put/char/wrapped_env.cc
+@@ -1,6 +1,6 @@
+ // { dg-require-namedlocale "de_DE" }
+ // { dg-require-namedlocale "de_DE@euro" }
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+--- libstdc++-v3/testsuite/22_locale/money_put/put/char/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/money_put/put/char/wrapped_locale.cc
+@@ -1,6 +1,6 @@
+ // { dg-require-namedlocale "ja_JP.eucjp" }
+ // { dg-require-namedlocale "de_DE@euro" }
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+--- libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/2.cc.orig
++++ libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/2.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2001-08-27 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -36,7 +36,7 @@
+
+ // basic construction
+ locale loc_c = locale::classic();
+- locale loc_hk = locale("en_HK");
++ locale loc_hk = locale("zh_HK");
+ VERIFY( loc_c != loc_hk );
+
+ // sanity check the data is correct.
+--- libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/wrapped_env.cc.orig
++++ libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/wrapped_env.cc
+@@ -1,6 +1,6 @@
+ // { dg-require-namedlocale "de_DE" }
+ // { dg-require-namedlocale "de_DE@euro" }
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+--- libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/wrapped_locale.cc
+@@ -1,6 +1,6 @@
+ // { dg-require-namedlocale "ja_JP.eucjp" }
+ // { dg-require-namedlocale "de_DE@euro" }
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+--- libstdc++-v3/testsuite/22_locale/num_get/get/char/3.cc.orig
++++ libstdc++-v3/testsuite/22_locale/num_get/get/char/3.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2001-11-21 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -34,7 +34,7 @@
+
+ // basic construction
+ locale loc_c = locale::classic();
+- locale loc_hk = locale("en_HK");
++ locale loc_hk = locale("zh_HK");
+ VERIFY( loc_c != loc_hk );
+
+ // sanity check the data is correct.
+--- libstdc++-v3/testsuite/22_locale/num_get/get/char/wrapped_env.cc.orig
++++ libstdc++-v3/testsuite/22_locale/num_get/get/char/wrapped_env.cc
+@@ -1,5 +1,5 @@
+ // { dg-require-namedlocale "de_DE" }
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+--- libstdc++-v3/testsuite/22_locale/num_get/get/char/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/num_get/get/char/wrapped_locale.cc
+@@ -1,6 +1,6 @@
+ // { dg-require-namedlocale "ja_JP.eucjp" }
+ // { dg-require-namedlocale "de_DE" }
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+--- libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/3.cc.orig
++++ libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/3.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2001-11-21 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -34,7 +34,7 @@
+
+ // basic construction
+ locale loc_c = locale::classic();
+- locale loc_hk = locale("en_HK");
++ locale loc_hk = locale("zh_HK");
+ VERIFY( loc_c != loc_hk );
+
+ // sanity check the data is correct.
+--- libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/wrapped_env.cc.orig
++++ libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/wrapped_env.cc
+@@ -1,5 +1,5 @@
+ // { dg-require-namedlocale "de_DE" }
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+--- libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/wrapped_locale.cc
+@@ -1,6 +1,6 @@
+ // { dg-require-namedlocale "ja_JP.eucjp" }
+ // { dg-require-namedlocale "de_DE" }
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+--- libstdc++-v3/testsuite/22_locale/num_put/put/char/3.cc.orig
++++ libstdc++-v3/testsuite/22_locale/num_put/put/char/3.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2001-11-19 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -34,7 +34,7 @@
+
+ // basic construction
+ locale loc_c = locale::classic();
+- locale loc_hk = locale("en_HK");
++ locale loc_hk = locale("zh_HK");
+ VERIFY( loc_c != loc_hk );
+
+ // sanity check the data is correct.
+--- libstdc++-v3/testsuite/22_locale/num_put/put/char/wrapped_env.cc.orig
++++ libstdc++-v3/testsuite/22_locale/num_put/put/char/wrapped_env.cc
+@@ -1,5 +1,5 @@
+ // { dg-require-namedlocale "de_DE" }
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+ // { dg-require-namedlocale "es_ES" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+--- libstdc++-v3/testsuite/22_locale/num_put/put/char/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/num_put/put/char/wrapped_locale.cc
+@@ -1,6 +1,6 @@
+ // { dg-require-namedlocale "ja_JP.eucjp" }
+ // { dg-require-namedlocale "de_DE" }
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+ // { dg-require-namedlocale "es_ES" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+--- libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/3.cc.orig
++++ libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/3.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2001-11-19 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -34,7 +34,7 @@
+
+ // basic construction
+ locale loc_c = locale::classic();
+- locale loc_hk = locale("en_HK");
++ locale loc_hk = locale("zh_HK");
+ VERIFY( loc_c != loc_hk );
+
+ // sanity check the data is correct.
+--- libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/wrapped_env.cc.orig
++++ libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/wrapped_env.cc
+@@ -1,5 +1,5 @@
+ // { dg-require-namedlocale "de_DE" }
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+--- libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/wrapped_locale.cc
+@@ -1,6 +1,6 @@
+ // { dg-require-namedlocale "ja_JP.eucjp" }
+ // { dg-require-namedlocale "de_DE" }
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+--- libstdc++-v3/testsuite/22_locale/time_get/get_date/char/2.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_get/get_date/char/2.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+ // { dg-require-namedlocale "de_DE" }
+
+ // 2001-09-21 Benjamin Kosnik <bkoz@redhat.com>
+@@ -36,7 +36,7 @@
+
+ // basic construction and sanity checks.
+ locale loc_c = locale::classic();
+- locale loc_hk = locale("en_HK");
++ locale loc_hk = locale("zh_HK");
+ locale loc_de = locale("de_DE");
+ VERIFY( loc_hk != loc_c );
+ VERIFY( loc_hk != loc_de );
+@@ -76,7 +76,7 @@
+ VERIFY( time10.tm_year == time_bday.tm_year );
+ VERIFY( errorstate == ios_base::eofbit );
+
+- // inspection of named locales, en_HK
++ // inspection of named locales, zh_HK
+ iss.imbue(loc_hk);
+ iss.str("Sunday, April 04, 1971");
+ iterator_type is_it20(iss);
+--- libstdc++-v3/testsuite/22_locale/time_get/get_date/char/wrapped_env.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_get/get_date/char/wrapped_env.cc
+@@ -1,5 +1,5 @@
+ // { dg-require-namedlocale "de_DE" }
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+--- libstdc++-v3/testsuite/22_locale/time_get/get_date/char/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_get/get_date/char/wrapped_locale.cc
+@@ -1,6 +1,6 @@
+ // { dg-require-namedlocale "ja_JP.eucjp" }
+ // { dg-require-namedlocale "de_DE" }
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+--- libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/2.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/2.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+ // { dg-require-namedlocale "de_DE" }
+
+ // 2001-09-21 Benjamin Kosnik <bkoz@redhat.com>
+@@ -36,7 +36,7 @@
+
+ // basic construction and sanity checks.
+ locale loc_c = locale::classic();
+- locale loc_hk = locale("en_HK");
++ locale loc_hk = locale("zh_HK");
+ locale loc_de = locale("de_DE");
+ VERIFY( loc_hk != loc_c );
+ VERIFY( loc_hk != loc_de );
+@@ -76,7 +76,7 @@
+ VERIFY( time10.tm_year == time_bday.tm_year );
+ VERIFY( errorstate == ios_base::eofbit );
+
+- // inspection of named locales, en_HK
++ // inspection of named locales, zh_HK
+ iss.imbue(loc_hk);
+ iss.str(L"Sunday, April 04, 1971");
+ iterator_type is_it20(iss);
+--- libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/wrapped_env.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/wrapped_env.cc
+@@ -1,5 +1,5 @@
+ // { dg-require-namedlocale "de_DE" }
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+--- libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/wrapped_locale.cc
+@@ -1,6 +1,6 @@
+ // { dg-require-namedlocale "ja_JP.eucjp" }
+ // { dg-require-namedlocale "de_DE" }
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+--- libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/2.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/2.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+ // { dg-require-namedlocale "de_DE" }
+
+ // 2001-09-21 Benjamin Kosnik <bkoz@redhat.com>
+@@ -35,7 +35,7 @@
+
+ // basic construction and sanity checks.
+ locale loc_c = locale::classic();
+- locale loc_hk = locale("en_HK");
++ locale loc_hk = locale("zh_HK");
+ locale loc_de = locale("de_DE");
+ VERIFY( loc_hk != loc_c );
+ VERIFY( loc_hk != loc_de );
+@@ -63,7 +63,7 @@
+ VERIFY( time10.tm_mon == time_bday.tm_mon );
+ VERIFY( errorstate == ios_base::eofbit );
+
+- // inspection of named locales, en_HK
++ // inspection of named locales, zh_HK
+ iss.imbue(loc_hk);
+ const time_get<char>& tim_get2 = use_facet<time_get<char> >(iss.getloc());
+ iss.str("April");
+--- libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/wrapped_env.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/wrapped_env.cc
+@@ -1,5 +1,5 @@
+ // { dg-require-namedlocale "de_DE" }
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+--- libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/wrapped_locale.cc
+@@ -1,6 +1,6 @@
+ // { dg-require-namedlocale "ja_JP.eucjp" }
+ // { dg-require-namedlocale "de_DE" }
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+--- libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/2.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/2.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+ // { dg-require-namedlocale "de_DE" }
+
+ // 2001-09-21 Benjamin Kosnik <bkoz@redhat.com>
+@@ -36,7 +36,7 @@
+
+ // basic construction and sanity checks.
+ locale loc_c = locale::classic();
+- locale loc_hk = locale("en_HK");
++ locale loc_hk = locale("zh_HK");
+ locale loc_de = locale("de_DE");
+ VERIFY( loc_hk != loc_c );
+ VERIFY( loc_hk != loc_de );
+@@ -64,7 +64,7 @@
+ VERIFY( time10.tm_mon == time_bday.tm_mon );
+ VERIFY( errorstate == ios_base::eofbit );
+
+- // inspection of named locales, en_HK
++ // inspection of named locales, zh_HK
+ iss.imbue(loc_hk);
+ const time_get<wchar_t>& tim_get2 = use_facet<time_get<wchar_t> >(iss.getloc());
+ iss.str(L"April");
+--- libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/wrapped_env.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/wrapped_env.cc
+@@ -1,5 +1,5 @@
+ // { dg-require-namedlocale "de_DE" }
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+--- libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/wrapped_locale.cc
+@@ -1,6 +1,6 @@
+ // { dg-require-namedlocale "ja_JP.eucjp" }
+ // { dg-require-namedlocale "de_DE" }
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+--- libstdc++-v3/testsuite/22_locale/time_get/get_time/char/2.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_get/get_time/char/2.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2001-09-21 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -35,7 +35,7 @@
+
+ // basic construction and sanity check
+ locale loc_c = locale::classic();
+- locale loc_hk = locale("en_HK");
++ locale loc_hk = locale("zh_HK");
+ VERIFY( loc_hk != loc_c );
+
+ const string empty;
+@@ -48,7 +48,7 @@
+ const ios_base::iostate good = ios_base::goodbit;
+ ios_base::iostate errorstate = good;
+
+- // inspection of named locales, en_HK
++ // inspection of named locales, zh_HK
+ iss.imbue(loc_hk);
+ iss.str("12:00:00 PST");
+ // Hong Kong in California! Well, they have Paris in Vegas... this
+--- libstdc++-v3/testsuite/22_locale/time_get/get_time/char/wrapped_env.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_get/get_time/char/wrapped_env.cc
+@@ -1,5 +1,5 @@
+ // { dg-require-namedlocale "de_DE" }
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+--- libstdc++-v3/testsuite/22_locale/time_get/get_time/char/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_get/get_time/char/wrapped_locale.cc
+@@ -1,6 +1,6 @@
+ // { dg-require-namedlocale "ja_JP.eucjp" }
+ // { dg-require-namedlocale "de_DE" }
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+--- libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/2.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/2.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2001-09-21 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -35,7 +35,7 @@
+
+ // basic construction and sanity check
+ locale loc_c = locale::classic();
+- locale loc_hk = locale("en_HK");
++ locale loc_hk = locale("zh_HK");
+ VERIFY( loc_hk != loc_c );
+
+ const wstring empty;
+@@ -48,7 +48,7 @@
+ const ios_base::iostate good = ios_base::goodbit;
+ ios_base::iostate errorstate = good;
+
+- // inspection of named locales, en_HK
++ // inspection of named locales, zh_HK
+ iss.imbue(loc_hk);
+ iss.str(L"12:00:00 PST");
+ // Hong Kong in California! Well, they have Paris in Vegas... this
+--- libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/wrapped_env.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/wrapped_env.cc
+@@ -1,5 +1,5 @@
+ // { dg-require-namedlocale "de_DE" }
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+--- libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/wrapped_locale.cc
+@@ -1,6 +1,6 @@
+ // { dg-require-namedlocale "ja_JP.eucjp" }
+ // { dg-require-namedlocale "de_DE" }
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+--- libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/2.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/2.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+ // { dg-require-namedlocale "de_DE" }
+
+ // 2001-09-21 Benjamin Kosnik <bkoz@redhat.com>
+@@ -36,7 +36,7 @@
+
+ // basic construction and sanity checks.
+ locale loc_c = locale::classic();
+- locale loc_hk = locale("en_HK");
++ locale loc_hk = locale("zh_HK");
+ locale loc_de = locale("de_DE");
+ VERIFY( loc_hk != loc_c );
+ VERIFY( loc_hk != loc_de );
+@@ -65,7 +65,7 @@
+ VERIFY( time10.tm_wday == time_bday.tm_wday );
+ VERIFY( errorstate == ios_base::eofbit );
+
+- // inspection of named locales, en_HK
++ // inspection of named locales, zh_HK
+ iss.imbue(loc_hk);
+ iss.str("Sunday");
+ iterator_type is_it20(iss);
+--- libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/wrapped_env.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/wrapped_env.cc
+@@ -1,5 +1,5 @@
+ // { dg-require-namedlocale "de_DE" }
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+--- libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/wrapped_locale.cc
+@@ -1,6 +1,6 @@
+ // { dg-require-namedlocale "ja_JP.eucjp" }
+ // { dg-require-namedlocale "de_DE" }
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+--- libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/2.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/2.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+ // { dg-require-namedlocale "de_DE" }
+
+ // 2001-09-21 Benjamin Kosnik <bkoz@redhat.com>
+@@ -36,7 +36,7 @@
+
+ // basic construction and sanity checks.
+ locale loc_c = locale::classic();
+- locale loc_hk = locale("en_HK");
++ locale loc_hk = locale("zh_HK");
+ locale loc_de = locale("de_DE");
+ VERIFY( loc_hk != loc_c );
+ VERIFY( loc_hk != loc_de );
+@@ -65,7 +65,7 @@
+ VERIFY( time10.tm_wday == time_bday.tm_wday );
+ VERIFY( errorstate == ios_base::eofbit );
+
+- // inspection of named locales, en_HK
++ // inspection of named locales, zh_HK
+ iss.imbue(loc_hk);
+ iss.str(L"Sunday");
+ iterator_type is_it20(iss);
+--- libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/wrapped_env.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/wrapped_env.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+ // { dg-require-namedlocale "de_DE" }
+
+ // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+--- libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/wrapped_locale.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+ // { dg-require-namedlocale "de_DE" }
+ // { dg-require-namedlocale "ja_JP.eucjp" }
+
+--- libstdc++-v3/testsuite/22_locale/time_put/put/char/3.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_put/put/char/3.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2001-09-17 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -38,7 +38,7 @@
+
+ // basic construction and sanity check.
+ locale loc_c = locale::classic();
+- locale loc_hk = locale("en_HK");
++ locale loc_hk = locale("zh_HK");
+ VERIFY( loc_hk != loc_c );
+
+ // create an ostream-derived object, cache the time_put facet
+--- libstdc++-v3/testsuite/22_locale/time_put/put/char/7.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_put/put/char/7.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2001-09-17 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -41,7 +41,7 @@
+
+ // basic construction and sanity check
+ locale loc_c = locale::classic();
+- locale loc_hk = locale("en_HK");
++ locale loc_hk = locale("zh_HK");
+ VERIFY( loc_hk != loc_c );
+
+ // create an ostream-derived object, cache the time_put facet
+--- libstdc++-v3/testsuite/22_locale/time_put/put/char/wrapped_env.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_put/put/char/wrapped_env.cc
+@@ -1,5 +1,5 @@
+ // { dg-require-namedlocale "de_DE" }
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+ // { dg-require-namedlocale "es_ES" }
+ // { dg-require-namedlocale "fr_FR@euro" }
+
+--- libstdc++-v3/testsuite/22_locale/time_put/put/char/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_put/put/char/wrapped_locale.cc
+@@ -1,5 +1,5 @@
+ // { dg-require-namedlocale "de_DE" }
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+ // { dg-require-namedlocale "es_ES" }
+ // { dg-require-namedlocale "fr_FR@euro" }
+
+--- libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/3.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/3.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2001-09-17 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -38,7 +38,7 @@
+
+ // basic construction and sanity check
+ locale loc_c = locale::classic();
+- locale loc_hk = locale("en_HK");
++ locale loc_hk = locale("zh_HK");
+ VERIFY( loc_hk != loc_c );
+
+ // create an ostream-derived object, cache the time_put facet
+--- libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/7.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/7.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+
+ // 2001-09-17 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -41,7 +41,7 @@
+
+ // basic construction and sanity check
+ locale loc_c = locale::classic();
+- locale loc_hk = locale("en_HK");
++ locale loc_hk = locale("zh_HK");
+ VERIFY( loc_hk != loc_c );
+
+ // create an ostream-derived object, cache the time_put facet
+--- libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/wrapped_env.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/wrapped_env.cc
+@@ -1,5 +1,5 @@
+ // { dg-require-namedlocale "de_DE" }
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+ // { dg-require-namedlocale "es_ES" }
+ // { dg-require-namedlocale "fr_FR@euro" }
+
+--- libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/wrapped_locale.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/wrapped_locale.cc
+@@ -1,5 +1,5 @@
+ // { dg-require-namedlocale "de_DE" }
+-// { dg-require-namedlocale "en_HK" }
++// { dg-require-namedlocale "zh_HK" }
+ // { dg-require-namedlocale "es_ES" }
+ // { dg-require-namedlocale "fr_FR@euro" }
+ // { dg-require-namedlocale "ja_JP.eucjp" }
+--- libstdc++-v3/testsuite/22_locale/ctype/narrow/wchar_t/3.cc.orig
++++ libstdc++-v3/testsuite/22_locale/ctype/narrow/wchar_t/3.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "se_NO.UTF-8" }
++// { dg-require-namedlocale "no_NO.UTF-8" }
+
+ // 2003-03-12 Petur Runolfsson <peturr02@ru.is>
+
+@@ -31,7 +31,7 @@
+ using namespace std;
+ bool test __attribute__((unused)) = true;
+
+- locale loc = locale("se_NO.UTF-8");
++ locale loc = locale("no_NO.UTF-8");
+ const ctype<wchar_t>& wct = use_facet<ctype<wchar_t> >(loc);
+
+ const wchar_t* wstrlit = L"\x80";
+--- libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/3.cc.orig
++++ libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/3.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "se_NO.UTF-8" }
++// { dg-require-namedlocale "no_NO.UTF-8" }
+
+ // 2003-03-12 Petur Runolfsson <peturr02@ru.is>
+
+@@ -31,7 +31,7 @@
+ using namespace std;
+ bool test __attribute__((unused)) = true;
+
+- locale loc = locale("se_NO.UTF-8");
++ locale loc = locale("no_NO.UTF-8");
+ const ctype<wchar_t>& wct = use_facet<ctype<wchar_t> >(loc);
+
+ const char* strlit = "\xc2\x80";
+--- libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/1.cc.orig
++++ libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/1.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "se_NO.UTF-8" }
++// { dg-require-namedlocale "no_NO.UTF-8" }
+
+ // 2003-09-08 Petur Runolfsson <peturr02@ru.is>
+
+@@ -91,7 +91,7 @@
+ const size_t wlen = sizeof(wstr) / sizeof(wstr[0]);
+
+ const int loops = 2 * BUFSIZ / wlen;
+- locale loc = locale("se_NO.UTF-8");
++ locale loc = locale("no_NO.UTF-8");
+
+ FILE* file = fopen(name, "w");
+ for (int i = 0; i < loops; ++i)
+--- libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/2.cc.orig
++++ libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/2.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "se_NO.UTF-8" }
++// { dg-require-namedlocale "no_NO.UTF-8" }
+
+ // 2003-09-08 Petur Runolfsson <peturr02@ru.is>
+
+@@ -35,7 +35,7 @@
+ bool test __attribute__((unused)) = true;
+ const char name[] = "tmp_seekoff-2.tst";
+
+- locale loc = locale("se_NO.UTF-8");
++ locale loc = locale("no_NO.UTF-8");
+
+ const size_t size = 10;
+ wchar_t buf[size];
+--- libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/wchar_t/9874.cc.orig
++++ libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/wchar_t/9874.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "se_NO.UTF-8" }
++// { dg-require-namedlocale "no_NO.UTF-8" }
+
+ // 2003-10-07 Petur Runolfsson <peturr02@ru.is>
+ //
+@@ -93,7 +93,7 @@
+ const size_t wlen = sizeof(wstr) / sizeof(wstr[0]);
+
+ const int loops = 2 * BUFSIZ / wlen;
+- locale loc = locale("se_NO.UTF-8");
++ locale loc = locale("no_NO.UTF-8");
+
+ FILE* file = fopen(name, "w");
+ for (int i = 0; i < loops; ++i)
+--- libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/1.cc.orig
++++ libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/1.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "se_NO.UTF-8" }
++// { dg-require-namedlocale "no_NO.UTF-8" }
+
+ // 2003-09-04 Petur Runolfsson <peturr02@ru.is>
+
+@@ -86,7 +86,7 @@
+ const size_t clen = sizeof(cstr) / sizeof(cstr[0]);
+ const size_t wlen = sizeof(wstr) / sizeof(wstr[0]);
+
+- locale loc = locale("se_NO.UTF-8");
++ locale loc = locale("no_NO.UTF-8");
+
+ FILE* file = fopen(name, "w");
+ fwrite(cstr, 1, clen, file);
+--- libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/2.cc.orig
++++ libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/2.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "se_NO.UTF-8" }
++// { dg-require-namedlocale "no_NO.UTF-8" }
+
+ // 2003-09-04 Petur Runolfsson <peturr02@ru.is>
+
+@@ -86,7 +86,7 @@
+ const size_t clen = sizeof(cstr) / sizeof(cstr[0]);
+ const size_t wlen = sizeof(wstr) / sizeof(wstr[0]);
+
+- locale loc = locale("se_NO.UTF-8");
++ locale loc = locale("no_NO.UTF-8");
+
+ FILE* file = fopen(name, "w");
+ fwrite(cstr, 1, clen, file);
+--- libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/3.cc.orig
++++ libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/3.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "se_NO.UTF-8" }
++// { dg-require-namedlocale "no_NO.UTF-8" }
+
+ // 2003-09-04 Petur Runolfsson <peturr02@ru.is>
+
+@@ -87,7 +87,7 @@
+ const size_t wlen = sizeof(wstr) / sizeof(wstr[0]);
+
+ const int loops = 2 * BUFSIZ / wlen;
+- locale loc = locale("se_NO.UTF-8");
++ locale loc = locale("no_NO.UTF-8");
+
+ FILE* file = fopen(name, "w");
+ for (int i = 0; i < loops; ++i)
+--- libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/4.cc.orig
++++ libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/4.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "se_NO.UTF-8" }
++// { dg-require-namedlocale "no_NO.UTF-8" }
+
+ // 2003-09-04 Petur Runolfsson <peturr02@ru.is>
+ // Adapted from 27_io/basic_filebuf/underflow/char/2.cc
+@@ -31,7 +31,7 @@
+ bool test __attribute__((unused)) = true;
+ using namespace std;
+
+- locale loc (locale("se_NO.UTF-8"));
++ locale loc (locale("no_NO.UTF-8"));
+ wfilebuf fb_out, fb_in_out;
+ fb_out.pubimbue(loc);
+ fb_in_out.pubimbue(loc);
+--- libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/5.cc.orig
++++ libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/5.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "se_NO.UTF-8" }
++// { dg-require-namedlocale "no_NO.UTF-8" }
+
+ // 2003-09-04 Petur Runolfsson <peturr02@ru.is>
+
+@@ -35,7 +35,7 @@
+
+ wfilebuf fb;
+ fb.pubsetbuf(0, 0);
+- fb.pubimbue(locale("se_NO.UTF-8"));
++ fb.pubimbue(locale("no_NO.UTF-8"));
+
+ FILE* file = fopen(name, "w");
+ setvbuf(file, 0, _IONBF, 0);
+--- libstdc++-v3/testsuite/27_io/objects/wchar_t/10.cc.orig
++++ libstdc++-v3/testsuite/27_io/objects/wchar_t/10.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "se_NO.UTF-8" }
++// { dg-require-namedlocale "no_NO.UTF-8" }
+
+ // 2003-05-01 Petur Runolfsson <peturr02@ru.is>
+
+@@ -33,7 +33,7 @@
+ bool test __attribute__((unused)) = true;
+ const char* name = "tmp_10";
+
+- locale loc(locale("se_NO.UTF-8"));
++ locale loc(locale("no_NO.UTF-8"));
+ locale::global(loc);
+ wcin.imbue(loc);
+ wcout.imbue(loc);
+--- libstdc++-v3/testsuite/27_io/objects/wchar_t/11.cc.orig
++++ libstdc++-v3/testsuite/27_io/objects/wchar_t/11.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "se_NO.UTF-8" }
++// { dg-require-namedlocale "no_NO.UTF-8" }
+
+ // 2003-05-01 Petur Runolfsson <peturr02@ru.is>
+
+@@ -33,7 +33,7 @@
+ bool test __attribute__((unused)) = true;
+ const char* name = "tmp_11";
+
+- locale loc(locale("se_NO.UTF-8"));
++ locale loc(locale("no_NO.UTF-8"));
+ locale::global(loc);
+ wcin.imbue(loc);
+ wcout.imbue(loc);
+--- libstdc++-v3/testsuite/27_io/objects/wchar_t/12.cc.orig
++++ libstdc++-v3/testsuite/27_io/objects/wchar_t/12.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "se_NO.UTF-8" }
++// { dg-require-namedlocale "no_NO.UTF-8" }
+
+ // 2003-09-04 Petur Runolfsson <peturr02@ru.is>
+
+@@ -38,7 +38,7 @@
+ bool test __attribute__((unused)) = true;
+ const char* name = "tmp_12";
+
+- locale loc(locale("se_NO.UTF-8"));
++ locale loc(locale("no_NO.UTF-8"));
+ locale::global(loc);
+ std::ios_base::sync_with_stdio(false);
+ wcout.imbue(loc);
+--- libstdc++-v3/testsuite/27_io/objects/wchar_t/13.cc.orig
++++ libstdc++-v3/testsuite/27_io/objects/wchar_t/13.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "se_NO.UTF-8" }
++// { dg-require-namedlocale "no_NO.UTF-8" }
+
+ // 2003-09-04 Petur Runolfsson <peturr02@ru.is>
+
+@@ -36,7 +36,7 @@
+ bool test __attribute__((unused)) = true;
+ const char* name = "tmp_13";
+
+- locale loc(locale("se_NO.UTF-8"));
++ locale loc(locale("no_NO.UTF-8"));
+ locale::global(loc);
+ std::ios_base::sync_with_stdio(false);
+ wcin.imbue(loc);
+--- libstdc++-v3/testsuite/22_locale/facet/2.cc.orig
++++ libstdc++-v3/testsuite/22_locale/facet/2.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "es_MX" }
++// { dg-require-namedlocale "es_ES" }
+
+ // 2000-08-31 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -84,7 +84,7 @@
+ // 4: Named locale should destroy facets when it goes out of scope.
+ // Not quite sure how to test for this w/o valgrind at the moment.
+ {
+- locale loc03 = locale("es_MX");
++ locale loc03 = locale("es_ES");
+ }
+ }
+
+--- libstdc++-v3/testsuite/22_locale/locale/cons/5.cc.orig
++++ libstdc++-v3/testsuite/22_locale/locale/cons/5.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "en_PH" }
++// { dg-require-namedlocale "en_NZ" }
+ // { dg-require-namedlocale "de_DE" }
+ // { dg-require-namedlocale "it_IT" }
+
+@@ -76,21 +76,21 @@
+ }
+ setenv("LC_ALL", "", 1);
+
+- // Check that a "en_PH" LC_ALL is equivalent to "en_PH".
+- if (!setenv("LC_ALL", "en_PH", 1))
++ // Check that a "en_NZ" LC_ALL is equivalent to "en_PH".
++ if (!setenv("LC_ALL", "en_NZ", 1))
+ {
+ locale loc = locale("");
+- VERIFY( loc.name() == "en_PH" );
++ VERIFY( loc.name() == "en_NZ" );
+ }
+ setenv("LC_ALL", "", 1);
+
+ // Explicit check that LC_ALL sets regardless of LC_* and LANG.
+- if (!setenv("LANG", "es_MX", 1) && !setenv("LC_COLLATE", "de_DE", 1))
++ if (!setenv("LANG", "es_ES", 1) && !setenv("LC_COLLATE", "de_DE", 1))
+ {
+- if (!setenv("LC_ALL", "en_PH", 1))
++ if (!setenv("LC_ALL", "en_NZ", 1))
+ {
+ locale loc = locale("");
+- VERIFY( loc.name() == "en_PH" );
++ VERIFY( loc.name() == "en_NZ" );
+ }
+ setenv("LC_ALL", "", 1);
+ setenv("LANG", LANG_orig ? LANG_orig : "", 1);
+--- libstdc++-v3/testsuite/22_locale/locale/global_locale_objects/2.cc.orig
++++ libstdc++-v3/testsuite/22_locale/locale/global_locale_objects/2.cc
+@@ -1,5 +1,5 @@
+-// { dg-require-namedlocale "en_PH" }
+-// { dg-require-namedlocale "es_MX" }
++// { dg-require-namedlocale "en_NZ" }
++// { dg-require-namedlocale "es_ES" }
+
+ // 2000-09-13 Benjamin Kosnik <bkoz@redhat.com>
+
+@@ -32,8 +32,8 @@
+ using namespace std;
+ bool test __attribute__((unused)) = true;
+
+- const string ph("en_PH");
+- const string mx("es_MX");
++ const string ph("en_NZ");
++ const string mx("es_ES");
+ const char* orig = setlocale(LC_ALL, 0);
+ const char* testph = setlocale(LC_ALL, ph.c_str());
+ const char* testmx = setlocale(LC_ALL, mx.c_str());
+--- libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/38081-1.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/38081-1.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ru_RU.ISO-8859-5" }
++// { dg-require-namedlocale "ru_RU.ISO8859-5" }
+
+ // Copyright (C) 2010, 2011 Free Software Foundation
+ //
+@@ -33,7 +33,7 @@
+ typedef istreambuf_iterator<char> iterator_type;
+
+ // basic construction
+- locale loc("ru_RU.ISO-8859-5");
++ locale loc("ru_RU.ISO8859-5");
+
+ // create an ostream-derived object, cache the time_get facet
+ iterator_type end;
+--- libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/38081-2.cc.orig
++++ libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/38081-2.cc
+@@ -1,4 +1,4 @@
+-// { dg-require-namedlocale "ru_RU.UTF8" }
++// { dg-require-namedlocale "ru_RU.UTF-8" }
+
+ // 2010-01-05 Paolo Carlini <paolo.carlini@oracle.com>
+
+@@ -34,7 +34,7 @@
+ typedef istreambuf_iterator<char> iterator_type;
+
+ // basic construction
+- locale loc("ru_RU.UTF8");
++ locale loc("ru_RU.UTF-8");
+
+ // create an ostream-derived object, cache the time_get facet
+ iterator_type end;
diff --git a/lang/gnat-aux/files/diff-fortran b/lang/gnat-aux/files/diff-fortran
new file mode 100644
index 000000000000..edc5c06da5dd
--- /dev/null
+++ b/lang/gnat-aux/files/diff-fortran
@@ -0,0 +1,54 @@
+--- gcc/fortran/f95-lang.c.orig
++++ gcc/fortran/f95-lang.c
+@@ -823,10 +823,17 @@
+
+ gfc_define_builtin ("__builtin_cabsl", func_clongdouble_longdouble,
+ BUILT_IN_CABSL, "cabsl", ATTR_CONST_NOTHROW_LEAF_LIST);
++#if defined(__NetBSD__) && (__NetBSD__ > 4)
++ gfc_define_builtin ("__builtin_cabs", func_cdouble_double,
++ BUILT_IN_CABS, "__c99_cabs", ATTR_CONST_NOTHROW_LEAF_LIST);
++ gfc_define_builtin ("__builtin_cabsf", func_cfloat_float,
++ BUILT_IN_CABSF, "__c99_cabsf", ATTR_CONST_NOTHROW_LEAF_LIST);
++#else
+ gfc_define_builtin ("__builtin_cabs", func_cdouble_double,
+ BUILT_IN_CABS, "cabs", ATTR_CONST_NOTHROW_LEAF_LIST);
+ gfc_define_builtin ("__builtin_cabsf", func_cfloat_float,
+ BUILT_IN_CABSF, "cabsf", ATTR_CONST_NOTHROW_LEAF_LIST);
++#endif
+
+ gfc_define_builtin ("__builtin_copysignl", mfunc_longdouble[1],
+ BUILT_IN_COPYSIGNL, "copysignl",
+--- libgfortran/configure.orig
++++ libgfortran/configure
+@@ -25699,7 +25699,7 @@
+
+ fi
+ case "$host" in
+- *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* | alpha*-dec-osf* )
++ *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* | alpha*-dec-osf* | *-*-netbsd* )
+
+ $as_echo "#define GTHREAD_USE_WEAK 0" >>confdefs.h
+
+--- libquadmath/Makefile.in.orig
++++ libquadmath/Makefile.in
+@@ -393,10 +393,9 @@
+
+ # AM_CONDITIONAL on configure option --generated-files-in-srcdir
+ @BUILD_LIBQUADMATH_TRUE@@GENINSRC_TRUE@STAMP_GENINSRC = stamp-geninsrc
+-@BUILD_INFO_FALSE@@BUILD_LIBQUADMATH_TRUE@STAMP_BUILD_INFO =
++@BUILD_LIBQUADMATH_TRUE@STAMP_BUILD_INFO =
+
+ # AM_CONDITIONAL on configure check ACX_CHECK_PROG_VER([MAKEINFO])
+-@BUILD_INFO_TRUE@@BUILD_LIBQUADMATH_TRUE@STAMP_BUILD_INFO = stamp-build-info
+ @BUILD_LIBQUADMATH_TRUE@CLEANFILES = $(STAMP_GENINSRC) $(STAMP_BUILD_INFO) libquadmath.info
+ @BUILD_LIBQUADMATH_TRUE@MAINTAINERCLEANFILES = $(srcdir)/libquadmath.info
+
+@@ -1247,7 +1246,7 @@
+
+ info-am: $(INFO_DEPS)
+
+-install-data-am: install-info-am install-nodist_libsubincludeHEADERS
++install-data-am: install-nodist_libsubincludeHEADERS
+
+ install-dvi: install-dvi-am
+
diff --git a/lang/gnat-aux/files/diff-fortran-testsuite b/lang/gnat-aux/files/diff-fortran-testsuite
new file mode 100644
index 000000000000..af58f3abe20b
--- /dev/null
+++ b/lang/gnat-aux/files/diff-fortran-testsuite
@@ -0,0 +1,31 @@
+--- gcc/testsuite/gfortran.dg/large_real_kind_2.F90.orig
++++ gcc/testsuite/gfortran.dg/large_real_kind_2.F90
+@@ -1,6 +1,6 @@
+ ! { dg-do run }
+ ! { dg-require-effective-target fortran_large_real }
+-! { dg-xfail-if "" { "*-*-freebsd*" } { "*" } { "" } }
++! { dg-xfail-if "" { "*-*-freebsd*" *-*-dragonfly* *-*-netbsd* } { "*" } { "" } }
+
+ ! Testing library calls on large real kinds (larger than kind=8)
+ implicit none
+--- gcc/testsuite/gfortran.dg/large_real_kind_3.F90.orig
++++ gcc/testsuite/gfortran.dg/large_real_kind_3.F90
+@@ -1,6 +1,6 @@
+ ! { dg-do run }
+ ! { dg-require-effective-target fortran_large_real }
+-! { dg-xfail-if "" { "*-*-freebsd*" } { "*" } { "" } }
++! { dg-xfail-if "" { "*-*-freebsd*" *-*-dragonfly* *-*-netbsd* } { "*" } { "" } }
+
+ ! Testing erf and erfc library calls on large real kinds (larger than kind=8)
+ implicit none
+--- gcc/testsuite/gfortran.dg/open_errors.f90.orig
++++ gcc/testsuite/gfortran.dg/open_errors.f90
+@@ -22,7 +22,7 @@
+ if (msg /= "File 'temptestfile' does not exist") call abort()
+
+ open(77,file="./", iomsg=msg, iostat=i)
+-if (msg /= "'./' is a directory" .and. msg /= "Invalid argument") call abort()
++if (msg /= "'./' is a directory" .and. msg /= "Invalid argument" .and. msg /= "File './' already exists") call abort()
+
+ open(77,file=n,status="new")
+ i = chmod(n, "-w")
diff --git a/lang/gnat-aux/files/diff-gcc-testsuite b/lang/gnat-aux/files/diff-gcc-testsuite
new file mode 100644
index 000000000000..f371a02cd1cb
--- /dev/null
+++ b/lang/gnat-aux/files/diff-gcc-testsuite
@@ -0,0 +1,10 @@
+--- gcc/testsuite/gcc.dg/pch/pch.exp.orig
++++ gcc/testsuite/gcc.dg/pch/pch.exp
+@@ -44,6 +44,7 @@
+ set test "largefile.c"
+ set testh "largefile.hs"
+ set f [open $test w]
++puts $f "/* { dg-do run { target *-*-solaris* } } */"
+ puts $f "/* { dg-timeout-factor 4.0 } */"
+ set v 0
+ for { set v 0 } { $v < 10000 } { incr v } {
diff --git a/lang/gnat-aux/files/patch-gcc__ada__adaint.c b/lang/gnat-aux/files/patch-gcc__ada__adaint.c
deleted file mode 100644
index 3e3b787e5de0..000000000000
--- a/lang/gnat-aux/files/patch-gcc__ada__adaint.c
+++ /dev/null
@@ -1,279 +0,0 @@
---- gcc/ada/adaint.c
-+++ gcc/ada/adaint.c
-@@ -1201,6 +1201,47 @@ __gnat_tmp_name (char *tmp_filename)
- free (pname);
- }
-
-+#elif defined (__ANDROID__)
-+
-+ /*
-+ * ext2 /ext3/ext4/fat16/fat32 have no path limits
-+ * /data/local/tmp normally requires rooted devices, if it even exists
-+ * /sdcard is the standard location for external storage. Nativeactivity
-+ * manifest needs to authorize its use, otherwise it might not have the
-+ * proper permissions.
-+ */
-+
-+ int testfd;
-+ char *datadir = getenv ("ANDROID_DATA");
-+
-+ if (datadir == NULL)
-+ strcpy (tmp_filename, "/data/local/tmp/gnat-XXXXXX");
-+ else
-+ sprintf (tmp_filename, "%s/local/tmp/gnat-XXXXXX", datadir);
-+
-+ testfd = mkstemp (tmp_filename);
-+ if (testfd != -1)
-+ {
-+ close (testfd);
-+ return;
-+ }
-+
-+ char *sdcard = getenv ("EXTERNAL_STORAGE");
-+
-+ if (sdcard == NULL)
-+ strcpy (tmp_filename, "/sdcard/gnat-XXXXXX");
-+ else
-+ sprintf (tmp_filename, "%s/gnat-XXXXXX", sdcard);
-+
-+ testfd = mkstemp (tmp_filename);
-+ if (testfd != -1)
-+ {
-+ close (testfd);
-+ return;
-+ }
-+
-+ tmpnam (tmp_filename);
-+
- #elif defined (linux) || defined (__FreeBSD__) || defined (__NetBSD__) \
- || defined (__DragonFly__) \
- || defined (__OpenBSD__) || defined(__GLIBC__)
-@@ -3433,26 +3474,208 @@ _flush_cache()
- }
- #endif
-
--#if defined (IS_CROSS) \
-- || (! ((defined (sparc) || defined (i386)) && defined (sun) \
-- && defined (__SVR4)) \
-- && ! (defined (linux) && (defined (i386) || defined (__x86_64__))) \
-- && ! (defined (linux) && defined (__ia64__)) \
-- && ! (defined (linux) && defined (powerpc)) \
-- && ! defined (__FreeBSD__) \
-- && ! defined (__DragonFly__) \
-- && ! defined (__Lynx__) \
-- && ! defined (__hpux__) \
-- && ! defined (__APPLE__) \
-- && ! defined (_AIX) \
-- && ! (defined (__alpha__) && defined (__osf__)) \
-- && ! defined (VMS) \
-- && ! defined (__MINGW32__) \
-- && ! (defined (__mips) && defined (__sgi)))
--
--/* Dummy function to satisfy g-trasym.o. See the preprocessor conditional
-- just above for a list of native platforms that provide a non-dummy
-- version of this procedure in libaddr2line.a. */
-+/* run-time symbolic traceback support */
-+#if defined (__DragonFly__) \
-+ || defined (__FreeBSD__) \
-+ || defined (__OpenBSD__) \
-+ || defined (__NetBSD__)
-+
-+/* The above platforms use the external program /usr/bin/addr2line */
-+#define EXTERNAL_SYMTRACE
-+
-+#elif defined (VMS) \
-+ || defined (_AIX) \
-+ || defined (__Lynx__) \
-+ || defined (__hpux__) \
-+ || defined (__APPLE__) \
-+ || defined (__MINGW32__) \
-+ || (defined (__mips) && defined (__sgi)) \
-+ || (defined (__alpha__) && defined (__osf__)) \
-+ || (defined (linux) && defined (i386)) \
-+ || (defined (linux) && defined (powerpc)) \
-+ || (defined (linux) && defined (__ia64__)) \
-+ || (defined (linux) && defined (__x86_64__)) \
-+ || (defined (__SVR4) && defined (sun) && defined (i386)) \
-+ || (defined (__SVR4) && defined (sun) && defined (sparc))
-+
-+/* The above platforms use the system library libaddr2line.a */
-+#define NATIVE_SYMTRACE
-+#endif
-+
-+#if defined (EXTERNAL_SYMTRACE) && !defined (IS_CROSS)
-+
-+/*
-+ Copyright (C) 1999 by Juergen Pfeifer <juergen.pfeifer@gmx.net>
-+ Ada for Linux Team (ALT)
-+ Heavily modified by John Marino <http://www.dragonlace.net>
-+
-+ Permission is hereby granted, free of charge, to any person obtaining a
-+ copy of this software and associated documentation files (the
-+ "Software"), to deal in the Software without restriction, including
-+ without limitation the rights to use, copy, modify, merge, publish,
-+ distribute, distribute with modifications, sublicense, and/or sell
-+ copies of the Software, and to permit persons to whom the Software is
-+ furnished to do so, subject to the following conditions:
-+
-+ The above copyright notice and this permission notice shall be included
-+ in all copies or substantial portions of the Software.
-+
-+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-+ IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
-+ THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-+
-+ Except as contained in this notice, the name(s) of the above copyright
-+ holders shall not be used in advertising or otherwise to promote the
-+ sale, use or other dealings in this Software without prior written
-+ authorization.
-+*/
-+
-+#include <sys/types.h>
-+#include <stdlib.h>
-+#include <unistd.h>
-+#include <string.h>
-+#include <signal.h>
-+
-+#define CLOSE_SENDPIPE close(sendpipe[0]); close(sendpipe[1])
-+#define CLOSE_READPIPE close(readpipe[0]); close(readpipe[1])
-+#define DUP2CLOSE(oldfd, newfd) dup2(oldfd, newfd); close(oldfd);
-+#define RESTSIG sigaction(SIGPIPE,&oact,NULL)
-+
-+#define MAX_LINE 1024
-+#define PARENT_READ readpipe[0]
-+#define CHILD_WRITE readpipe[1]
-+#define CHILD_READ sendpipe[0]
-+#define PARENT_WRITE sendpipe[1]
-+
-+void
-+convert_addresses (const char *file_name,
-+ void *addrs,
-+ int n_addr,
-+ void *buf,
-+ int *len)
-+{
-+ int max_len = *len;
-+ pid_t childpid;
-+
-+ struct sigaction act, oact;
-+
-+ int sendpipe[2] = {-1,-1}, /* parent -> child */
-+ readpipe[2] = {-1,-1}; /* parent <- child */
-+
-+ *len = 0;
-+ act.sa_handler = SIG_IGN;
-+ sigemptyset(&act.sa_mask);
-+ act.sa_flags = 0;
-+ if (sigaction(SIGPIPE,&act,&oact) < 0)
-+ return;
-+
-+ if (pipe(sendpipe) < 0) { RESTSIG; return; }
-+ if (pipe(readpipe) < 0) { CLOSE_SENDPIPE; RESTSIG; return; }
-+ if ((childpid = fork()) < 0) {
-+ CLOSE_READPIPE;
-+ CLOSE_SENDPIPE;
-+ RESTSIG;
-+ return;
-+ }
-+
-+ if (childpid == 0) { /* child process */
-+ close(PARENT_WRITE);
-+ close(PARENT_READ);
-+ if ((CHILD_READ != STDIN_FILENO) && (CHILD_WRITE != STDOUT_FILENO)) {
-+ if ((CHILD_READ == STDOUT_FILENO) && (CHILD_WRITE == STDIN_FILENO)) {
-+ const int temp_fd = dup(CHILD_WRITE);
-+ close (CHILD_WRITE);
-+ DUP2CLOSE (CHILD_READ, STDIN_FILENO);
-+ DUP2CLOSE (temp_fd, STDOUT_FILENO);
-+ }
-+ else if ((CHILD_READ == STDIN_FILENO) && (CHILD_WRITE > 1)) {
-+ DUP2CLOSE (CHILD_WRITE, STDOUT_FILENO);
-+ }
-+ else if ((CHILD_READ > 1) && (CHILD_WRITE == STDOUT_FILENO)) {
-+ DUP2CLOSE (CHILD_READ, STDIN_FILENO);
-+ }
-+ else if ((CHILD_READ > 1) && (CHILD_WRITE == STDIN_FILENO)) {
-+ DUP2CLOSE (CHILD_WRITE, STDOUT_FILENO);
-+ DUP2CLOSE (CHILD_READ, STDIN_FILENO);
-+ }
-+ else {
-+ /* CHILD_READ >= 1 and CHILD_WRITE > 1 */
-+ DUP2CLOSE (CHILD_READ, STDIN_FILENO);
-+ DUP2CLOSE (CHILD_WRITE, STDOUT_FILENO);
-+ }
-+ }
-+ /* As pointed out by Florian Weimer to JP, it is a security threat to call
-+ the script with a user defined environment and using the path. That
-+ would be Trojans pleasure. Therefore the absolute path to addr2line
-+ and an empty environment is used. That should be safe.
-+ */
-+ char *const argv[] = { "addr2line",
-+ "-e", file_name,
-+ "--demangle=gnat",
-+ "--functions",
-+ "--basenames",
-+ NULL };
-+ char *const envp[] = { NULL };
-+ if (execve("/usr/bin/addr2line", argv, envp) < 0) {
-+ close (CHILD_WRITE);
-+ close (CHILD_READ);
-+ RESTSIG;
-+ exit (1);
-+ }
-+ }
-+
-+ /* Below this line is parent process */
-+ int i, n;
-+ char hex[16];
-+ char line[MAX_LINE + 1];
-+ char *p;
-+ char *s = buf;
-+ long *trace_address = addrs;
-+
-+ close(CHILD_WRITE);
-+ close(CHILD_READ);
-+
-+ for(i=0; i < n_addr; i++) {
-+ snprintf(hex,sizeof(hex),"%#lx\n",*trace_address);
-+ write(PARENT_WRITE,hex,strlen(hex));
-+ n = read(PARENT_READ,line,MAX_LINE);
-+ if (n<=0)
-+ break;
-+
-+ line[n]=0;
-+ /* We have approx. 16 additional chars for "%#lx in " clause.
-+ We use this info to prevent a buffer overrun. */
-+ if (n + 16 + (*len) > max_len)
-+ break;
-+
-+ p = strchr(line,'\n');
-+ if (p) {
-+ if (*(p+1)) {
-+ *p = 0;
-+ *len += snprintf(s, (max_len - (*len)), "%#lx in %s at %s",
-+ *trace_address, line, p+1);
-+ }
-+ else {
-+ *len += snprintf(s, (max_len - (*len)), "%#lx at %s",
-+ *trace_address, line);
-+ }
-+ s = buf + (*len);
-+ }
-+ trace_address += 1;
-+ }
-+ close (PARENT_WRITE);
-+ close (PARENT_READ);
-+ RESTSIG;
-+}
-+
-+#elif defined (IS_CROSS) || !defined (NATIVE_SYMTRACE)
-+
-+/* run-time symbolic traceback support
-+ Dummy function to satisfy g-trasym.o. */
-
- void
- convert_addresses (const char *file_name ATTRIBUTE_UNUSED,
diff --git a/lang/gnat-aux/files/patch-gcc__ada__g-trasym-bsd.adb b/lang/gnat-aux/files/patch-gcc__ada__g-trasym-bsd.adb
deleted file mode 100644
index 1aea17fcd9c3..000000000000
--- a/lang/gnat-aux/files/patch-gcc__ada__g-trasym-bsd.adb
+++ /dev/null
@@ -1,153 +0,0 @@
---- /dev/null 2011-09-08 20:00:00.000000000 -0500
-+++ gcc/ada/g-trasym-bsd.adb 2011-09-08 18:27:45.000000000 -0500
-@@ -0,0 +1,150 @@
-+------------------------------------------------------------------------------
-+-- --
-+-- GNAT RUN-TIME COMPONENTS --
-+-- --
-+-- G N A T . T R A C E B A C K . S Y M B O L I C --
-+-- --
-+-- B o d y --
-+-- --
-+-- Copyright (C) 1999-2009, AdaCore --
-+-- --
-+-- GNAT is free software; you can redistribute it and/or modify it under --
-+-- terms of the GNU General Public License as published by the Free Soft- --
-+-- ware Foundation; either version 2, or (at your option) any later ver- --
-+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-+-- OUT 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 distributed with GNAT; see file COPYING. If not, write --
-+-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-+-- Boston, MA 02110-1301, USA. --
-+-- --
-+-- As a special exception, if other files instantiate generics from this --
-+-- unit, or you link this unit with other files to produce an executable, --
-+-- this unit does not by itself cause the resulting executable to be --
-+-- covered by the GNU General Public License. This exception does not --
-+-- however invalidate any other reasons why the executable file might be --
-+-- covered by the GNU Public License. --
-+-- --
-+-- GNAT was originally developed by the GNAT team at New York University. --
-+-- Extensive contributions were provided by Ada Core Technologies Inc. --
-+-- --
-+------------------------------------------------------------------------------
-+
-+-- Run-time symbolic traceback support
-+-- This file is based on the work by Juergen Pfiefer which is still used
-+-- today to provide symbolic traceback support for gnu/kFreeBSD.
-+-- Incorporated in GNAT-AUX by John Marino <http://www.dragonlace.net>
-+
-+with System.Soft_Links;
-+with Ada.Exceptions.Traceback; use Ada.Exceptions.Traceback;
-+
-+package body GNAT.Traceback.Symbolic is
-+
-+ package TSL renames System.Soft_Links;
-+
-+ -- To perform the raw addresses to symbolic form translation we rely on a
-+ -- libaddr2line symbolizer which examines debug info from a provided
-+ -- executable file name, and an absolute path is needed to ensure the file
-+ -- is always found. This is "__gnat_locate_exec_on_path (gnat_argv [0])"
-+ -- for our executable file, a fairly heavy operation so we cache the
-+ -- result.
-+
-+ Exename : System.Address;
-+ -- Pointer to the name of the executable file to be used on all
-+ -- invocations of the libaddr2line symbolization service.
-+
-+ Exename_Resolved : Boolean := False;
-+ -- Flag to indicate whether we have performed the executable file name
-+ -- resolution already. Relying on a not null Exename for this purpose
-+ -- would be potentially inefficient as this is what we will get if the
-+ -- resolution attempt fails.
-+
-+ ------------------------
-+ -- Symbolic_Traceback --
-+ ------------------------
-+
-+ function Symbolic_Traceback (Traceback : Tracebacks_Array) return String is
-+
-+ procedure convert_addresses
-+ (filename : System.Address;
-+ addrs : System.Address;
-+ n_addrs : Integer;
-+ buf : System.Address;
-+ len : System.Address);
-+ pragma Import (C, convert_addresses, "convert_addresses");
-+ -- This is the procedure version of the Ada-aware addr2line. It places
-+ -- in BUF a string representing the symbolic translation of the N_ADDRS
-+ -- raw addresses provided in ADDRS, looked up in debug information from
-+ -- FILENAME. LEN points to an integer which contains the size of the
-+ -- BUF buffer at input and the result length at output.
-+ --
-+ -- Note that this procedure is *not* thread-safe.
-+
-+ type Argv_Array is array (0 .. 0) of System.Address;
-+ gnat_argv : access Argv_Array;
-+ pragma Import (C, gnat_argv, "gnat_argv");
-+
-+ function locate_exec_on_path
-+ (c_exename : System.Address) return System.Address;
-+ pragma Import (C, locate_exec_on_path, "__gnat_locate_exec_on_path");
-+
-+ B_Size : constant Integer := 256 * Traceback'Length;
-+ Len : Integer := B_Size;
-+ Res : String (1 .. B_Size);
-+
-+ use type System.Address;
-+
-+ begin
-+ -- The symbolic translation of an empty set of addresses is an empty
-+ -- string.
-+
-+ if Traceback'Length = 0 then
-+ return "";
-+ end if;
-+
-+ -- If our input set of raw addresses is not empty, resort to the
-+ -- libaddr2line service to symbolize it all.
-+
-+ -- Compute, cache and provide the absolute path to our executable file
-+ -- name as the binary file where the relevant debug information is to be
-+ -- found. If the executable file name resolution fails, we have no
-+ -- sensible basis to invoke the symbolizer at all.
-+
-+ -- Protect all this against concurrent accesses explicitly, as the
-+ -- underlying services are potentially thread unsafe.
-+
-+ TSL.Lock_Task.all;
-+
-+ if not Exename_Resolved then
-+ Exename := locate_exec_on_path (gnat_argv (0));
-+ Exename_Resolved := True;
-+ end if;
-+
-+ if Exename /= System.Null_Address then
-+ Len := Res'Length;
-+ convert_addresses
-+ (Exename, Traceback'Address, Traceback'Length,
-+ Res (1)'Address, Len'Address);
-+ end if;
-+
-+ TSL.Unlock_Task.all;
-+
-+ -- Return what the addr2line symbolizer has produced if we have called
-+ -- it (the executable name resolution succeeded), or an empty string
-+ -- otherwise.
-+
-+ if Exename /= System.Null_Address then
-+ return Res (1 .. Len);
-+ else
-+ return "";
-+ end if;
-+
-+ end Symbolic_Traceback;
-+
-+ function Symbolic_Traceback (E : Exception_Occurrence) return String is
-+ begin
-+ return Symbolic_Traceback (Tracebacks (E));
-+ end Symbolic_Traceback;
-+
-+end GNAT.Traceback.Symbolic;
diff --git a/lang/gnat-aux/files/patch-gcc__ada__gccint__Makefile.in b/lang/gnat-aux/files/patch-gcc__ada__gccint__Makefile.in
deleted file mode 100644
index 8a4b0193e329..000000000000
--- a/lang/gnat-aux/files/patch-gcc__ada__gccint__Makefile.in
+++ /dev/null
@@ -1,101 +0,0 @@
---- gcc/ada/gcc-interface/Makefile.in.orig 2011-09-08 19:57:28.000000000 -0500
-+++ gcc/ada/gcc-interface/Makefile.in 2011-09-08 18:35:48.000000000 -0500
-@@ -1184,6 +1184,7 @@
- a-numaux.ads<a-numaux-x86.ads \
- g-bytswa.adb<g-bytswa-x86.adb \
- g-socthi.adb<g-socthi-bsd.adb \
-+ g-trasym.adb<g-trasym-bsd.adb \
- s-inmaop.adb<s-inmaop-posix.adb \
- s-intman.adb<s-intman-posix.adb \
- s-osinte.adb<s-osinte-freebsd.adb \
-@@ -1219,6 +1220,7 @@
- a-numaux.ads<a-numaux-x86.ads \
- g-bytswa.adb<g-bytswa-x86.adb \
- g-socthi.adb<g-socthi-bsd.adb \
-+ g-trasym.adb<g-trasym-bsd.adb \
- s-inmaop.adb<s-inmaop-posix.adb \
- s-intman.adb<s-intman-posix.adb \
- s-osinte.adb<s-osinte-freebsd.adb \
-@@ -1253,6 +1255,7 @@
- a-numaux.ads<a-numaux-x86.ads \
- g-bytswa.adb<g-bytswa-x86.adb \
- g-socthi.adb<g-socthi-bsd.adb \
-+ g-trasym.adb<g-trasym-bsd.adb \
- s-inmaop.adb<s-inmaop-posix.adb \
- s-intman.adb<s-intman-posix.adb \
- s-osinte.adb<s-osinte-dragonfly.adb \
-@@ -1288,6 +1291,7 @@
- a-numaux.ads<a-numaux-x86.ads \
- g-bytswa.adb<g-bytswa-x86.adb \
- g-socthi.adb<g-socthi-bsd.adb \
-+ g-trasym.adb<g-trasym-bsd.adb \
- s-inmaop.adb<s-inmaop-posix.adb \
- s-intman.adb<s-intman-posix.adb \
- s-osinte.adb<s-osinte-dragonfly.adb \
-@@ -1322,6 +1326,7 @@
- a-numaux.ads<a-numaux-x86.ads \
- g-bytswa.adb<g-bytswa-x86.adb \
- g-socthi.adb<g-socthi-bsd.adb \
-+ g-trasym.adb<g-trasym-bsd.adb \
- s-inmaop.adb<s-inmaop-posix.adb \
- s-intman.adb<s-intman-posix.adb \
- s-osinte.adb<s-osinte-openbsd.adb \
-@@ -1357,6 +1362,7 @@
- a-numaux.ads<a-numaux-x86.ads \
- g-bytswa.adb<g-bytswa-x86.adb \
- g-socthi.adb<g-socthi-bsd.adb \
-+ g-trasym.adb<g-trasym-bsd.adb \
- s-inmaop.adb<s-inmaop-posix.adb \
- s-intman.adb<s-intman-posix.adb \
- s-osinte.adb<s-osinte-openbsd.adb \
-@@ -1391,6 +1397,7 @@
- a-numaux.ads<a-numaux-x86.ads \
- g-bytswa.adb<g-bytswa-x86.adb \
- g-socthi.adb<g-socthi-netbsd.adb \
-+ g-trasym.adb<g-trasym-bsd.adb \
- s-inmaop.adb<s-inmaop-posix.adb \
- s-intman.adb<s-intman-posix.adb \
- s-osinte.adb<s-osinte-netbsd.adb \
-@@ -1435,6 +1442,7 @@
- a-numaux.ads<a-numaux-x86.ads \
- g-bytswa.adb<g-bytswa-x86.adb \
- g-socthi.adb<g-socthi-netbsd.adb \
-+ g-trasym.adb<g-trasym-bsd.adb \
- s-inmaop.adb<s-inmaop-posix.adb \
- s-intman.adb<s-intman-posix.adb \
- s-osinte.adb<s-osinte-netbsd.adb \
-@@ -1472,11 +1480,13 @@
- ifeq ($(strip $(filter-out arm% android eabi,$(targ))),)
- LIBGNAT_TARGET_PAIRS = \
- a-intnam.ads<a-intnam-linux.ads \
-+ g-trasym.ads<g-trasym-unimplemented.ads \
-+ g-trasym.adb<g-trasym-unimplemented.adb \
- s-inmaop.adb<s-inmaop-posix.adb \
- s-intman.adb<s-intman-posix.adb \
- s-linux.ads<s-linux.ads \
- s-osinte.adb<s-osinte-posix.adb \
-- s-osinte.ads<s-osinte-linux.ads \
-+ s-osinte.ads<s-osinte-android.ads \
- s-osprim.adb<s-osprim-posix.adb \
- s-taprop.adb<s-taprop-linux.adb \
- s-tasinf.ads<s-tasinf-linux.ads \
-@@ -1496,12 +1506,14 @@
- mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
- indepsw.adb<indepsw-gnu.adb
-
-- EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
-+ EXTRA_LIBGNAT_SRCS+= signal_android.c
-+ EXTRA_LIBGNAT_OBJS+= signal_android.o
-+ EXTRA_GNATRTL_TASKING_OBJS= s-linux.o
- EH_MECHANISM=
-- THREADSLIB = -lpthread
-- GNATLIB_SHARED = gnatlib-shared-dual
-- GMEM_LIB = gmemlib
-- LIBRARY_VERSION := $(LIB_VERSION)
-+ THREADSLIB=
-+ GNATLIB_SHARED= gnatlib-shared-dual
-+ GMEM_LIB= gmemlib
-+ LIBRARY_VERSION:= $(LIB_VERSION)
- endif
-
-
diff --git a/lang/gnat-aux/pkg-plist b/lang/gnat-aux/pkg-plist
index bee4e625b166..a32053bf6716 100644
--- a/lang/gnat-aux/pkg-plist
+++ b/lang/gnat-aux/pkg-plist
@@ -1,24 +1,26 @@
-bin/gnat
-bin/gnatbind
-bin/gnatchop
-bin/gnatclean
+%%ADA%%bin/gnat
+%%ADA%%bin/gnatbind
+%%ADA%%bin/gnatchop
+%%ADA%%bin/gnatclean
%%CXX%%bin/gnatc++
bin/gnatcpp
-bin/gnatfind
+%%ADA%%bin/gnatfind
%%CXX%%bin/gnatg++
bin/gnatgcc
bin/gnatgcov
-bin/gnatkr
-bin/gnatlink
-bin/gnatls
-bin/gnatmake
-bin/gnatname
-bin/gnatprep
-bin/gnatxref
+%%FRT%%bin/gnatgfortran
+%%ADA%%bin/gnatkr
+%%ADA%%bin/gnatlink
+%%ADA%%bin/gnatls
+%%ADA%%bin/gnatmake
+%%ADA%%bin/gnatname
+%%ADA%%bin/gnatprep
+%%ADA%%bin/gnatxref
bin/%%GNU_HOST%%-gcc-%%GCC_VER%%
%%CXX%%bin/%%GNU_HOST%%-gnatc++
%%CXX%%bin/%%GNU_HOST%%-gnatg++
bin/%%GNU_HOST%%-gnatgcc
+%%FRT%%bin/%%GNU_HOST%%-gnatgfortran
lib/libgcc_s.so
lib/libgcc_s.so.1
lib/libiberty.a
@@ -29,8 +31,17 @@ lib/libiberty.a
%%CXX%%lib/libstdc++.so.6-gdb.py
%%CXX%%lib/libsupc++.a
%%CXX%%lib/libsupc++.la
+%%FRT%%lib/libgfortran.a
+%%FRT%%lib/libgfortran.la
+%%FRT%%lib/libgfortran.so
+%%FRT%%lib/libgfortran.so.3
+%%FRT%%lib/libgfortran.spec
+%%FRT%%lib/libquadmath.la
+%%FRT%%lib/libquadmath.a
+%%FRT%%lib/libquadmath.so
+%%FRT%%lib/libquadmath.so.0
@dirrmtry share/info
-@dirrmtry share/man/man1
@dirrmtry share/man/man7
+@dirrmtry share/man/man1
@dirrmtry share/man
@comment PLIST.lib attached below